0

In my app I see the following message:

Can't subscribe, notification token is not updated on the server

When I try to subscribe for tag-based notifications in my server local. I don't know how to refresh the token in my local server. I'm using MobileFirst v7.0

03-31 16:58:25.308 18445-18445/com.test.eluniversal.tagsuniversal D/OpenGLRenderer﹕ Enabling debug mode 0 03-31 16:58:25.318 18445-18467/com.test.eluniversal.tagsuniversal D/WLClient﹕ WLClient$ActivityListener.onActivitySaveInstanceState in WLClient.java:1428 :: on activity save instance state com.test.eluniversal.tagsuniversal.ActivityPrincipal

03-31 16:58:25.318 18445-18467/com.test.eluniversal.tagsuniversal D/WLClient﹕ WLClient$ActivityListener.onActivityStopped in WLClient.java:1440 :: on activity stopped com.test.eluniversal.tagsuniversal.ActivityPrincipal

03-31 16:58:27.870 18445-18467/com.test.eluniversal.tagsuniversal D/WLClient﹕ WLClient$ActivityListener.onActivityStarted in WLClient.java:1434 :: on activity started com.test.eluniversal.tagsuniversal.ActivityPrincipal

03-31 16:58:27.900 18445-18467/com.test.eluniversal.tagsuniversal D/WLClient﹕ WLClient$ActivityListener.onActivityResumed in WLClient.java:1423 :: on activity resumed com.test.eluniversal.tagsuniversal.ActivityPrincipal . activity count = 1

03-31 16:58:29.872 18445-18467/com.test.eluniversal.tagsuniversal D/wl.request﹕ WLRequestSender.run in WLRequestSender.java:40 :: Sending request http://172.16.134.52:10080/TagsUniversal/apps/services/api/TagsUniversalApp/Androidnative/init

03-31 16:58:30.043 18445-18467/com.test.eluniversal.tagsuniversal D/com.worklight.wlclient.api.WLPush﹕ WLPush.updateToken in WLPush.java:521 :: Registering at the GCM server.

03-31 16:58:30.043 18445-18467/com.test.eluniversal.tagsuniversal D/GCMHelperUtil﹕ GCMHelperUtil.register in GCMHelperUtil.java:34 :: Registering with GCM server with senderId: 427411077190

03-31 16:58:30.053 18445-18467/com.test.eluniversal.tagsuniversal D/com.worklight.wlclient.api.WLPush﹕ WLPush.clearSubscribedEventSources in WLPush.java:596 :: Clearing notification subscriptions.

03-31 16:58:30.053 18445-18467/com.test.eluniversal.tagsuniversal D/com.worklight.wlclient.api.WLPush﹕ WLPush.clearSubscribedTags in WLPush.java:607 :: Clearing tag notification subscriptions.

03-31 16:58:30.053 18445-18467/com.test.eluniversal.tagsuniversal D/com.worklight.wlclient.api.WLPush﹕ WLPush.updateSubscribedTags in WLPush.java:635 :: Updating tag notification subscriptions.

03-31 16:58:30.063 18445-18546/com.test.eluniversal.tagsuniversal D/Connected﹕ Connected successfully

03-31 16:58:33.065 18445-18467/com.test.eluniversal.tagsuniversal D/WLClient﹕ WLClient.createInstance in WLClient.java:213 :: WLClient has already been created.

03-31 16:58:33.075 18445-18445/com.test.eluniversal.tagsuniversal W/GooglePlayServicesUtil﹕ Google Play services out of date. Requires 7095000 but found 4324038

03-31 16:58:33.075 18445-18467/com.test.eluniversal.tagsuniversal D/GCMClientFactory﹕ GCMClientFactory.useGooglePlayServices in GCMClientFactory.java:38 :: Failed to use Google Play Services becuase the return code is 2

03-31 16:58:33.075 18445-18467/com.test.eluniversal.tagsuniversal D/GCMClientFactory﹕ GCMClientFactory.getInstance in GCMClientFactory.java:28 :: Using GCMHelperClient

