Need help with phonegap-parse-plugin?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

avivais
196 Stars 327 Forks 82 Commits 65 Opened issues

Description

Phonegap 3.0.0 plugin for Parse.com push service

Services available

!
?

Need anything else?

Contributors list

# 3,088
Postgre...
pg
postgre...
Koa
21 commits
# 307,043
CSS
Shell
PHP
12 commits
# 13,636
JavaScr...
perf
CSS
test-fr...
12 commits
# 67,649
Symfony
node
React
nodemon
4 commits
# 399,388
Shell
Bitcoin
micropy...
CSS
4 commits
# 402,066
CSS
C#
4 commits
# 164,810
CSS
C#
3 commits
# 441,553
CSS
C#
1 commit
# 501,629
CSS
C#
1 commit
# 547,951
CSS
C#
1 commit

Phonegap Parse.com Plugin

Phonegap 3.0.0 plugin for Parse.com push service

Using Parse.com's REST API for push requires the installation id, which isn't available in JS

This plugin exposes the four native Android API push services to JS: * getInstallationId * getSubscriptions * subscribe * unsubscribe

Installation

Pick one of these two commands:

phonegap local plugin add https://github.com/benjie/phonegap-parse-plugin --variable APP_ID=PARSE_APP_ID --variable CLIENT_KEY=PARSE_CLIENT_KEY
cordova plugin add https://github.com/benjie/phonegap-parse-plugin --variable APP_ID=PARSE_APP_ID --variable CLIENT_KEY=PARSE_CLIENT_KEY

Initial Setup

Once the device is ready, call

parsePlugin.initialize()
. This will register the device with Parse, you should see this reflected in your Parse control panel. After this runs you probably want to save the installationID somewhere, and perhaps subscribe the user to a few channels. Here is a contrived example.

(Note: When using Windows Phone, clientKey must be your .NET client key from Parse. So you will need to set this based on platform i.e. if( window.device.platform == "Win32NT"))

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

Quirks

Android

Parse needs to be initialized once in the

onCreate
method of your application class using the
initializeParseWithApplication
method.

If you don’t have an application class (which is most likely the case for a Cordova app), you can create one using this template:

package my.package.namespace;

import android.app.Application; import org.apache.cordova.core.ParsePlugin;

public class App extends Application {

@Override
public void onCreate() {
    super.onCreate();
    ParsePlugin.initializeParseWithApplication(this);
}

}

And add your application name to

AndroidManifest.xml
:
...

Compatibility

Phonegap > 3.0.0

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.