Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
Developer
guilmori
Posts: 21
Registered: ‎02-03-2009
My Device: Not Specified

Push request lost during a page load

On startup of my Widget, I retrieve data from a web service call, then store this data on the device.
The data stored on the device may become out of date, and need to be refresh in "real time".


To do this, I tried to send push request from other application that modify the data, and having my Widget listen for push. On reception of a push, this trigger web service call to retrieve new data.


This work fine, except that the push reception is 100% guaranteed in the Widget. When my Widget navigate to another page, during the time the page load (and the PushListener isn't yet active), push request get lost.

 

Is there a way for push request to be held in somekind of queue, giving the time for the listener to catch them ?

Please use plain text.
BlackBerry Development Advisor
tneil
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: Push request lost during a page load

The push request should not be lost.  It has be designed to queue up any incoming data until you re-assign a call back handler on the subsequent page load.

 

When you re-subscribe to the push event listener there isn't any data there?

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Please use plain text.
Developer
guilmori
Posts: 21
Registered: ‎02-03-2009
My Device: Not Specified

Re: Push request lost during a page load

[ Edited ]
Here some sample code to reproduce the problem. I'm using soapUI to send the push request to the BES. Both pages receive successfully the push (alert is displayed). However, if I click the button in page1 and then send a push right after (during the loading screen), page2 will load without displaying the alert, which result in a lost push.

push.js


page1.htm


page2.htm
Please use plain text.