トピックの購読を止めることで、プッシュ通知を止めることができます。
以下に例を挙げます。
// Assume that the current user is subscribed to the target topic and // the topic has been instantiated. try { // Unsubscribe from the topic. KiiUser user = KiiUser.getCurrentUser(); KiiPushSubscription sub = user.pushSubscription(); sub.unsubscribe(topic); } catch (IOException ioe) { // Handle the error. } catch (AppException e) { // Handle the error. }
// Assume that the current user is subscribed to the target topic and // the topic has been instantiated. // Unsubscribe from the topic. KiiUser user = KiiUser.getCurrentUser(); KiiPushSubscription sub = user.pushSubscription(); sub.unsubscribe(topic, new KiiPushCallBack() { @Override public void onUnSubscribeCompleted(int taskId, KiiSubscribable target, Exception exception) { if (exception != null) { // Handle the error. return; } } });
pushSubscription
unsubscribe