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
Contributor
Posts: 30
Registered: ‎09-19-2013
My Device: None
Accepted Solution

createChannel and enterprise

int the documentation I have read this:

"Creates a push channel for the given application. Once a channel is created, it will survive application restarts and therefore does not necessarily need to be called on every application start up.

However, for a consumer application, since it is possible for the public/BIS PPG to destroy a channel under certain circumstances it may be advisable to periodicially re-create the channel (e.g. once a month).

A successful create must have been done before calling this function.

This function should be called in order for an application to be able to start receiving pushes. If adestroyChannel call is then made, no pushes will be able to be received until a createChannelcall is made again."

 

Does this also apply for enterprise? Do I have to recreate the push channel?

Retired
Posts: 1,561
Registered: ‎04-12-2010
My Device: BlackBerry Z10

Re: createChannel and enterprise

You shouldn't have to recreate the push channel, even on BIS it is very rare.

Ideally, there would be a bit of monitoring. You could recreate channels every X number of days, but more appropriate would be to monitor the time since the last push was received. If this amount of time exceeds what is "normal for your application" then it may be worth recreating the channel.

For instance, if your application provides multiple updates daily, then after 2-3 days of no incoming pushes, it may be worth trying to recreate the channel. However if you simply push out a weekly newsletter, it may be better to wait 15 days with no push before recreating. It really depends on the context of the app.

An easy way to keep track of the time between is to leverage Local Storage when a push comes in to just record the time, and use that time to compare against when the next push comes in.


Ultimately though, both BIS and BES channels should persist for the lifetime of the app on a device, there are just some rare occurrences that could happen, so it doesn't hurt to monitor.

Erik Oros | @WaterlooErik | eoros@blackberry.com | Developer Issue Tracker

If a reply has answered your question, please click Accept as Solution to help other visitors in the future.
Contributor
Posts: 30
Registered: ‎09-19-2013
My Device: None

Re: createChannel and enterprise

thanks for the answer. What is the recommended way of recreating the push channel?

My enterprise app might not be used by its users for over a month, but it still needs to be updated with the most recent data from server. its very important. Data might only change once a year.

 

I was thinking that I could send out a push message every month to make sure the device has a open channel

Retired
Posts: 1,561
Registered: ‎04-12-2010
My Device: BlackBerry Z10

Re: createChannel and enterprise

To recreate a channel, you simply need to call the createChannel API once more:

http://developer.blackberry.com/html5/apis/blackberry.push.pushservice.html#createChannel

 

Anytime that is called, the channel is recreated and the new one is used.

 

The process you describe sounds solid.


Erik Oros | @WaterlooErik | eoros@blackberry.com | Developer Issue Tracker

If a reply has answered your question, please click Accept as Solution to help other visitors in the future.