MOBILE

BlackBerry Development : Pushing Data to External Users - Web Signals (part 4) - Building a Web Signal - Pushing Data to Subscribers

9/21/2013 3:36:33 AM
3.3 Pushing Data to Subscribers

To push data to one or more subscribers, the push application must build an HTTP POST request that contains all the information needed for the push and deliver it to the same server described above. The POST URL contains all the information passed to the RIM Push Infrastructure; the body of the POST is not used to deliver any information.

The Push URL is formatted with the following information:

https://[push-domain]/mss/PM_submitJob?sid=[SID]
&pass=[SID-Password]&validfor=[expiration]&title=[title]
&readiconURL=[Read-Icon]&unreadiconURL=[Unread-Icon]&
contentURL=[Content-URL]&puids=[PUID-List]

HTTPS protects the contents of the SID and SID password when delivered in the URL.

Table 6 provides a description for each of the push URL parameters.

Table 6. Web Signal Push Request URL Parameters
Push ParameterDescription
Push-DomainThe regional domain that the push recipient resides in. Refer to Table 3 for the possible values for this parameter.
SIDThe Service ID (SID) assigned to this Web Signal by RIM.
SID-PasswordThe password associated with the SID.
ExpirationThe time, in seconds, that the push request is valid. The minimum value is 7,200 seconds (2 hours) and the maximum value is 86,400 seconds (24 hours).
TitleSpecifies the title that appears on the BlackBerry Home Screen for the Web Signal. The push application uses this value to identify the Web Signal on the device, but can also use it to provide some information about the contents of the signal. (Refer to Figure 6 for an example of how this is used by AccuWeather in their service.) The title must be in English and can be of a maximum length of 256 bytes. Valid characters for the title are both upper and lower alpha-numeric characters (A-z and 0-9), plus the !, -, @, ., and _ characters. It can contain internal spaces, but both leading and trailing spaces are removed.
Read-IconSpecifies the absolute URL for the icon file (in PNG format) displayed after the mobile user opens the signal after a successful push. The icon file must conform to the standards for BlackBerry application icons and the URL accessible by external (outside the firewall) resources.
Unread-IconSpecifies the absolute URL for the icon file (in PNG format) displayed until the mobile user has openeds the signal after a successful push. The icon file must conform to the standards for BlackBerry application icons and the URL accessible by external (outside the firewall) resources.
Content -URLSpecifies the absolute URL for content being pushed to the device. The URL provided here will be opened in the browser when the user opens the Web Signal. The URL can be up to 2,048 bytes in length.
PUID-ListComma-separated list of subscriber PUIDs to which the content will be delivered. The push application can push to all subscribers for the SID by using ALL_USERS for this parameter.

The requirement for Icon URLs to be absolute URLs pointing to the icon file is based on the fact that the BlackBerry device retrieves the icons separately after the push request has been received. The BlackBerry Device Software has to know exactly where to locate the file and has to be able to access the file from outside the company’s firewall. The icon URL can be up to 2,048 bytes in length.

Assuming email address is used for the PUID, to push content to a North American subscriber, the push URL would look like this:

https://push.na.blackberry.com/mss/PM_submitJob?
sid=mywebsignal&pass=mypassword&validfor=86400&title=
My%20Web%20Signal&readiconURL=http://ws.someserver.com/
read.png&unreadiconURL
=http://ws.someserver.com/unread.png&contentURL=
ws.someserver.com/signal&puid=someuser@somecompany.com

Because spaces are not valid characters in Internet URLs, the example used %20 to encode any spaces in the URL provided.

If the push application needed to push to more than one subscriber, the push URL would look like this:

https://push.na.blackberry.com/mss/PM_
submitJob?sid=mywebsignal
&pass=mypassword&validfor=86400&title=My%20Web%20Signal
&readiconURL=http://ws.someserver.com/read.png
&unreadiconURL=http://ws.someserver.com/unread.png
&contentURL=ws.someserver.com/signal
&puid=someuser@somecompany.com,anotheruser@abc.com,
yetanotheruser@def.com

