1

I have created MarketingCloudSDK for IOS bindings in xamarin. I think that's working fine sdkstate looks good and deviceToken getting fine as well but still I am not able to see that contact in MobilePush.

    var config = new MarketingCloudSDKConfigBuilder()
        .Sfmc_setApplicationId(_applicationId)
        .Sfmc_setAccessToken(_accessToken)
        .Sfmc_setMid(_mID)
        .Sfmc_setMarketingCloudServerUrl(_mcUrl)
        .Sfmc_setAnalyticsEnabled(true)
        .Sfmc_setPiAnalyticsEnabled(true)
        .Sfmc_build();

        var isSuccessful = MarketingCloudSDK.SharedInstance().Sfmc_configureWithDictionary(config, out NSError error);

        if (isSuccessful)
        {
            MarketingCloudSDK.SharedInstance().Sfmc_setDebugLoggingEnabled(true);
            MarketingCloudSDK.SharedInstance().Sfmc_setContactKey("ABC123654");
            string contactKey = MarketingCloudSDK.SharedInstance().Sfmc_contactKey;
            string sdkstate = MarketingCloudSDK.SharedInstance().Sfmc_getSDKState;
            await base.InnerOpenChannel(ct);
        }

Here is my sdkState

"{\n  \"MarketingCloud Connection Details\" : 
{\n    \"Active AccessToken(Masked)\" : \"v*******************blpr\",
\n    \"Active AppId\" : \"Correct-value \"\n  },\n  \"Analytics Details\" : 
{\n    \"useLegacyPiIdentifier\" : false,\n    \"PiIdentifier\" : \"\",
\n    \"PIAnalyticsEnabled\" : true,\n    \"ETAnalyticsEnabled\" : true\n  },\n  \"Push Details\" : {\n    \"Developer has Push Enabled\" : \"Yes\",\n    \"Device Token\" : \"e300bb597d46f76697375566332211001jgrc476a2504fb22cf237e3c25268baa5b\",\n    \"User has Push Enabled\" : \"Yes\"\n  },\n  \"MarketingCloud SDK Features\" : {\n    \"Enabled by Configuration\" : \"ETAnalytics, PIAnalytics\"\n  },\n  \"Privacy Settings\" : {\n    \"Privacy Mode\" : \"SFMCPrivacyModeNotBlocked\"\n  },\n  \"Device Specific Details\" : {\n    \"OS Version\" : \"12.2\",\n    \"Hardware Description\" : \"iPhone10,5\",\n    \"Device Reported Timezone\" : \"-14400\",\n    \"Device Locale\" : \"en_CA\",\n    \"DeviceId\" : \"TFD554678-198A-42B2-ACC0-54654771\",\n    \"Daylight Savings Time Active\" : true,\n    \"Platform Name\" : \"iOS\"\n  }\n}"

I am not able to understand what went wrong FYI:this sdkstate is after

public override void RegisteredForRemoteNotifications(NSData deviceToken)
    {
        MarketingCloudSDK.SharedInstance().Sfmc_setDeviceToken(deviceToken);
        string sdkstate1 = MarketingCloudSDK.SharedInstance().Sfmc_getSDKState;
    }
  • 1
    is it possible that your access token or appId values have uppercase characters? We have a very recently identified issue in those cases, and using the ConfigBuilder method of SDK configuration, which will cause the 401 error you are seeing. Workaround: Use the JSON configuration technique. We will be releasing a fix for this soon, in our next SDK release. – Brian M. Criscuolo Apr 17 at 16:24
  • @BrianM.Criscuolo this should be the answer rather than a comment. – Bill Mote Apr 18 at 14:43
  • That worked thanks. My Xamarin bindings didn't add that json but I include in project manually and it seems working. – CineTest Apr 18 at 16:50
1

Moved to answer:

Is it possible that your access token or appId values have uppercase characters? We have a very recently identified issue in those cases, and using the ConfigBuilder method of SDK configuration, which will cause the 401 error you are seeing. Workaround: Use the JSON configuration technique. We will be releasing a fix for this soon, in our next SDK release.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.