I found that my contact ID in SFMC had shown multiple device ID in Mobile Push Demographics data. In actual, I only have 2 active device, but why in SFMC shown 4 device ID, and 3 of them are still receiving campaigns. How can we make sure, we only send to the last active device that those contacts have? Please advise.
As mentioned in other answers, the
DeviceID is generated by the SDK upon its first initialization. It does not change and will be transmitted as part of your device registration. Clearing application data, wiping phone data, doing a factory reset, upgrading your phone to a new device (the SDK does not backup data for future restores after data wipes or device upgrades), or uninstalling/re-installing are the only way for you to end up with multiple DeviceIDs for a given
Also mentioned in other answers, the
Feedback Service will notify the Marketing Cloud servers that a device has become invalid/defunct at which time it will be opted-out from receiving future push messages, but the device does remain part of your existing contact. Also, neither Apple nor Google provide strong definitions as to how/when a device will be flagged that it should be removed. There is a window in which sends will be attempted to the old/dead device. This is unavoidable without some other sort of advanced inclusion/exclusion audience list.
In general, when the device is inactive, sending a Push message will result in an error code which Marketing Cloud uses to set status to inactive (from memory it is something like Service Response as the reason/source of the Opt Out). Based on that it will then ignore these devices in future. Likewise, if there are devices which should not receive messages then you will need to opt that device out using the Mobile SDK.
If the Device is inactive (Google/Apple will restrict) or opted out (Marketing Cloud will restrict) you cannot receive messages on the device. It is unclear what you mean by only 2 active, but 3 receive campaigns - maybe provide more details here if this answer does not clarify.
The only sure way to target the last active device is to use an SQL query on the data view PushAddress (Attributes in _PushAddress and _PushTag Data Views) to extract only the last updated device id by contactid but this is technically not supported so I would advise against.
You could alternatively look for devices which have been active in the last x days using mobile lists. This of course would potentially still give duplicates, but it would mean that devices which are stale (haven't reported for an extended period) would be excluded.
The Device_ID is a GUID value assigned via the SDK. It will be removed from Contact when the related application is removed from the device... A new Device_ID will be assigned when the related application is installed again on the device.
You can have multiple active devices on a specific Contact.
You could use filtered mobile list based on Contact data model:
"MobilePush data" => "MobilePush Demographics" => Choose available system/custom fields
You could create a custom field in "MobilePush Demographics" table and populate one with value that would help you determine which/when the last change occurred and combine this info later with other system fields when creating "Filtered Mobile Push" lists.
I found the following regarding push apps on iPhone:
Troubleshooting Push Notifications https://developer.apple.com/library/archive/technotes/tn2265/_index.html
Issues with Using the Feedback Service
If you remove your app from your device or computer and then send a push notification to it, you would expect to have the device token rejected, and the invalidated device token should appear on the feedback service. However, if this was the last push-enabled app on the device or computer, it will not show up in the feedback service. This is because deleting the last app tears down the persistent connection to the push service before the notice of the deletion can be sent.
You can work around this by leaving at least one push-enabled app on the device or computer in order to keep the persistent connection up. To keep the persistent connection to the production environment up, just install any free push-enabled app from the App Store and you should then be able to delete your app and see it appear in the feedback service.
Recall that each push environment has its own persistent connection. So to keep the persistent connection to the sandbox environment up, install another development push-enabled app.
-> The customer has only 1 app installed on the iPhone, it created DeviceId#1. When you delete the app, because of the statement above, the DeviceId won't get deleted and remains Opted-In. If you install the same app again, it will create DeviceId#2. Customer deleted this app again and DeviceId#2 remains active and opted-in. I asked the customer to install the app again but this time disable push notifications and then open the app. It resulted to DeviceId#3 to be opted out but DeviceId#1 and DeviceId#2 still opted in. Customer is now concerned about usage of SuperMessages as push notification is still being sent to DeviceId#1 and DeviceId#2. Question now is how do you delete these 2 devices?