Skip to content

catchmartin/XtremePush_Phonegap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PhoneGap: Getting Started with XtremePush

With the XtremePush module for PhoneGap you can add XtremePush to both iOS and Android apps built with PhoneGap.

Platform Specific Information

XtremePush supports push notifications for iOS devices via Apples's Push Notification Service (APNs for short). And push notifications for Android devices via Google’s GCM (Google Cloud Messaging for Android) service. This page contains PhoneGap specific instructions but It is also recommended you read the native documentation for these platforms. This includes the quick start guides:

These docs deal with important topics like:

Both platforms also have documentation on setting up advanced features when integrating XtremePush into your Application:

Advanced features include: tagging of events, custom push notification handling and location services.

XtremePush PhoneGap SDK Setup

First, download the current XtremePush PhoneGap SDK here. Inside of the ZIP you will find the following directories:

  • Example_Apps/ : This folder contains a sample app for each OS supported. The apps are in a folder named after the OS they are related to, for example the iOS example app is in the ios/ folder.
  • www/: This folder contains the javascript part of the plugin. OS specific portion of the plugin in a folder named after that OS i.e. src/iOS/ or src/Android/.

Full integration guides are given for iOS and Android below.

Integrate Xtremepush to your PhoneGap iOS Project

  1. Navigate to you iOS PhoneGap project in platforms/ios directory.
  2. Download the XtremePush iOS library here and add it to your iOS project following these instructions
  3. Navigate to your application directory, and type command: cordova plugin add https://github.com/xtremepush/XtremePush_Phonegap

Tagging your app to enable deeper audience analysis and segmentation

XtremePush has two methods for tagging activity in your app one for tagging page impressions and one for tagging any other activity.

To tag page impression add the following method where your page loads:

// Send impression to server to track page impressions
XTremePush.hitImpression(successCallback, failCallback, "your_impression_name");

To tag any other events send a tag to server using the following method:

// E.g. you might want to tag a button press
XTremePush.hitTag(successCallback, failCallback, "your_tag_name");

Phonegap Example iOS App

  1. When you have downloaded the latest plugin version (here) it comes with example apps.

  2. Extract the archive, it contains the folder XtremePush_phonegap/ and the iOS example app can be found in Example_Apps/ios/

  3. To experiment with this sample app open it in Xcode. It is a simple app with all the XtremePush library methods mapped to a series of buttons:

Phonegap example app

  1. You can see how the plugin has been configured in the test app in key locations such as: the plugin folders, app delegate, cordova_plugins.js, config.xml, index.js and index.html (see image below).

Test app in Xcode

Integrate Xtremepush to your PhoneGap Android Project

  1. Add XtremePush Android Library to your Project. Please follow instructions.
  2. Navigate to your application directory, and type command: cordova plugin add https://github.com/xtremepush/XtremePush_Phonegap

PhoneGap Example Android App

  1. When you have downloaded the latest plugin version (here it comes with example apps.

  2. Extract the archive, it contains the folder XtremePush_phonegap/ and the Android example app can be found in Example_Apps/android/

  3. To experiment with this sample app open it in your IDE. It is a simple app with all the XtremePush library methods mapped to a series of buttons:

Phonegap example app

  1. You can see how the plugin has been configured in the test app in key locations such as: the src/ folder, assets/www/ folder or res/xml/config.xml.

About

Phonegap plugin for XtremePush system

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •