We are using latest version v6 of https://github.com/salesforce-marketingcloud/MC-Cordova-Plugin.
But when trying to create a contact, we don't see it in push contacts on Marketing Cloud. It looks as if there is a problem on the logs:
2019-04-08 15:11:54.566411+0200 savia[20655:8440114] Push Enabled, setting contact key
2019-04-08 15:11:54.566938+0200 savia[20655:8440114] [foundation] sfmc_setContactKey 00325000011Twx9AAC succeeded
MarketingCloudSDKFoundation+ClientData.m
line: 40
2019-04-08 15:11:54.569749+0200 savia[20655:8440114] success setting contact: 1
2019-04-08 15:11:54.573502+0200 savia[20655:8440114] deviceToken1 = <516e5df0 585ceb71 d37993bc 2ff49101 c560d3f9 eb89053b 7be2838d ea630ff3>
It looks as if there is a success on creation but then we see:
2019-04-08 15:14:05.556259+0200 savia[20655:8441704] [foundation] registration response: <NSHTTPURLResponse: 0x282669960> { URL: https://XXXXXXX.device.marketingcloudapis.com/device/v1/registration } { Status Code: 401, Headers {
"Cache-Control" = (
"no-cache, must-revalidate, max-age=0, no-store, private"
);
Connection = (
"keep-alive"
);
"Content-Length" = (
148
);
"Content-Security-Policy" = (
"upgrade-insecure-requests"
);
"Content-Type" = (
"application/json; charset=utf-8"
);
Date = (
"Mon, 08 Apr 2019 13:14:05 GMT"
);
"Referrer-Policy" = (
"strict-origin-when-cross-origin"
);
"Strict-Transport-Security" = (
"max-age=15552000; preload"
);
Vary = (
Origin
);
"Www-Authenticate" = (
"Bearer realm=\"XXXXXXX.device.marketingcloudapis.com\", error=\"invalid_token\""
);
"x-content-type-options" = (
nosniff
);
"x-frame-options" = (
DENY
);
"x-mashery-error-code" = (
"ERR_403_DEVELOPER_INACTIVE"
);
"x-mashery-message-id" = (
"653afdc4-ccbe-49d0-b954-691cd29ef830"
);
"x-mashery-responder" = (
na
);
"x-xss-protection" = (
"1; mode=block"
);
} }
MarketingCloudSDKFoundation.m
line: 702
The endpoint is changed to XXXXXXX, we've checked all the relevant data such as APP ID, token and endpoint on Marketing Cloud and is correct on our plug-in configuration.
We've also tested native SDKs without any problem, is there any issue with this version of the plugin? Has someone deployed with out any problem this version of the plugin?
UPDATE: We've compared what the SDK does on Android and on iOS. On iOS the token is beeing passed to the authorization header in lowercase, that gives us 401, if we try to replicate with postman and with the correct token, we get 200. On the native iOS learning app we are seeing the native plugin gets configured with a JSON put with Cordova it invokes MarketingCloudSDKConfigBuilder. Both methods are on the native SDK, when using sfmc_setAccessToken method from the builder, the token is correctly read from the config.xml of Cordova, it looks as if the problem is in the builder, probably on sfmc_build invoke.
Any workaround or fix?