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
dsc
Contributor
dsc
Posts: 10
Registered: ‎02-27-2013
My Device: Dev Alpha B
My Carrier: none

SessionAlreadyExists = 10112

Hi!

We had this error (SessionAlreadyExists = 10112) once on a device. The same app with the same APP_ID and PPG URL works without error, normally.

So the api doc of this error doesn't explain for what reason this error could occur.

(http://developer.blackberry.com/cascades/reference/bb__network__pusherrorcode.html#enumvalue-session...

 

Can someone give me a more detailed explaination of this error.

 

The app creates a session on startup. So this should just called once in the app lifecycle. Also there is no destroySession method. So how should we respond to this error? And don't forget it just occured once.

Please use plain text.
dsc
Contributor
dsc
Posts: 10
Registered: ‎02-27-2013
My Device: Dev Alpha B
My Carrier: none

Re: SessionAlreadyExists = 10112

I just got some new information...

When the error occured two versions of the same app (slightly different) have been installed on the device. Could this be the source of the error?

Please use plain text.
BlackBerry Development Advisor (Retired)
marco_dicesare
Posts: 76
Registered: ‎08-08-2012
My Device: BlackBerry Z10
My Carrier: Rogers

Re: SessionAlreadyExists = 10112

It can - each app on the device must have it's own unique application id. As a content provider/push initiator you can register for multiple applications.

Please use plain text.
BlackBerry Development Advisor (Retired)
marco_dicesare
Posts: 76
Registered: ‎08-08-2012
My Device: BlackBerry Z10
My Carrier: Rogers

Re: SessionAlreadyExists = 10112

Sorry I should also say the provider application ID and target key pair you specify in the PushService constructor must be unique on the device. If another application has already registered with that pair you will get the 10112 error code when you try and create the session. Again, your best bet if you want two push-enabled applications on the device is to get a unique provider application ID for each. 

 

There is no destroy session API because it is not required. As I mentioned applications should each have their own unique provider application ID. Create session should be called on the start up of your application. It does not need to be destoryed and will be closed automatically when the user closes the application.

 

It's also worth mentioning if both your applications share the same package id (this can be found in your .bar file /META-INF/MANIFEST.MF file) you will also get this error. Typically package id's are auto generated and unique per application, however, it is possible for users to override the <packageId> specified in the bar-descriptor.xml which may cause an issue if the same value is chosen.

 

 

Please use plain text.