If the push application wanted to push to all subscribers of the service, a sample push URL would be

https://push.na.blackberry.com/mss/PM_
submitJob?sid=mywebsignal
&pass=mypassword&validfor=86400&title=My%20Web%20Signal
&readiconURL=http://ws.someserver.com/read.png
&unreadiconURL=http://ws.someserver.com/unread.png
&contentURL=ws.someserver.com/signal&puid=ALL_USERS

For a successful push request, the push server responds with a JobID. The job ID identifies the push request for debugging purposes or if the content provider needs to open an investigation with RIM. For unsuccessful requests, the server returns rc=some-value, where some-value is one of the response codes listed in Table 7.

Table 7. Web Signals Subscriber Registration Response Codes
Response CodeDescription
0500A SID was not included in the push request URL.
0501A SID password was not included in the push request URL.
0502A PUID was not included in the push request URL.
0503Authentication failed.
0504A title was not included in the push request.
0505A read icon URL was not included in the push request.
0506An unread icon URL was not included in the push request.
0507A content URL was not included in the push request.
0508The push expiration (validFor) parameter was not included in the push request.
0509Invalid title.
0510The read icon URL is not a valid URL.
0511The unread icon URL is not a valid URL.
0512The content URL is not a valid URL.
0513The validFor parameter is not valid.
0514The value for validFor parameter is not between the minimum and maximum allowed values (7200 < value < 86400).
0515The SID has expired or is not active.
0516The SID has exceeded the daily limit for push requests.
1000The system is currently unavailable.
Other  
 
Top 10
Extending LINQ to Objects : Writing a Single Element Operator (part 2) - Building the RandomElement Operator
Extending LINQ to Objects : Writing a Single Element Operator (part 1) - Building Our Own Last Operator
3 Tips for Maintaining Your Cell Phone Battery (part 2) - Discharge Smart, Use Smart
3 Tips for Maintaining Your Cell Phone Battery (part 1) - Charge Smart
OPEL MERIVA : Making a grand entrance
FORD MONDEO 2.0 ECOBOOST : Modern Mondeo
BMW 650i COUPE : Sexy retooling of BMW's 6-series
BMW 120d; M135i - Finely tuned
PHP Tutorials : Storing Images in MySQL with PHP (part 2) - Creating the HTML, Inserting the Image into MySQL
PHP Tutorials : Storing Images in MySQL with PHP (part 1) - Why store binary files in MySQL using PHP?
REVIEW
- First look: Apple Watch

- 3 Tips for Maintaining Your Cell Phone Battery (part 1)

- 3 Tips for Maintaining Your Cell Phone Battery (part 2)
VIDEO TUTORIAL
- How to create your first Swimlane Diagram or Cross-Functional Flowchart Diagram by using Microsoft Visio 2010 (Part 1)

- How to create your first Swimlane Diagram or Cross-Functional Flowchart Diagram by using Microsoft Visio 2010 (Part 2)

- How to create your first Swimlane Diagram or Cross-Functional Flowchart Diagram by using Microsoft Visio 2010 (Part 3)
Popular Tags
Microsoft Access Microsoft Excel Microsoft OneNote Microsoft PowerPoint Microsoft Project Microsoft Visio Microsoft Word Active Directory Biztalk Exchange Server Microsoft LynC Server Microsoft Dynamic Sharepoint Sql Server Windows Server 2008 Windows Server 2012 Windows 7 Windows 8 Adobe Indesign Adobe Flash Professional Dreamweaver Adobe Illustrator Adobe After Effects Adobe Photoshop Adobe Fireworks Adobe Flash Catalyst Corel Painter X CorelDRAW X5 CorelDraw 10 QuarkXPress 8 windows Phone 7 windows Phone 8 BlackBerry Android Ipad Iphone iOS