03-31 16:58:33.085 18445-18467/com.test.eluniversal.tagsuniversal W/GCMHelperClient﹕ GCMHelperClient.unregisterReceivers in GCMHelperClient.java:95 :: unregister:Receiver not registered: null

03-31 16:58:33.085 18445-18467/com.test.eluniversal.tagsuniversal W/GCMHelperClient﹕ GCMHelperClient.unregisterReceivers in GCMHelperClient.java:101 :: unregister:Receiver not registered: null

03-31 16:58:33.085 18445-18467/com.test.eluniversal.tagsuniversal W/com.worklight.wlclient.api.WLPush﹕ WLPush.unregisterReceivers in WLPush.java:792 :: unregisterReceivers:Receiver not registered: com.worklight.wlclient.api.WLPush$3@42e89a88

03-31 16:58:33.096 18445-18467/com.test.eluniversal.tagsuniversal E/com.worklight.wlclient.api.WLPush﹕ WLPush.isAbleToSubscribe in WLPush.java:414 :: Can't subscribe, notification token is not updated on the server

03-31 16:58:33.096 18445-18467/com.test.eluniversal.tagsuniversal D/wl.request﹕ WLRequestSender.run in WLRequestSender.java:40 :: Sending request http://172.16.134.52:10080/TagsUniversal/apps/services/api/TagsUniversalApp/Androidnative/init

03-31 16:58:40.383 18445-18467/com.test.eluniversal.tagsuniversal D/com.worklight.wlclient.api.WLPush﹕ WLPush.updateToken in WLPush.java:521 :: Registering at the GCM server.

03-31 16:58:40.393 18445-18467/com.test.eluniversal.tagsuniversal D/GCMHelperUtil﹕ GCMHelperUtil.register in GCMHelperUtil.java:34 :: Registering with GCM server with senderId: 427411077190

03-31 16:58:40.423 18445-18467/com.test.eluniversal.tagsuniversal D/com.worklight.wlclient.api.WLPush﹕ WLPush.clearSubscribedEventSources in WLPush.java:596 :: Clearing notification subscriptions.

03-31 16:58:40.423 18445-18467/com.test.eluniversal.tagsuniversal D/com.worklight.wlclient.api.WLPush﹕ WLPush.clearSubscribedTags in WLPush.java:607 :: Clearing tag notification subscriptions.

03-31 16:58:40.423 18445-18467/com.test.eluniversal.tagsuniversal D/com.worklight.wlclient.api.WLPush﹕ WLPush.updateSubscribedTags in WLPush.java:635 :: Updating tag notification subscriptions.

03-31 16:58:40.423 18445-18572/com.test.eluniversal.tagsuniversal D/Subscribed﹕ Subscribed successfully to push notifications

Idan Adar
  • 44,156
  • 13
  • 50
  • 89

2 Answers2

0

From your the logcat you included it looks like the installed version of Google Play Services is out of date.

03-31 16:58:33.075 18445-18467/com.test.eluniversal.tagsuniversal D/GCMClientFactory﹕ GCMClientFactory.useGooglePlayServices in GCMClientFactory.java:38 :: Failed to use Google Play Services becuase the return code is 2

Return code 2 is the value of the constant ConnectionResult.SERVICE_VERSION_UPDATE_REQUIRED

http://developer.android.com/reference/com/google/android/gms/common/ConnectionResult.html#SERVICE_VERSION_UPDATE_REQUIRED

Update Google Play services from your Android SDK Manager and rebuild your app.

UPDATE:

By your feedback it looks like the Google Play Services apk is outdated on the device you are running your app on.

Updated your main Activity onResume code so it looks like this:

