Skip to content

t0mm13b/phonegap-parse-plugin

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cordova Parse.com Plugin

Cordova plugin for Parse.com PUSH service

This plugin exposes the four native Android API push services to JS:

Installation

cordova plugin add https://github.com/jumpbytehq/phonegap-parse-plugin --variable APP_ID=YOUR_APP_ID --variable CLIENT_KEY=YOUR_CLIENT_KEY

Initial Setup

In your Application Class -> onCreate() call ParsePlugin.initializeParseWithApplication(this);. This will register the device with Parse, you should see this reflected in your Parse control panel.

parsePlugin.initialize(appId, clientKey, function() {

	parsePlugin.subscribe('SampleChannel', function() {
		
		parsePlugin.getInstallationId(function(id) {
		
			/**
			 * Now you can construct an object and save it to your own services, or Parse, and corrilate users to parse installations
			 * 
			 var install_data = {
			  	installation_id: id,
			  	channels: ['SampleChannel']
			 }
			 *
			 */

		}, function(e) {
			alert('error');
		});

	}, function(e) {
		alert('error');
	});
	
}, function(e) {
	alert('error');
});

Usage

	parsePlugin.initialize(appId, clientKey, function() {
		alert('success');
	}, function(e) {
		alert('error');
	});
  
	// Tested & Working
	parsePlugin.getInstallationId(function(id) {
		alert(id);
	}, function(e) {
		alert('error');
	});
	
	parsePlugin.getSubscriptions(function(subscriptions) {
		alert(subscriptions);
	}, function(e) {
		alert('error');
	});
	
	// Tested & Working
	parsePlugin.subscribe('SampleChannel', function() {
		alert('OK');
	}, function(e) {
		alert('error');
	});
	
	// Tested & Working
	parsePlugin.unsubscribe('SampleChannel', function(msg) {
		alert('OK');
	}, function(e) {
		alert('error');
	});

Compatibility

Tested with Cordova >= 5.0.0

About

Cordova plugin for Parse.com push service, with framework version updated for android, ios

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Objective-C 96.7%
  • Java 2.2%
  • Other 1.1%