Client-side apps
A client-side push-enabled app runs on a device. It uses the Push Service to communicate with a server-side app, called a push initiator. Before you develop your own push-enabled app, you may find it helpful to try out the Push Capture sample app available on GitHub.
Prerequisites
To develop and test a client-side push-enabled app, you need the following:
Item | Details |
---|---|
Server-side push initiator |
To test your client-side push-enabled app, you need a server-side push initiator. You can choose the library that you want to use to develop your server-side app. Some possibilities are: the Push Service SDK, NodeJS, and JavaScript. |
The application ID and PPG URL for your server-side push iniator |
After you register your push app with BlackBerry, you get this information by email. For more information about registering, see Push Service and the Push Service Evaluation Form. If your app will send pushes only through BES10 or BES12, you don't need to register. |
Client-side library |
BlackBerry 10 WebWorks SDK 2.0 or later |
BlackBerry device |
A BlackBerry 10 device with access to a wireless network |
Register to use the Push Service
You need to be registered to test your client-side push app. Fill out the BlackBerry Push Service Evaluation Form.
If you are creating an enterprise app that sends pushes only through BES10 or BES12, you don't need to register.
When your application is approved, you receive an email that confirms your registration details and provides the following information:
- Account Administration Portal
-
- Portal URL: https://cpadmin.pushapi.eval.blackberry.com/mss/CP_login
- Portal Username: <your email address>
- Portal Password
- Server Configuration Details
-
- Application ID
- Push Password
- Content Provider ID (CPID)
- Account Expiration Date
- Push URL: https://cp<your CPID>.pushapi.eval.blackberry.com
- Client Configuration Details
-
- Application ID
- Push Registration URL: http://cp<your CPID>.pushapi.eval.blackberry.com
- Push Port
The Application ID is the same for your server-side and client-side apps. You can ignore the Push Port because it is not required for BlackBerry 10 push apps.
Add the Push Service plugins to your project
- com.blackberry.push
- com.blackberry.invoked
You can add a plugin from the command line or using the SDK web tool. With either method, the plugin gets copied to your project's plugins folder and the required <feature> element gets added to your app's config.xml file. The next time you build your app, the contents of the plugin are packaged together with your other app resources.
To add the plugins from the command line:
- Open a command prompt in your app's project folder.
- Run the following
commands:
webworks plugin add com.blackberry.push webworks plugin add com.blackberry.invoked
To add the plugins using the SDK web tool:
- With your project open in the SDK web tool, in the navigation panel, click Plugins.
- In the Plugin Name or URL field, type com.blackberry.push and then click Add plugin.
- Repeat the previous step for the com.blackberry.invoked plugin.
Update your config.xml file
Before you can use the Push Service APIs with your app, you also need to update your app's config.xml file with the following statements.
Last modified: 2017-10-12
Got questions about leaving a comment? Get answers from our Disqus FAQ.
comments powered by Disqus