Log SDK State Information

To view information about the operational state of the SDK, use the getSDKState() method, as shown in these examples.

1print("SDK State = (SFMCSdk.state())")
1print("SDK State = (MarketingCloudSDK.sharedInstance().sfmc_getSDKState()) ?? "SDK State is nil")")

The SDK outputs a status object, as shown in this example.

1SDK State = {
2    "Analytics Details" =     {
3        ETAnalyticsEnabled = 1;
4        PIAnalyticsEnabled = 1;
5        PiIdentifier = "Not Set";
6        useLegacyPiIdentifier = 1;
7    };
8    "Inbox Details" =     {
9        "Count of All Inbox Messages in DB" = 0;
10        "Count of Read Inbox Messages in DB" = 0;
11        "Count of Unread Inbox Messages in DB" = 0;
12        "Current Inbox Messages" = None;
13    };
14    "Location General Information" =     {
15        "Beacon Monitoring Details" =         {
16            "Count of Proximity Messages in DB" = 0;
17            "Proximity messages in local DB" = None;
18            "Ranging for Beacons with UUID" = "(null)";
19        };
20        "Geo-fence Monitoring Details" =         {
21            "Count of Geo-fence Messages in DB" = 0;
22            "Currently Monitoring Regions" =             {
23            };
24            "Geo-fence Entry messages in DB" = None;
25            "Geo-fence Exit messages in DB" = None;
26            "Regions in DB" = None;
27        };
28        "Location Details" =         {
29            "Last Known Location" =             {
30                latitude = "0.0";
31                longitude = "0.0";
32            };
33            "Location Entitlement in place" = true;
34            "User Location Authorization Status" = 0;
35            "Watching Location" = 0;
36        };
37    };
38    "MarketingCloudSDK General Information" =     {
39        "Application Name" = "SDKExplorer_Dev";
40        "Application Version" = "Version 216.0.0 (Build 2976)";
41        "Device Details" =         {
42            "Daylight Savings Time Active" = 0;
43            "Device Locale" = "en_US";
44            "Device Reported Timezone" = "-18000";
45            DeviceId = "00000000-0000-0000-0000-000000000000";
46            "Hardware Description" = "iPhone9,4";
47            "OS Version" = "12.1.2";
48            "Platform Name" = iOS;
49        };
50        "MarketingCloudSDK Configuration Details" =         {
51            "Current Configuration" =             {
52                accesstoken = 000000000000000000000000;
53                appid = "00000000-0000-0000-0000-000000000000";
54                etanalytics = 1;
55                inbox = 1;
56                location = 1;
57                name = "DEV";
58                pianalytics = 1;
59                uselegacypiidentifier = 1;
60            };
61        };
62        "MarketingCloudSDK Version" = "6.1.1.0";
63        "MarketingCloudSDKLocationDelegate" = "Not set";
64        "MarketingCloudSDKURLHandlingDelegate" = "<SDKExplorer_Dev.AppDelegate: 0x283a72fa0>";
65        "Push Information" =         {
66            "Developer has Push Enabled" = Yes;
67            "Device Token" = 0000000000000000000000000000000000000000000000000000000000000000;
68            "User has Push Enabled" = Yes;
69        };
70        "Registration Details" =         {
71            "Current Registration" =             {
72                "app_version" = "216.0.0";
73                "device_token" = 0000000000000000000000000000000000000000000000000000000000000000;
74                "deviceid" = "00000000-0000-0000-0000-000000000000";
75                "dst" = 0;
76                "etappid" = "00000000-0000-0000-0000-000000000000";
77                "hwid" = "iPhone9,4";
78                "locale" = "en_US";
79                "location_enabled" = 0;
80                "platform" = iOS;
81                "platform_version" = "12.1.2";
82                "proximity_enabled" = 0;
83                "push_enabled" = true;
84                "sdk_version" = "6.1.1.0";
85                "tags" =                 (
86                    ALL,
87                    DEBUG,
88                    iPhone
89                );
90                timezone = "-18000";
91            };
92            "Date of Last Successful Registration" = None;
93            "Last Successfully Sent Registration" = None;
94        };
95    };
96    "Notifications Details" =     {
97        "Last Notification Received" = None;
98    };
99    "Privacy Settings" =     {
100        "Privacy Mode" = SFMCPrivacyModeNotBlocked;
101    };
102    "Retry Alarms Active" =     (
103        MarketingCloudSDKControlChannel,
104        SFMCRegistration
105    );
106}