Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #9 from webworks/next-pushDemo

Next push demo
  • Loading branch information...
commit d365c289f5994fb037be2198ad224b6d1723cc7f 2 parents 81e267e + f802b86
Hasan Ahmad haahmad authored
Showing with 50 additions and 9 deletions.
  1. +48 −8 pushCapture/README.md
  2. +2 −1  pushCapture/config.xml
56 pushCapture/README.md
View
@@ -2,6 +2,10 @@
The Push Capture sample app (post coming soon!) demonstrates how to write a BlackBerry 10 WebWorks application that is able to receive pushes.
+Consult the **PushService** and **PushPayload** classes from the API reference for useful examples and a full description of how to use the
+push APIs. The API reference can be found [here](https://developer.blackberry.com/html5/apis/). Look under the **Push** heading from the menu
+on the left side.
+
The sample code for this application is Open Source under the [Apache 2.0 License](http://www.apache.org/licenses/LICENSE-2.0.html).
@@ -29,19 +33,55 @@ To build the Push Capture sample application:
2. Select **Download as zip** (Windows) or **Download as tar.gz** (Mac) and save the downloaded file to your local machine.
3. Create a new folder on your local machine named **pushCapture** e.g. **C:\Documents and Settings\User\WebWorks\pushCapture** (Windows) or **~/WebWorks/pushCapture** (Mac).
4. Open the downloaded ZIP file from step 2 and extract the contents **from inside the zipped pushCapture folder** to your local **pushCapture** folder from step 3. This ensures that the necessary application assets, such as **config.xml**, are correctly located at the top level of the local **pushCapture** folder (e.g. **~/WebWorks/pushCapture/config.xml**).
-5. When you're ready to try out the Push Capture sample app on your BlackBerry 10 device (the simulator is not yet supported), make sure you first download the **[BlackBerry 10 WebWorks SDK](https://developer.blackberry.com/html5/download/sdk)**.
-6. Create a ZIP file from your local **pushCapture** folder with **config.html** and the HTML files at the **root level** of your ZIP (the root level should not be a folder). See **[Creating a WebWorks archive file](https://developer.blackberry.com/html5/documentation/ww_developing/creating_an_archive_file_1873325_11.html)** for more details.
+5. When you're ready to try out the Push Capture sample app on your BlackBerry 10 device (the simulator and Ripple are not yet supported), make sure you first download the **[BlackBerry 10 WebWorks SDK](https://developer.blackberry.com/html5/download/sdk)**.
+6. Create a ZIP file from your local **pushCapture** folder with **config.xml** and the HTML files at the **root level** of your ZIP (the root level should not be a folder). See **[Creating a WebWorks archive file](https://developer.blackberry.com/html5/documentation/ww_developing/creating_an_archive_file_1873325_11.html)** for more details.
7. Follow the instructions from **[Package your BlackBerry 10 app with the BlackBerry 10 WebWorks SDK](https://developer.blackberry.com/html5/documentation/ww_developing/package_your_bb10_app_with_ww_sdk_2008473_11.html)** to get the app running on your BlackBerry 10 device.
-## How to send a push to the Push Capture sample application
-In order to be able to send pushes to the Push Capture sample app, you will need to write a server-side push application (called a Push Initiator) to send out pushes with.
-Luckily, this is fairly easy to do using the Push Service SDK available here: https://developer.blackberry.com/services/push.
+## How to send a push
-You'll find all the documentation for the Push Service SDK here: http://docs.blackberry.com/en/developers/subcategories/?userType=21&category=Push+Service.
+In order to be able to send pushes to the Push Capture sample app, you will need to write a server-side push application (called a Push Initiator) to send out pushes with.
+Luckily, this is fairly easy to do using the Push Service SDK available [here](https://developer.blackberry.com/services/push).
+
+You'll find all the documentation for the Push Service SDK [here](http://docs.blackberry.com/en/developers/subcategories/?userType=21&category=Push+Service).
+
+Note that in order to use the Push Service for developing an application for the general public, you will have to first register [here](https://www.blackberry.com/profile/?eventId=8121).
+
+
+## How to receive a push
+
+1. Start the Push Capture sample application (if you haven't done so already).
+2. An alert will pop up telling you that you need to configure the sample application. You will be taken to the configuration screen.
+3. Click **Public/BIS** if the PPG is the BlackBerry Internet Service or **Enterprise/BES** if the PPG is the BlackBerry Enterprise Server.
+4. Clear the **Use Push Service SDK as Push Initiator** check box if one of the following is true:
+i) You implemented a Push Initiator that does not use the Push Service SDK.
+ii) Your Push Initiator only uses the low-level APIs without subscription support from the Push Service SDK.
+5. If the **Use Push Service SDK as Push Initiator** check box is selected, in the **Application ID** field, perform one of the
+following actions:
+i) If you are using the BlackBerry Internet Service as the PPG, type the application ID specified in the confirmation
+email message that you received from RIM.
+ii) If you are using the BlackBerry Enterprise Server as the PPG, type a unique application ID of your choosing. If you
+clear the **Use Push Service SDK as Push Initiator** check box, you cannot type an application ID. In this case, the
+Push Service APIs create an application ID for you automatically.
+6. If you are using the BlackBerry Internet Service as the PPG, in the **PPG URL** field, type the PPG base URL specified in
+the confirmation email message. The sample application uses this URL to create a channel to the PPG. For an
+evaluation environment, the URL is http://cp{cpid}.pushapi.eval.blackberry.com, where {cpid} is your content
+provider ID. For a production environment, the URL is http://cp{cpid}.pushapi.na.blackberry.com.
+7. If the **Use Push Service SDK as Push Initiator** check box is selected, in the **Push Initiator URL** field,
+type https://{server_address}/pushsdk, where {server_address} is the address of the server where the pushsdk helper
+application is deployed. The SDK includes the pushsdk helper application that is deployed on a server, such as the
+Apache Tomcat server. The URL must be accessible from the Internet. Of course, you can also point to your own
+running Push Initiator application instead of the provided pushsdk helper one.
+8. Click the **Launch App on New Push** check box if you want to start the sample application if it is not already started
+when a new push message arrives. Leave the check box unchecked if you do not want to start the sample application
+when a new push message arrives.
+9. Click **Save**.
+10. Tap the **Register** tab at the bottom of the device screen. The register screen will appear.
+11. If you had previously checked the **Use Push Service SDK as Push Initiator** check box, you will be required to enter a username and password.
+These will be mapped, after authentication, to a subscriber ID in your Push Initiator. If the **Use Push Service SDK as Push Initiator** check box
+had not been checked, then simply click **Submit**.
+12. You're all set to receive pushes!
-Note that in order to use the Push Service for developing an application for the general public, you will have to first register here:
-https://www.blackberry.com/profile/?eventId=8121.
## More Info
3  pushCapture/config.xml
View
@@ -1,3 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
<!--
* Copyright 2012 Research In Motion Limited.
*
@@ -13,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
-->
-<?xml version="1.0" encoding="UTF-8"?>
<widget xmlns:rim="http://www.blackberry.com/ns/widgets" version="1.0.0.0" rim:header="RIM-Widget:rim/widget" xmlns="http://www.w3.org/ns/widgets" id="pushcapture">
<rim:orientation mode="portrait" />
<name>Push Capture</name>
Please sign in to comment.
Something went wrong with that request. Please try again.