0
votes

I am getting the following error while registering the device for push notification in android,

Failed to register device:"com.ibm.mobilefirstplatform.clientsdk.android.push.api.MFPPushException: Response: Status=400, Text: {\"errorCode\":\"invalid_client\",\"errorMsg\":\"Incorrect JWT format\"}, Error Message: Incorrect JWT format"

  • MFP Server: 8.0.0.00-20170220-1900
  • Cordova : 6.1.1
  • cordova-plugin-mfp : 8.0.201703309
  • cordova-plugin-mfp-push: 8.0.2017012410

Found the similar question but no clear figure :

IBM MobileFirst v8 trying to obtain Token on android cordova app after successful login challenge handler

Cordova Android application getting "invalid_client" from Mobile First 8.0 server

Any solution or suggestion will be appreciable.

3

3 Answers

0
votes

Looks like you are missing the step in the android platform. In Android Studio, add the following activity to the application tag:

<activity android:name="com.ibm.mobilefirstplatform.clientsdk.android.push.api.MFPPushNotificationHandler" android:theme="@android:style/Theme.NoDisplay"/>
0
votes

The most common cause of the issue is failure in time synchronization between client and server. Verify if the server time if offset from the client. Specifically if the server has a time in past.

0
votes

I had the same issue, Rebooting the client device / emulator helped me.

( The the "check server time" was not practical for me, my Server runs as Bluemix service in US )

BTW: I can reproduce this "Incorrect JWT format" in the android emulator: If the android emulator is running overnight and I try the next day, I always get this error (until restarting the emulator)