Bucket の購読解除

Bucket の講読を止めると、その Bucket で更新があってもプッシュ通知を受信しないようにできます。

Bucket の購読を解除する例を以下に挙げます。

  • // Instantiate the target bucket.
    KiiUser user = KiiUser.getCurrentUser();
    KiiBucket bucket = user.bucket("_target_bucket_");
    
    try {
      // Unsubscribe from the bucket.
      user.pushSubscription().unsubscribeBucket(bucket);
    } catch (IOException e) {
      // Handle the error.
    } catch (AppException e) {
      // Handle the error.
    }
  • // Instantiate the target bucket.
    KiiUser user = KiiUser.getCurrentUser();
    KiiBucket bucket = user.bucket("_target_bucket_");
    
    // Unsubscribe from the bucket.
    user.pushSubscription().unsubscribeBucket(bucket, new KiiPushCallBack() {
      @Override
      public void onUnSubscribeBucketCompleted(int taskId, KiiBucket target, Exception exception) {
        if (exception != null) {
          // Handle the error.
          return;
        }
      }
    });

より詳しい説明は Javadoc をご確認ください。