Skip to content

Commit

Permalink
Update FCMPlugin.js
Browse files Browse the repository at this point in the history
recovered getToken method
  • Loading branch information
fechanique committed Jan 17, 2017
1 parent 44983eb commit 5ec3f78
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions www/FCMPlugin.js
Expand Up @@ -4,9 +4,6 @@ function FCMPlugin() {
console.log("FCMPlugin.js: is created");
}




// SUBSCRIBE TO TOPIC //
FCMPlugin.prototype.subscribeToTopic = function( topic, success, error ){
exec(success, error, "FCMPlugin", 'subscribeToTopic', [topic]);
Expand All @@ -20,15 +17,20 @@ FCMPlugin.prototype.onNotification = function( callback, success, error ){
FCMPlugin.prototype.onNotificationReceived = callback;
exec(success, error, "FCMPlugin", 'registerNotification',[]);
}
// TOKEN REFRESH CALLBACK //
FCMPlugin.prototype.onTokenRefresh = function( callback ){
FCMPlugin.prototype.onTokenRefreshReceived = callback;
}
// GET TOKEN //
FCMPlugin.prototype.getToken = function( success, error ){
exec(success, error, "FCMPlugin", 'getToken', []);
}

// DEFAULT NOTIFICATION CALLBACK //
FCMPlugin.prototype.onNotificationReceived = function(payload){
console.log("Received push notification")
console.log(payload)
}
// TOKEN REFRESH CALLBACK //
FCMPlugin.prototype.onTokenRefresh = function( callback ){
FCMPlugin.prototype.onTokenRefreshReceived = callback;
}
// DEFAULT TOKEN REFRESH CALLBACK //
FCMPlugin.prototype.onTokenRefreshReceived = function(token){
console.log("Received token refresh")
Expand Down

0 comments on commit 5ec3f78

Please sign in to comment.