08-17-2012 06:14 AM
Ok, I managed to get the push messages on the app! The alert triggered after a reinstall ![]()
But I can't seem to get the notifications while the app is open. Is it possible to show the notification on the device desktop, like the other native apps?
Thanks again!
08-17-2012 09:18 AM
08-17-2012 10:15 AM
That good news that you've been able to make progress.
I see in the sample code you posted beofre that you are specifying index.html as your wakeUpPage. So when a push comes in and your application is closed the following page will be loaded.
var wakeUpPage = "index.html";
Can you confirm that the body onload in your index.html calls the blackberry.push.openBISPushListener() function?
Also from the Push API reference it says you must specify the rim:allowInvokeParams="true" in your config.xml
https://developer.blackberry.com/html5/apis/blackb
For example,
<content src="index.html" rim:allowInvokeParams="true" />
You may also want to add the following feature to your config.xml
<feature id="blackberry.invoke" required="true" version="1.0.0.0"/>
08-17-2012 11:42 AM
Ok, so I did confirm the blackberry.push.openBISPushListener() is called on the body load of index.html and added those configurations to the config.xml file (i was missing the feature blackberry.invoke).
When I have the application open, the notifications arrive perfectly, but when I close the app or when I switch to another task (using the BB key) the notifications cease.
Do you know if this is possible to do? I mean, how does the push notification know where the index.html page is if the app is closed?
08-17-2012 12:17 PM
08-17-2012 02:16 PM
08-17-2012 03:28 PM
Ok, understood, thanks ![]()
My app only has the index.html page, I'm using jquery mobile to change the display, so my only page has the body onload calling the openBISPushListener... what else can I check?
08-23-2012 06:37 AM - edited 08-23-2012 06:40 AM
I have been having the exact same issue and fixed it by moving openBISPushListener out of the onload event as follows:
Change
<script type="text/javascript" charset="utf-8">
function onLoad() {
openBISPushListener();
}
</script>
...
<body onload="onLoad()"> to
<script type="text/javascript" charset="utf-8"> openBISPushListener(); </script>
It seems that the onLoad event gets fired too late so that the push listener is not declared in time to catch the notification, thus causing an exception. I understand it is better practice to defer loading of javascript but unfortunetly this is the only solution I can think of at present . . .
09-03-2012 07:29 AM
Thanks for the tip, Ryanthegiantlion, but I already tried that and it didn't work...
09-03-2012 10:43 AM
Have you given up on this? I noticed your original post was from quite a few weeks ago. . .
It did take some time but I eventually had some success using Pushwoosh.