How the Mobile App Messaging SDK Works
This diagram describes how the Mobile App Messaging SDK works with Marketing Cloud Next.

-
When a mobile app opens and successfully initializes the SDK, the SDK communicates with the Push Notification Service (PNS) to obtain a device token.
A PNS is a service such as Apple Push Notification service (APNs) or Firebase Cloud Messaging (FCM) that manages push notifications for a device.
-
The PNS returns a unique device token to the SDK, but only if the device has opted in to receive push notifications.
-
After it receives the device token, the SDK registers the device with Marketing Cloud Next and submits critical information such as the device token, device ID, push opt-in status, party identifier, and any relevant attributes or tags. This registration process occurs asynchronously.
-
Marketing Cloud Next processes the registration to determine whether it can send push notifications to the device. This process includes checking whether the device is opted in our out of receiving push notifications. If the user isn’t registered in Marketing Cloud Next, it creates an Individual record. If the user is an existing Individual, Marketing Cloud Next updates the existing Individual record with the latest information, such as the user’s most recent app open time.
-
After Marketing Cloud Next processes the registration, a marketer sends push notifications using the device token received from the SDK.
-
The PNS validates the device token and attempts to deliver the message to the device.
a. If the device token is valid, the PNS delivers the message to the device.
b. If the device token is invalid or if the device is opted out, the PNS notifies Marketing Cloud Next to opt out the user’s device. The user also doesn’t receive the push notification. Opt-outs also occur if the device token is malformed or if the auth key is incorrect.
-
After the user opens and interacts with the push notification, the SDK records the event and sends analytics data to Marketing Cloud Next. The SDK transmits analytics data after the application moves into the background or comes back into the foreground. If a user force-closes the app, the SDK stores the analytics data and sends it to Marketing Cloud Next the next time the user opens the app.