トピックの購読を止めることで、プッシュ通知を止めることができます。
以下に例を挙げます。
// Assume that the current user is subscribed to the target topic and // the topic has been instantiated. // Unsubscribe from the topic. var user = KiiUser.getCurrentUser(); user.pushSubscription().unsubscribe(topic).then( function(params) { var thePushSubscription = params[0]; var theTopic = params[1]; // Do something. } ).catch( function(error) { // Handle the error. var thePushSubscription = error.target; var errorString = error.message; } );
// Assume that the current user is subscribed to the target topic and // the topic has been instantiated. // Unsubscribe from the topic. var user = KiiUser.getCurrentUser(); user.pushSubscription().unsubscribe(topic, { success: function(thePushSubscription, theTopic) { // Do something. }, failure: function(thePushSubscription, errorString) { // Handle the error. } });
pushSubscription
KiiPushSubscription
unsubscribe