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

Android™ Runtime Development

Reply
Contributor
gumpyboy
Posts: 42
Registered: ‎09-25-2010
My Device: Not Specified
Accepted Solution

Many question about PUSH implementation (within Eclipse environment)

hi everyone, i have some question about push on android runtime here, because i haven't find a full example for this, please help me,  :Helpsmilie:

 

  1. In the link : http://developer.blackberry.com/android/apisupport/creating_push-enabled_android_apps.html says, we have to insert PUSH config file android.cfg in unsigned .bar file, but in eclipse we can only create signed bar with 'Sign for Appworld' , so how and where should i put the android.cfg file??
  2. I saw that the permission 'Entry-Point-System-Actions: _sys_use_consumer_push' has been added the bar manifest, but it failed the code signing request (Error: Code signing request failed because [_sys_use_consumer_push] in Entry-Point-System-Actions is not allowed.).
    How should we resolve it ?
  3. In android, every client / device should register their device to the push service server, in this case google server, so they can start receiving the push. How to do register / unregister device in bb 10 ?
  4. On the server side, are we just have to write the push content string like we did in android (GCM which i've tried) ??

---------

 

sorry because i asked too much, please help me.. Btw, a full example for client and server side will be a great help in case someone want to share.. thanks

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

Re: Many question about PUSH implementation (within Eclipse environment)

Have you applied for Push Service access yet? This is specific to BlackBerry and in the form there is a place to enter your code signing email so you can receive the appropriate permissions:

https://developer.blackberry.com/develop/platform_services/push_overview.html

 

3. Send the token of the device (currently the PIN) which gets generated after registering to your server.

 

4. How are you Pushing Today? BlackBerry uses PAP XML HTTP Posts, but also works with Urban Airship. 

Garett
@garettBeuk
--
Goodbye everybody!
Contributor
gumpyboy
Posts: 42
Registered: ‎09-25-2010
My Device: Not Specified

Re: Many question about PUSH implementation (within Eclipse environment)

[ Edited ]

Thanks garett,

 

  1. for the android.cfg , i placed [my_project_name].cfg in the root of my project folder, when Signing for Appworld with Eclipse, the file will be bundled in the signed .bar as android.cfg
  2. i've applied for the push service and the code signing keys, with matching email address, now the [_sys_use_consumer_push] is no longer a problem
  3. still unclear to me,
    • with android GCM, we register to by sending application id, <GCMRegistrar.register(this, "[application id]")>
    • with android C2DM, we register by sending email
    • with BB (java), by sending device PIN number to BPS server url

      do you mean we register to BPS server like BB (java) ??
  4. BlackBerry uses PAP XML HTTP Posts -> so i guess it is the same like current implementation of Push Service

 

one question is still in doubt, please help me... :Helpsmilie:

 

 

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

Re: Many question about PUSH implementation (within Eclipse environment)

The BPS server registration should happen automatically, the registration I was referring to was to your server-side application.

 

From the server-side you will need to use the BlackBerry-specific Push implementation, using this method the device PIN is used to address the messages. So the easiest way for your server to know the address of the device would be for your app to send off a network message with the PIN to your server.

Garett
@garettBeuk
--
Goodbye everybody!
Contributor
gumpyboy
Posts: 42
Registered: ‎09-25-2010
My Device: Not Specified

Re: Many question about PUSH implementation (within Eclipse environment)

Hi, Garett ,

for the server side, i've implemented the old BPS Push server application which is working fine for Java application, but for BB10, it cannot work,   

 

the BB10 device PIN was not registered, so i suspect the device is not registering it self to BPS Server via GCM or C2DM.

 

Do you or anyone have sample for the GCM implementation ? Thank you

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

Re: Many question about PUSH implementation (within Eclipse environment)

GCM isn't supported today, only C2DM.

Garett
@garettBeuk
--
Goodbye everybody!
Retired
mwhiteman
Posts: 159
Registered: ‎11-21-2008
My Device: BlackBerry 10

Re: Many question about PUSH implementation (within Eclipse environment)

Just wanted to follow up on this as GCM is support.

 

In your andorid.cfg is the appId the registration ID that was given to you  when you signed up fro the BlackBerry Push Service? You soould have recieved a Push service URL as well which would need to be in the android.cfg file.

 

Basicly ensure the parts in Red below are populated with the correct information from the Push service registration.

 

<?xml version="1.0" encoding="utf-8"?>
<android>
     <push>
          <appid>xxxxxxxx</appid>
          <ppgurl>xxxxxxxxxxx</ppgurl>
          <tokenprefix>bb-</tokenprefix>
     </push>
</android>
Matt Whiteman
Product Manager, Android, BlackBerry Java & Simulators
Retired
gbeukeboom
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10

Re: Many question about PUSH implementation (within Eclipse environment)


mwhiteman wrote:

Just wanted to follow up on this as GCM is support.


Yep, that was my bad, I didn't realize support was added in the recent Beta drop.

 

If you are using the Push Service SDK server-side then you would also need to implement logic to send the PIN to the server to register your device, this won't happen automatically.

Garett
@garettBeuk
--
Goodbye everybody!
Contributor
gumpyboy
Posts: 42
Registered: ‎09-25-2010
My Device: Not Specified

Re: Many question about PUSH implementation (within Eclipse environment)

Hi matt,

 

I've unzipped the signed .bar file, and yes, it do have the android.cfg file just like your example, like this :

 

<?xml version="1.0" encoding="utf-8"?>
<android>
     <push>
          <appid>xxxx-adasdasxcasfaefasdasdefwef</appid>
          <ppgurl>https://cpxxxx.pushapi.eval.blackberry.com</ppgurl>
          <tokenprefix>bb-</tokenprefix>
     </push>
</android>

but is still generate error : "handleRegistration: registrationId = null, error = SERVICE_NOT_AVAILABLE, unregistered = null"

 

am I still missing something here?

Contributor
gumpyboy
Posts: 42
Registered: ‎09-25-2010
My Device: Not Specified

Re: Many question about PUSH implementation (within Eclipse environment)

Hi garett, we have already created module for the purpose to keep the reference of push subscriber, but it runs after the registration to BPS server is success.