@Override
protected void onResume() {
    super.onResume();

    int code = GooglePlayServicesUtil.isGooglePlayServicesAvailable(this);

    if(code == ConnectionResult.SERVICE_MISSING || code == ConnectionResult.SERVICE_VERSION_UPDATE_REQUIRED || code == ConnectionResult.SERVICE_DISABLED) {
        Dialog dialog = GooglePlayServicesUtil.getErrorDialog(code, this, 1);
        dialog.show();
    }

}

This is suggested by in Android's documentation https://developer.android.com/google/play-services/setup.html#ensure

Yoel Nunez
  • 2,108
  • 1
  • 13
  • 19
  • My Google Play Services it's updated to revision 23, I am using Android Studio and Maven dependency for Google Play Services 7.0, the SDK Manager not show update for Google Play Services – Jaive Torres Pineda Apr 01 '15 at 00:25
  • Thanks, don't explain correctly, but not updated page and for reason don't see to answer, Thank you very much and found my error in the device not updated the applications, thank you very much – Jaive Torres Pineda Apr 01 '15 at 01:44
  • @JaiveTorresPineda if one of the answers helped you with your question, mark your question as answered. – Yoel Nunez Apr 01 '15 at 03:09
  • Mark Yoel's answer. :) – Idan Adar Apr 01 '15 at 03:29
-1

send to log the android studio logcat:

and other log the intent subscriber other tag in same app:

    03-31 16:58:25.308  18445-18445/com.test.eluniversal.tagsuniversal D/OpenGLRenderer﹕ Enabling debug mode 0
