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

BlackBerry Push Development

Reply
Developer
simon_hain
Posts: 15,845
Registered: ‎07-29-2008
My Device: Z10 LE
My Carrier: O2 Germany
Accepted Solution

Questions regarding BB10 BDS Push

[ Edited ]

My setup is as following:

- a simple java  app, half a decade old, that calls this url with POST.

 new URL("http", "is-hh-bb01", 8080, "/push?DESTINATION=" + pin + "&PORT=" + pushPort + "&REQUESTURI=/");

 - the PushCollector sample

 

1. I read here that i need to specify X-Wap-Application-Id header with the PackageID+PackageName in the request, is this also correct when i don't use PAP but MDS push?

2.When i run the java code i get response code 200 Http.OK, does that mean it works server-side?

3. When i start the PushCollector app i select BDS, save without entering any settings and get an error code 10002. Do i have to install it on the work perimeter to work, or why is it not doing anything?

4. (edit) i installed pushCollector on the work perimeter but still get error code 10002. how to proceed?

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
BlackBerry Development Advisor (Retired)
mdandrea
Posts: 311
Registered: ‎08-08-2012
My Device: BlackBerry Z10
My Carrier: Rogers

Re: Questions regarding BB10 BDS Push

Hi Simon,

 

I'm actually not sure about changes made to MDS Push for BES 10, so I can't help out with 1. unfortunately.

 

I can answer 3 and 4.  

Yes, you need to make sure you install the application on the work perimeter.

Also, try removing _sys_use_consumer_push from your bar-descriptior.xml before creating the BAR and see if that helps.

 

Matt

Please use plain text.
Developer
simon_hain
Posts: 15,845
Registered: ‎07-29-2008
My Device: Z10 LE
My Carrier: O2 Germany

Re: Questions regarding BB10 BDS Push

Hi Matt, i got the same answer yesterday from Garret and it helped, i am getting the push correctly.

How is it possible that removing a permission makes something work?

Regarding the first question, could you find out if i use the "old MDS push" just with the port like the olden days, or could i specify an application id there?
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
BlackBerry Development Advisor (Retired)
mdandrea
Posts: 311
Registered: ‎08-08-2012
My Device: BlackBerry Z10
My Carrier: Rogers

Re: Questions regarding BB10 BDS Push

Hi Simon,

 

The permission is related to personal/public push so when you specify it for an enterprise push app (even if you deploy the app in the work perimeter) it confuses it.

 

For the MDS push question you had asked, I came across this post that might help:

http://supportforums.blackberry.com/t5/Cascades-Development/BB10-client-can-t-get-BES10-push/m-p/239...

 

Matt

Please use plain text.
Developer
simon_hain
Posts: 15,845
Registered: ‎07-29-2008
My Device: Z10 LE
My Carrier: O2 Germany

Re: Questions regarding BB10 BDS Push

I have moved the push code to my own app, but it does not receive the push.

the debug log seems to indicate that the registration succeeded, maybe you can doublecheck that?

 

31.05.2013, 15:59:09.167 Debug  dname:  "com.appName.gYABgK9Te3QXnLMG.NXRWigU9fs"  providerApplicationId:  "7596" 
31.05.2013, 15:59:09.168 Debug Connect to personal/consumer agent:  false 
31.05.2013, 15:59:09.168 Debug perimeter[ 2 ] personal:1 enterprise:2 
31.05.2013, 15:59:09.169 Debug Encoded app id:  "7596" 
31.05.2013, 15:59:09.171 Debug sendMessage: raw payload [ "dat:json:{"dName":"com.appName.gYABgK9Te3QXnLMG.NXRWigU9fs","perimeter":2,"providerApplicationId":"7596","targetKey":"com.appName.invoke.push"}
id::createSession_9276
msg::createSession
" ] 
31.05.2013, 15:59:09.172 Debug sendMessage: write to pps: success
31.05.2013, 15:59:09.173 Debug sendMessage: raw payload [ "dat:json:{"dName":"com.appName.gYABgK9Te3QXnLMG.NXRWigU9fs","perimeter":2,"providerApplicationId":"7596","targetKey":"com.appName.invoke.push"}
id::registerToLaunch_9276
msg::registerToLaunch
" ] 
31.05.2013, 15:59:09.175 Debug sendMessage: write to pps: success
31.05.2013, 15:59:09.796 Debug receive message: @ipc_enterprise
msg::onCreateSessionComplete
id::createSession_9276
31.05.2013, 15:59:09.797 Debug err is  0 
31.05.2013, 15:59:09.798 Debug No dat section 
31.05.2013, 15:59:09.799 Debug receive message: @ipc_enterprise
msg::onRegisterToLaunchComplete
id::registerToLaunch_9276

31.05.2013, 15:59:09.800 Debug err is  0 
31.05.2013, 15:59:09.801 Debug No dat section 

 

I use my"server code" that successfully sends a push to PushCollector (on port 7874), change the port to 7596 (randomly selected). But no push arrives for the application.

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
BlackBerry Development Advisor (Retired)
mdandrea
Posts: 311
Registered: ‎08-08-2012
My Device: BlackBerry Z10
My Carrier: Rogers

Re: Questions regarding BB10 BDS Push

Where is your call to create channel?

Please use plain text.
Developer
peter_strange
Posts: 19,598
Registered: ‎07-14-2008
My Device: Not Specified

Re: Questions regarding BB10 BDS Push

Agree with Matt, the create Channel seems to be missing. 

 

The createChannel comes back an id.  I persist that ID, and if it is in the database, as per then documentation, I don't do the createChannel again. 

 

For me, the ID is always the device PIN. 

 

For BES you don't need an id on the createChannel, so in my code I just have

 

_pushService->createChannel(QString());

Please use plain text.
Developer
simon_hain
Posts: 15,845
Registered: ‎07-29-2008
My Device: Z10 LE
My Carrier: O2 Germany

Re: Questions regarding BB10 BDS Push

ah, the empty QString parameter was missing in my equation.
I read that you don't have a pushProxyGatewayUrl with BES push and omitted this.

I'll try that. Maybe the documentation could be updated to reflect that the parameter should be empty for BES push?
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
Developer
simon_hain
Posts: 15,845
Registered: ‎07-29-2008
My Device: Z10 LE
My Carrier: O2 Germany

Re: Questions regarding BB10 BDS Push

Ok, push arrives!
Maybe i should write a simplified sample again :smileywink:
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
Developer
peter_strange
Posts: 19,598
Registered: ‎07-14-2008
My Device: Not Specified

Re: Questions regarding BB10 BDS Push

Please do.

 

I suspect the current pushCollector sample works well in a BIS push environment, where it manages the complications like subscription.  But it is a steep learning curve, perhaps there is a case for a simple sample that is not worried about the complications.  Also from my testing, the pushCollector sample does not work unaltered in a BES push environment.  So I would at least separate the samples for BES and BIS push, which would actually simplify the program for BIS users too. 

Please use plain text.