Our requirement is to send alert (push) + Inbox message to the end users by creating a mobile optimized cloudpage in SFMC. However, when the message is being sent from SFMC, there is no way for our App development team to identify the message in the notification payload and mattch the message from the inbox message dictionary. We were told that there were two ways of doing this:
Use markMessageReadOnInboxNotificationOpen for Android, but it can only support the scenario of landing the user onto the message detail page and mark it as "Read" but later when the sfmc_getAllMessages is executed, the message is coming back to be "Unread". On the other hand, this SDK initialization is not at all available for iOS.
Our App development team was able to provide the notification payload and inbox message dictionary with the list of all messages.
Notification payload:
{
{
"alert" :{
"body": "Test message4"
"title": "Test 4"
},
"badge": 4,
"mutable-content" = 1,
"sound": "default"
},
"_h": "7TJjhewRYOd3EhbugJuGlQAAAAAA",
"_mt": 8,
"_sid": "SFMC",
"_m": "MTg4MToxMTQ6MA", //Is this not Message Id?
"Preview": "Preview message4",
"_x": "https://xxxxxxxxxxxxxxxxxxxxx.pub.s10.sfmc-content.com/1l0431wxtia",
"_r": 7d65e0e0-4e4b-4c20-827c-32862feca3ad" // This is request id.
}
Inbox Message Dictionary:
{
alert = "Test message4";
contentType = 2;
deleted = 0;
endDateUtc = "2021-03-04 11:51:00 +0000";
id = MTg4MToxMTQ6MDo0T0JsZlV0T0lFeUNmREtHTC15anJR;// This is message id not matching
keys = (
{
key = Preview;
value = "Preview message4";
}
);
messageDeleted = 0;
messageHash = 7TJjhewRYOd3EhbugJuGlQAAAAAA;
name = "";
read = 0;
requestId = "7d65e0e0-4e4b-4c20-827c-32862feca3ad"; // THIS IS MATCHING
sendDateUtc = "2021-02-04 10:54:00 +0000";
sound = default;
startDateUtc = "2021-02-04 06:00:00 +0000";
statusDirty = 0;
subject = "Test subject3";
title = "Test 4";
url = "https://xxxxxxxxxxxxxxxxxx.pub.s10.sfmc-content.com/1l0431wxtia";
}
Here are some major questions with respect to second option outlined:
As per Salesforce, the message_id (i.e. Id) in the inbox message dictionary should match with "_m" in the notification payload which is not the case above. What could be the reason for it?
If message id can't be used to recognize and match the message, can we use "request_id" matching with "_r" parameter in the notification payload?
Is there any other way of achieving this? (please note custom keys is not an option here because that could be manually updated value)
Any insights or pointers on this is highly appreciated.