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: 19
Registered: ‎02-19-2014
My Device: Blackberry Q10
My Carrier: Airtel
Accepted Solution

Unable to Receive Push Notification

[ Edited ]

Hi i am new to Blackberry development.

When i tried with sample Push Initiator which comes with Push SDK and Sample Push-enabled application[Push Capture] from github i can Receive Pushes in that sample application.

But when i try the same logic in My own client application i am not receiving Pushes..

Steps I followed:

  1. Registered with Push service and got Confirmation mail with AppID,Password and PPG url.

  2. With those details i set to receive Pushes like:Called the create function and createChannel,success callback was called and it returned device token also. But still i am not receiving Pushes in my application.Plz help where i am lagging.

Doubts:

1) How Pushes differentiate the client app and devices while sending Pushes.

 

NOTE:i used the same AppID which i used for sample app. Can we use same App ID for different applications.

 

Plz suggest

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

Re: Unable to Receive Push Notification

Could you give this sample a shot?
https://github.com/blackberry/BB10-WebWorks-Samples/tree/WebWorks-2.0/pushCaptureBasics

If uses WebWorks 2.0 and you'll need to provide your own credentials / application IDs. If you start re-using application IDs, you could run into issues.

Both the Initiator and Client can be installed on the same device (by default the Initiator pushes to itself.)

A lot of the extra stuff is left out and the goal with that sample is to show the bare-bones push setup.

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: 19
Registered: ‎02-19-2014
My Device: Blackberry Q10
My Carrier: Airtel

Re: Unable to Receive Push Notification

Hi now i am able to RECEIVE pushes in my application..i am stucked at one more point..
When I use
new Notification(title,options);
splat icon gets added on 3 places(Blackberry Hub,Notifications and App icon)..if I remove that line of code I am not getting splat on 3 places.. My requirement is splat should display on 2 places (Hub and Notifications screen), Only place I don't want to display splat is above App' s icon in Home screen..
Any particular line of code to remove?? Plz suggest
Retired
Posts: 1,561
Registered: ‎04-12-2010
My Device: BlackBerry Z10
My Carrier: Bell

Re: Unable to Receive Push Notification

Hi there, with the notification it's all or nothing, you won't be able to specify where the splat shows up. I'm also not seeing a way to clear the splat through APIs; though these would make good submissions to the Developer Issue Tracker as a feature request.

 

That being said, the Application Icon splat is a standard part of the BlackBerry 10 experience so most users should just see it as part of the usual. For example, if I receive a Facebook notification, the Facebook icon still has the splat as well.


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: 19
Registered: ‎02-19-2014
My Device: Blackberry Q10
My Carrier: Airtel

Re: Unable to Receive Push Notification

Oh i think if we remove splat, it will not display in 3 places also..I searched in net also..i didnt get
Contributor
Posts: 19
Registered: ‎02-19-2014
My Device: Blackberry Q10
My Carrier: Airtel

Re: Unable to Receive Push Notification

[ Edited ]

HI i have one doubt regarding PushService object once we call the blackberry.push.PushService.create() ..
Steps:
1) Launch App
2) Call blackberry.push.PushService.create()
3) PushService object is created as a result of create()

4) when i close the app and launch again, i need to again call create() ..Stuck in this point,Plz suggest.

Note:

In sample PushCapture app only once they configured and registered.So when app is closed or relaunched also they are not calling create() again and they are Receiving Pushes even when the app is closed. BUT i am not receiving Pushes when app is closed.

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

Re: Unable to Receive Push Notification

Hi there,

 

You can find a simplified push sample here:

https://github.com/blackberry/BB10-WebWorks-Samples/tree/WebWorks-2.0/pushCaptureBasics

 

You'll notice that the pushClient does call register on every load:

https://github.com/blackberry/BB10-WebWorks-Samples/blob/WebWorks-2.0/pushCaptureBasics/pushClient/w...

 

This is in order to create a proper instance of the PushService object. However, the sample does not call the registerChannel function every time (this only needs to be done once, essentially.)

 

 

In order to receive pushes while in the background, on creation we call PushService.launchApplicationOnPush:

https://github.com/blackberry/BB10-WebWorks-Samples/blob/WebWorks-2.0/pushCaptureBasics/pushClient/w...

 

And, when the application is launched from a background push, we actually wait for the PushService object to be instantiated before processing any pending pushes:

https://github.com/blackberry/BB10-WebWorks-Samples/blob/WebWorks-2.0/pushCaptureBasics/pushClient/w...


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: 19
Registered: ‎02-19-2014
My Device: Blackberry Q10
My Carrier: Airtel

Re: Unable to Receive Push Notification

Thankyou so much for your sample app..Now i am able to receive pushes when app is closed also.
Contributor
Posts: 19
Registered: ‎02-19-2014
My Device: Blackberry Q10
My Carrier: Airtel

Re: Unable to Receive Push Notification

Contributor
Posts: 19
Registered: ‎02-19-2014
My Device: Blackberry Q10
My Carrier: Airtel

Re: Unable to Receive Push Notification

Also one more doubt..
When we createChannel for the first time, if i send Pushes from Push Initiator, when will i receive the Push..How much time it will take for the push to Receive in that Device for FIRST TIME when it registers in BPS.

NOTE: I REgistered device for FIRST TIME and got push after 1 or 2 days only