Created
March 2, 2018 01:16
-
-
Save htkcodes/595c8e6d8358055fcaf7ddfb079e9176 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* OneSignal.on('subscriptionChange', function(isSubscribed) { | |
if (isSubscribed) { | |
console.log(isSubscribed); | |
// The user is subscribed | |
// Either the user subscribed for the first time | |
// Or the user was subscribed -> unsubscribed -> subscribed | |
OneSignal.getUserId( function(userId) { | |
$.post("/users/onesignal",{ | |
onesignal_id:userId | |
},function(response){ | |
if(response==false) | |
{ | |
Materialize.toast('Something happened while saving your notification id to the database') | |
} | |
}) | |
}); | |
} | |
}); */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment