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

Native Development

Reply
Highlighted
New Contributor
Posts: 2
Registered: ‎04-07-2010
My Device: Z10
My Carrier: O2
Accepted Solution

BB10 client can't get BES10 push

My Cascades client needs BES10 push(only enterprise).

It creates PushService with "205" as applicationId, but can't create channel.

 

        m_pushService = new PushService(providerApplicationId, INVOKE_TARGET_KEY_PUSH, this);

//providerApplicationId = "205"

//targetKey = "com.example.pushCollector.invoke.MYpush"

....

m_pushService->createChannel(QString("")) gets error 10102 which means:

" PpgUrlMissing = 10102

    Indicates that a PPG URL was not specified while attempting to perform a create channel operation.

    This result code can occur from any of the following PushService operations: createChannel().

    Recommended action: This usually means a programming error in the application. Make sure that a PPG URL is specified when performing a Create Channel operation."

 

Still, https://developer.blackberry.com/html5/apis/blackberry.push.pushservice.html#.create says: " If writing an enterprise application, no ppgUrl value should be specified."

 

Please help with correct initialization of PushService for BES10 push using old "port" method.

 

thanks at advance

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: BB10 client can't get BES10 push

I too am struggling to get a BB10 BES only push application working.

 

According to the documentation, you should not need to specify a provider ID for BES connection, but when I did that I got a 10002 attempting to create a connection.  Now that I have the connection, I get a 10102 like you trying for the channel.

 

I have posted a similar question in the Push Service forum, hopefully someone in one place will be able to help.

New Contributor
Posts: 3
Registered: ‎07-17-2008
My Device: Not Specified

Re: BB10 client can't get BES10 push

[ Edited ]

In the bar-descriptor.xml, do not request _sys_use_consumer_push permission


    <!-- permission system="true">_sys_use_consumer_push</permission -->

Set the AppId to the port

 

    m_pushService = new PushService("205", INVOKE_TARGET_KEY_PUSH, this); 

 

Set the PPG Url to null in createChannel

 

    m_pushService->createChannel(QString());

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: BB10 client can't get BES10 push

Thanks for this.

 

I have actually started receiving requests when I specify the port 7874.  Nothing else seems to work.  I used 7874 since a review of the MDS logs suggests that is the port that it always uses. 

 

So can you tell me how you managed to make the port number work?  I would love to be able to use this since it would provide us with a way of targeting the pushes to applications.

 

Just for the record, we are trying the following scenarios from the BB end.

 

a) We have the sample pushCollector, in which I have deliberately overridden the PushService call to specify 7874.

b) I have my own application that I am attempting to listen on a specific port

 

and from the Server end:

 

1) We are trying to migrate an old BBOS application that used push - it used RIM push and specifying the device and the port

2) We have some new code that creates a PAP push using the new XML configuration.

 

The only thing that works is the PAP push (2), and it is always picked up by the sample pushCollector ( a ). 

New Contributor
Posts: 3
Registered: ‎07-17-2008
My Device: Not Specified

Re: BB10 client can't get BES10 push

Peter,

 

I used the same push code that we've been using on BES5:

 

http://bes10one:9080/push?DESTINATION=12345678&PORT=205&REQUESTURI=/

This is to BES 10.1, but also works against BES 10.0

 

The request goes as a POST, with the payload in the Post data, as usual.

 

I haven't retested using a Pap push yet - my main concern was to get pushes out from our existing App Server which has been pushing to BES5 and BB Java OS devices using the RIM-push format.

 

regards,

Geof

 

 

Retired
Posts: 311
Registered: ‎08-08-2012
My Device: BlackBerry Z10
My Carrier: Rogers

Re: BB10 client can't get BES10 push

I just wanted to clear up one thing about not having to specify an application ID when you create a PushService instance for BES 10.

 

You don't have to specify one, because it uses a default one which I mention in the http://supportforums.blackberry.com/t5/BlackBerry-Push-Development/BES10-Push-Question/td-p/2288267/... thread.

 

If you don't specify one, it uses this rule for the application ID:

