Skip to content

Instantly share code, notes, and snippets.

@htkcodes
Created March 2, 2018 01:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save htkcodes/595c8e6d8358055fcaf7ddfb079e9176 to your computer and use it in GitHub Desktop.
Save htkcodes/595c8e6d8358055fcaf7ddfb079e9176 to your computer and use it in GitHub Desktop.
/* 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