1
votes

I'm using this example code: https://github.com/ibm-bluemix-mobile-services/bms-samples-cordova-hellopush

When I click to register the device I get the following error:

com.ibm.mobilefirstplatform.clientsdk.android.push.api.MFPPushException: Response: Status=401, Response Text: Error 401: Requires a valid clientSecret header

The function that initializes the BMSClient accepts only two arguments BMSClient.initialize(app.route, app.guid);

Where can I pass the clientSecret?

1

1 Answers

0
votes

The Push team fixed a bug with the SDK, and I just ran through the HelloPush sample, and it worked.

The Push team has updating the Cordova Push Plugin to work with bms-core in the backlog at this time. Right now, it still uses ibm-mfp-core.

I did not run into any issues while running the sample, but if you have the Client Secret issue, performing this action should disable it:

PUT request:

Endpoint:

https://mobile.ng.bluemix.net/imfpush/v1/apps/PUSHAPPID/verifyClientSecret

Headers:

content-type: application/json, appSecret: APPSECRET

Body:

{"verifyClientSecret": false}


I just created an application from scratch to confirm that this is working today.

Here are the steps that I took:

Step 1: Cloned the repository & added ibm-mfp-push Cordova plugin

Step 2: Created MobileFirst Starter Boilerplate

Step 3: Got the App Guid from my Push Notifications service instance and the App Route from the URL of my Starter Boilerplate and put it in my index.js. putting in creds

Step 4: Configured my Push Notifications to use FCM by following directions here.

Step 5: I then got this when I did a cordova run:

so I opened up Postman and did the PUT request above.

Step 6: After clicking register again, I started receiving Push Notifications:

whoop whoop