If you look at the BAR file itself for the app it would be in the META-INF/MANIFEST.MF file.

You basically would take the Package-Name entry and the Package-Id entry and combine them with a period in between.

 

Application package identifier = Package-Name + "." + Package-Identifier

 

You would then need to specify this value in your X-Wap-Application-Id header.

 

Also, 7874 is the browser port.  Unfortunately, BES 10 does not support browser push anymore (at least for the time being).

 

Matt

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: BB10 client can't get BES10 push

[ Edited ]

Thanks for all the input.

 

We seem to have this working satisfactorily, if not perhaps perfectly. 

 

The Server push code has not changed, we are pushing to the device PIN and the port.

 

When we create the 'channel' on the client, we open a PushService using:

providerApplicationId - the port that was specified in the push

targetKey - the id from the bar descriptor - appname.invoke.push - see below.

 

This seems to work well, and provides us with the ability to have multiple applications on device each 'listening' to a different port.  We have done some brief testing and it appears that the the first application that grabs the port (providerApplicationId) gets to keep it. 

 

This is working well enough for us.  However if it is not a correct approach, I would appreciate a heads up!

 

Regarding the last post by mdandrea, what this seems to be saying, is that when using PAP push, you can direct a push to an application by specifying the X-Wap-Application-Id, using the naming convention as described.

 

We had actually tried this, and it didn't seem to work for us. We got nothing through, for either our application or the pushCollector sample, until we changed the providerApplicationId to specify the port.  With 7874 specified, we got stuff through.

 

That said, we seem to have a strange situation now where everything pushed to 7874, and our application port, actually ends up in our application, including PAP pushes.  I suspect there is something else going on here that we are not understanding.

 

When we delete an application, I presume this deletes any registrations that are enabled for pushing?

 

The bar descriptor contains the following:

   

<invoke-targetid="appname.invoke.push">

<type>APPLICATION</type>

<filter>

<action>bb.action.PUSH</action>

<mime-type>application/vnd.push</mime-type>

</filter>

</invoke-target>

New Contributor
Posts: 3
Registered: ‎07-17-2008
My Device: Not Specified

Re: BB10 client can't get BES10 push

Something new for BES10, in the "BlackBerry Enterprise Service Development Guide" page 12:

 

"Note: For RIM push, the application ID can be passed in the PORT  parameter."

 

I think the BES does not check for the application-ID being used on the device, using RIM Push.

 

Using PAP Push, the BES won't send Push to a device, if the BES doesn't know the application with that Application ID is installed on the device. BES gives error 3012 in this case.

New Contributor
Posts: 2
Registered: ‎04-07-2010
My Device: Z10
My Carrier: O2

Re: BB10 client can't get BES10 push

thanks everybody, it works now

Developer
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: BB10 client can't get BES10 push

Just a note as I near completion of my exhaustive examination of everything that's required for push to work, or prevents it from working, with BIS PAP push and BES10 (both /pap and /push style) pushes...

From everything I can tell, this supposed "port" number that peter_strange and others are describing is not really what I'd call a port number, with BB10.

If you use an empty string app id to initialize the PushService(), it will assign for you the default id built from Package-Name + "." + Package-Id fields in your MANIFEST.MF (which come from the bar-descriptor.xml and your author name).

To match that, you specify the same PORT= value. This has worked here in all cases where I've had all my other ducks in a row.

I've also tried using some other arbitrary string in both places (i.e. explicitly giving my own made-up identifier when initializing PushService() and after PUSH=) and that works just as well.

None of this applies (yet) in my experiments with BES /pap pushes, which mostly don't work at all (and so far only with 10.2, when they do work at all).

In short, I don't think you should think of this as a "port" value of any sort with BES10/BB10, other than to the extent that the query string parameter is named PORT. When you're specifying what looks like an integer port number, it's treated as merely a sequence of characters, the same as any other identifier you could put in.

Not sure if that will help anyone... I'm learning a lot right now that I wish I'd known before, and none of it is documented anywhere, as far as I can tell. Discussions like the above were leading me to the wrong conclusions at one point.


Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!