4

I am using Quickblox SDK Ver 2.2.5 and I am trying to unsubscribe from Quickblox Push Notification's Subscriptions.

Previously before it was working fine & now instantly from past few weeks it stopped working.

Here following is my code:-

QBMessages.getSubscriptions(new QBEntityCallbackImpl<ArrayList<QBSubscription>>() {

                            @Override
                            public void onSuccess(
                                    ArrayList<QBSubscription> subscriptions,
                                    Bundle args) {

                                String deviceId = ((TelephonyManager) c
                                        .getSystemService(Context.TELEPHONY_SERVICE))
                                        .getDeviceId();

                                for (QBSubscription subscription : subscriptions) {
                                    if (subscription.getDevice().getId()
                                            .equals(deviceId)) {

                                        QBMessages.deleteSubscription(
                                                subscription.getId(),
                                                new QBEntityCallbackImpl<Void>() {
                                                    @Override
                                                    public void onSuccess() {
                                                        Log.e("LOGOUT",
                                                                "GCM subscription removed from QB - successfully");

                                                        getEverythingDone();
                                                    }

                                                    @Override
                                                    public void onError(
                                                            List<String> errors) {

                                                        Log.e("LOGOUT",
                                                                "Error:"
                                                                        + errors);

                                                    }
                                                });
                                        break;
                                    }
                                }

                                /** Added By Harpreet **/
                                unregisterForC2DM(c);
                                preferences.setdeviceToken("");

                            }

                            @Override
                            public void onError(List<String> errors) {

                                getEverythingDone();

                                Log.e("Subscriptions Errors", "Error:" + errors);

                            }
                        });

Error which I receive is:-

E/Subscriptions Errors(28923): Error:[Entity you are looking for was not found.]

I am not able to figure it out, as internet is already working and I am also logged-in to the chat because the process to final logout is in method getEverythingDone() which is used in my above described code.

Any idea, where I am wrong or is it again Quickblox guys (Have they messed up with their Api's again)?

Harpreet
  • 2,990
  • 3
  • 38
  • 52
  • 1
    Please double-check if the subscription you are trying unsubscribe from is present in your admin panel: Home - App name - Push notifications - Subscriptions? – Sabina Bashuk Oct 06 '15 at 08:34
  • @SabinaBashuk: Thanks for reply. Yes, I had checked that the current device is present in the Subscription's list at Push Notifications in Admin Panel page of Quickblox. – Harpreet Oct 06 '15 at 09:10
  • @SabinaBashuk : I am willing to remove it from that particular list using my code and cross check it again. – Harpreet Oct 06 '15 at 09:12
  • I am getting this on each device I try it on. Did you find a solution? Thank you! – dazza5000 Sep 06 '16 at 15:11
  • I had mail to QuickBlox with all my findings, my code, this question link etc but they never revert back. It's now on QuickBlox officials if they ever want to fix this issue. – Harpreet Sep 08 '16 at 08:20

0 Answers0