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
Posts: 79
Registered: ‎09-17-2012
My Device: Torch 9800
My Carrier: DiGi
Accepted Solution

BB10 - Destroy Push Channel

Hello all. I run into a problem testing the Push Service.

 

The app I'm testing uses appId in the ops variable to be used in the create push service. Let's say for example the app quit before the channel is being destroyed, how I can detect a channel being created and then delete it and create another channel when user load the app?

 

My app is having appId conflict as two of the testing app uses the same appId (forgot to change one the appId before loading Smiley Mad) and the push won't go to any of the app and I have to to a device wipe to try again. 

Retired
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10
My Carrier: Bell

Re: BB10 - Destroy Push Channel

Why are you destroying the channel every time the app is closed? The channel should stay created indefinitely. There is no easy way for your app to check to see if the channel is created or not, but tracking its status in memory would likely be your best option.

Garett
@garettBeuk
--
Goodbye everybody!
Developer
Posts: 79
Registered: ‎09-17-2012
My Device: Torch 9800
My Carrier: DiGi

Re: BB10 - Destroy Push Channel

This is just to prevent two app from using the same appId. Probably it won't happen in live environment as user can only install one app.

 

While testing I have different version of the app and because of that there's conflict of appId (forgot to destroy the channel before loading another app **doh**). So I was wondering if there is a way to detect and delete channel.

Retired
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10
My Carrier: Bell

Re: BB10 - Destroy Push Channel

You can save the channel status in device memory. That would be a very accurate way to know if the channel exists.

 

When the app is deleted the channel should be deleted as well.

 

Keep in mind that trying to test two apps on the same device using the same credentials is in gneral not a good idea. You should apply for a second set of credentials for the second app. Credentials are free and will save you having to worry about issues such as this one and conflicting registrations on the same device.

Garett
@garettBeuk
--
Goodbye everybody!