Skip to content
Browse files

added insert installation method

  • Loading branch information...
1 parent ce7ba92 commit 4fb3ad60a247632d92622b800197b515f4123ad8 @Leveton committed Dec 12, 2012
Showing with 17 additions and 0 deletions.
  1. +6 −0 lib/Parse.js
  2. +11 −0 readme.md
View
6 lib/Parse.js
@@ -83,6 +83,12 @@ Parse.prototype = {
// remove an object from the class store
delete: function (className, objectId, callback) {
parseRequest.call(this, 'DELETE', '/1/classes/' + className + '/' + objectId, null, callback);
+ },
+
+ // upload installation data
+ insertInstallationData: function (deviceType, deviceToken, callback) {
+ data = { deviceType: deviceType, deviceToken: deviceToken}
+ parseRequest.call(this, 'POST', '/1/installations/', data, callback);
}
};
View
11 readme.md
@@ -76,4 +76,15 @@ examples
} else {
console.log(response);
}
+ });
+
+### insert installation data
+
+ //first arg is either 'ios' or 'android'. second arg is either the Apple deviceToken or the Android installationId. The other args are optional
+ app.insertInstallationData("ios", "0123456784abcdef0123456789abcdef0123456789abcdef0123456789abcdef", function(err, response){
+ if (err) {
+ console.log(err);
+ } else {
+ console.log(response);
+ }
});

0 comments on commit 4fb3ad6

Please sign in to comment.
Something went wrong with that request. Please try again.