03-31 16:58:25.318  18445-18467/com.test.eluniversal.tagsuniversal D/WLClient﹕ WLClient$ActivityListener.onActivitySaveInstanceState in WLClient.java:1428 :: on activity save instance state com.test.eluniversal.tagsuniversal.ActivityPrincipal
03-31 16:58:25.318  18445-18467/com.test.eluniversal.tagsuniversal D/WLClient﹕ WLClient$ActivityListener.onActivityStopped in WLClient.java:1440 :: on activity stopped com.test.eluniversal.tagsuniversal.ActivityPrincipal
03-31 16:58:27.870  18445-18467/com.test.eluniversal.tagsuniversal D/WLClient﹕ WLClient$ActivityListener.onActivityStarted in WLClient.java:1434 :: on activity started com.test.eluniversal.tagsuniversal.ActivityPrincipal
03-31 16:58:27.900  18445-18467/com.test.eluniversal.tagsuniversal D/WLClient﹕ WLClient$ActivityListener.onActivityResumed in WLClient.java:1423 :: on activity resumed com.test.eluniversal.tagsuniversal.ActivityPrincipal . activity count = 1
03-31 16:58:29.872  18445-18467/com.test.eluniversal.tagsuniversal D/wl.request﹕ WLRequestSender.run in WLRequestSender.java:40 :: Sending request http://172.16.134.52:10080/TagsUniversal/apps/services/api/TagsUniversalApp/Androidnative/init
03-31 16:58:30.043  18445-18467/com.test.eluniversal.tagsuniversal D/com.worklight.wlclient.api.WLPush﹕ WLPush.updateToken in WLPush.java:521 :: Registering at the GCM server.
03-31 16:58:30.043  18445-18467/com.test.eluniversal.tagsuniversal D/GCMHelperUtil﹕ GCMHelperUtil.register in GCMHelperUtil.java:34 :: Registering with GCM server with senderId: 427411077190
03-31 16:58:30.053  18445-18467/com.test.eluniversal.tagsuniversal D/com.worklight.wlclient.api.WLPush﹕ WLPush.clearSubscribedEventSources in WLPush.java:596 :: Clearing notification subscriptions.
03-31 16:58:30.053  18445-18467/com.test.eluniversal.tagsuniversal D/com.worklight.wlclient.api.WLPush﹕ WLPush.clearSubscribedTags in WLPush.java:607 :: Clearing tag notification subscriptions.
03-31 16:58:30.053  18445-18467/com.test.eluniversal.tagsuniversal D/com.worklight.wlclient.api.WLPush﹕ WLPush.updateSubscribedTags in WLPush.java:635 :: Updating tag notification subscriptions.
03-31 16:58:30.063  18445-18546/com.test.eluniversal.tagsuniversal D/Connected﹕ Connected successfully
03-31 16:58:33.065  18445-18467/com.test.eluniversal.tagsuniversal D/WLClient﹕ WLClient.createInstance in WLClient.java:213 :: WLClient has already been created.
03-31 16:58:33.075  18445-18445/com.test.eluniversal.tagsuniversal W/GooglePlayServicesUtil﹕ Google Play services out of date.  Requires 7095000 but found 4324038
03-31 16:58:33.075  18445-18467/com.test.eluniversal.tagsuniversal D/GCMClientFactory﹕ GCMClientFactory.useGooglePlayServices in GCMClientFactory.java:38 :: Failed to use Google Play Services becuase the return code is 2
03-31 16:58:33.075  18445-18467/com.test.eluniversal.tagsuniversal D/GCMClientFactory﹕ GCMClientFactory.getInstance in GCMClientFactory.java:28 :: Using GCMHelperClient
03-31 16:58:33.085  18445-18467/com.test.eluniversal.tagsuniversal W/GCMHelperClient﹕ GCMHelperClient.unregisterReceivers in GCMHelperClient.java:95 :: unregister:Receiver not registered: null
03-31 16:58:33.085  18445-18467/com.test.eluniversal.tagsuniversal W/GCMHelperClient﹕ GCMHelperClient.unregisterReceivers in GCMHelperClient.java:101 :: unregister:Receiver not registered: null
03-31 16:58:33.085  18445-18467/com.test.eluniversal.tagsuniversal W/com.worklight.wlclient.api.WLPush﹕ WLPush.unregisterReceivers in WLPush.java:792 :: unregisterReceivers:Receiver not registered: com.worklight.wlclient.api.WLPush$3@42e89a88
03-31 16:58:33.096  18445-18467/com.test.eluniversal.tagsuniversal E/com.worklight.wlclient.api.WLPush﹕ WLPush.isAbleToSubscribe in WLPush.java:414 :: Can't subscribe, notification token is not updated on the server
03-31 16:58:33.096  18445-18467/com.test.eluniversal.tagsuniversal D/wl.request﹕ WLRequestSender.run in WLRequestSender.java:40 :: Sending request http://172.16.134.52:10080/TagsUniversal/apps/services/api/TagsUniversalApp/Androidnative/init
03-31 16:58:40.383  18445-18467/com.test.eluniversal.tagsuniversal D/com.worklight.wlclient.api.WLPush﹕ WLPush.updateToken in WLPush.java:521 :: Registering at the GCM server.
03-31 16:58:40.393  18445-18467/com.test.eluniversal.tagsuniversal D/GCMHelperUtil﹕ GCMHelperUtil.register in GCMHelperUtil.java:34 :: Registering with GCM server with senderId: 427411077190
03-31 16:58:40.423  18445-18467/com.test.eluniversal.tagsuniversal D/com.worklight.wlclient.api.WLPush﹕ WLPush.clearSubscribedEventSources in WLPush.java:596 :: Clearing notification subscriptions.
03-31 16:58:40.423  18445-18467/com.test.eluniversal.tagsuniversal D/com.worklight.wlclient.api.WLPush﹕ WLPush.clearSubscribedTags in WLPush.java:607 :: Clearing tag notification subscriptions.
03-31 16:58:40.423  18445-18467/com.test.eluniversal.tagsuniversal D/com.worklight.wlclient.api.WLPush﹕ WLPush.updateSubscribedTags in WLPush.java:635 :: Updating tag notification subscriptions.
03-31 16:58:40.423  18445-18572/com.test.eluniversal.tagsuniversal D/Subscribed﹕ Subscribed successfully to push notifications
Broak
  • 4,161
  • 4
  • 31
  • 54