08-01-2013 02:17 AM - edited 08-02-2013 02:03 AM
Can someone help me to find the write way
Actually I trying to use the PushService on BIS.
I create a Session by calling createSesstion() on pushServeice object., after that on session created successfully then I call createChannel on pushServeice object. (This is two sequential step procedure)
Since according the doc ,
1. Create session sets up inter-process communication between the application and the PNS agent. This must be called every time the application is launched.
2. Creates a channel for receiving push messages from the Push Initiator. Once the channel is successfully established, the application does not have to call this again.
Since I am calling these two call in sequential every time when application is launched ,
Does we have any way to know that I already created channel before, now this time does not require this call again. ??
Please suggest me, how can I avoid the next createChannel call ?
Your reply are valuable for me. Thanks in advance
08-04-2013 08:17 PM
Right now there is no way to know if you've already created a channel. So the best solution is to just save a setting value inside your app that says "I've created a push channel already". Then, if that value is set, don't create a channel again.
However, you may also want to save the device serial number, OS version, and a few other things along with that value. If any of those change, then try creating the channel again.
This is because if a user does a backup/restore of their device, the push registration may be lost, and you'll have to call create channel again.
08-06-2013 01:27 AM
08-06-2013 01:34 AM
I don't think BlackBerry wants people calling createChannel() every time. It also has some network/server overhead, and may take some time to process.
I suggest instead trying to track a few bits of information that identify the device and OS, and only call it again if those change. (and maybe a timestamp, so you also call it again if its been a few weeks)