I have implemented marketingCloudSdk on Android, like this:

 MarketingCloudSdk.requestSdk(new MarketingCloudSdk.WhenReadyListener() {
        public void ready(MarketingCloudSdk sdk) {
            SharedPreferences.Editor editor = context.getSharedPreferences("lelabs", Context.MODE_PRIVATE).edit();
            editor.putString("deviceId", sdk.getRegistrationManager().getDeviceId());

But i did not any reference to implement this listener on iOS. how should i receive Device Id using Obj-C ?

Obs: I have already implemented SDK on Android and iOS, using this steps: https://github.com/salesforce-marketingcloud/react-native-marketingcloudsdk

Thanks in advance

1 Answer 1


Solved, SDK has a function called getSdkState, with this struct

    sdk_Version?: String
    dST?: Boolean
    location_Enabled?: Boolean
    etAppId?: String
    platform_Version: String
    quietPushEnabled?: Boolean
    locale?: String
    proximity_Enabled?: Boolean
    platform: String
    timeZone?: String
    hwid?: String
    push_Enabled: String
    deviceID: String
    app_Version: String
  • This is not a sollution. Should should get the deviceId when you are registering for pushes on ios. The getSDKState call just uses that but its not a trusted source.
    – Freeubi
    Nov 3, 2021 at 10:37
  • I agree with you, I’ve registered for pushes when some user install my React Native App on App Store. Therefore, when the app start react lifecycle, I already have this deviceId registered, then I get it using native modules. Nov 4, 2021 at 11:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .