After some long time of investigating I realized that MarketingCloudSDK for iOS always returns startDateUtc
field set to current date.
Here is a snippet from XCode logs:
[inboxmessage] returning messages (
{
alert = test;
contentType = 2;
endDateUtc = "2019-05-15 10:47:00 +0000";
id = [...];
messageDeleted = 0;
messageHash = [...];
name = "";
read = 1;
requestId = "[...]";
sound = default;
startDateUtc = "2019-04-17 10:41:17 +0000";
statusDirty = 0;
subject = "test subject line";
subtitle = test;
title = test;
url = "https://pub.s10.exacttarget.com/[...]/";
},
{
alert = "test concrete";
contentType = 2;
endDateUtc = "2019-05-15 10:25:00 +0000";
id = [...];
messageDeleted = 0;
messageHash = "[...]";
name = "";
read = 1;
requestId = "[...]";
sound = default;
startDateUtc = "2019-04-17 10:41:17 +0000";
statusDirty = 0;
subject = "test concrete";
subtitle = "test concrete";
title = "test concrete";
url = "https://pub.s10.exacttarget.com/[...]/";
},
{
alert = "test concrete delayed";
contentType = 2;
endDateUtc = "2019-05-15 11:30:00 +0000";
id = [...];
messageDeleted = 0;
messageHash = [...];
name = "";
read = 1;
sound = default;
startDateUtc = "2019-04-17 10:41:17 +0000";
statusDirty = 0;
subject = "test concrete delayed";
subtitle = "test concrete delayed";
title = "test concrete delayed";
url = "https://pub.s10.exacttarget.com/[...]/";
},
As you can see, startDateUtc
is set to the same date for all messages, even when their Start Date was set to different time in Salesforce mobile push panel. I suppose, it is not expected behavior and looks like SDK bug. Is there any workaround for that? I would like to display mentioned date on custom table view cell, next to title and media image.
Please note, in order to get all inbox messages, I use:
MarketingCloudSDK.sharedInstance().marketingCloudSDK.sfmc_getAllMessages()