Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Phonegap for Enterprise

You're reading from   Phonegap for Enterprise Master the art of building secure enterprise mobile applications using PhoneGap

Arrow left icon
Product type Paperback
Published in Dec 2014
Publisher
ISBN-13 9781783554751
Length 192 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Kerri Shotts Kerri Shotts
Author Profile Icon Kerri Shotts
Kerri Shotts
Arrow right icon
View More author details
Toc

Table of Contents (11) Chapters Close

Preface 1. PhoneGap and Enterprise Mobility FREE CHAPTER 2. Building the Data Store and Business Logic 3. Securing PhoneGap Apps 4. Building the Middle-Tier 5. Communicating between Mobile and the Middle-Tier 6. Application Events and Storage 7. Push Notifications 8. Building the Presentation Tier A. Useful Resources Index

Sending a Push via Boxcar


Sending a Push Notification can be done quite easily from the Boxcar console, but this isn't useful when we want these pushes to be sent automatically. Thankfully, Boxcar utilizes an HTTP API, which means we can generate a push from anything that can generate HTTP requests.

You'll need to obtain the Publisher Access Key and Publisher Secret Key to send a Push Notification programmatically. To do this, follow these steps:

  1. On the Dashboard, click on the gear icon for our Boxcar project.

  2. Click on Publishers.

  3. Click on Tasker API and you should be presented with a screen that contains the necessary keys as well as some example codes you can use. We have modified the Python example and placed it in /ch7/sendPush.

Sending a push boils down to this process:

  1. A push object is created, as follows:

    push = { "taskId": "21" , // custom data
      "f": "0",        // indicates if has rich content 0=no
      "i": "17327",    // id for push
      "badge": "auto", // badge (iOS) "auto" or a number...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image