{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["admonition"]},"redocly_category":"Activation","product_name":"Engage Studio","type":"markdown"},"seo":{"title":"Mobile Push Device Token Registration","description":"Register APNs and FCM device tokens with the preview Engage Mobile SDK while keeping notification receipt, display, and tap handling in your app.","siteUrl":"https://docs.treasure.ai","image":"/assets/treasure-ai-social-preview.e6fefb35676f6da91c2d1bc783bd39e618e7af2b1ad3aa52a96ae69d72e700fe.b1bff462.png","lang":"en-US","jsonLd":{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://www.treasure.ai/","name":"Treasure AI","url":"https://www.treasure.ai/","logo":"https://www.treasure.ai/hubfs/assets/images/logos/primary-logo.svg"},{"@type":"WebSite","@id":"https://docs.treasure.ai/#website","name":"Treasure AI Documentation","url":"https://docs.treasure.ai/","inLanguage":["en","ja"],"publisher":{"@id":"https://www.treasure.ai/"}}]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"mobile-push-device-token-registration","__idx":0},"children":["Mobile Push Device Token Registration"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The preview Engage Mobile SDK provides a common API for registering APNs and FCM device tokens. The app obtains the token from the platform, then passes it to the SDK so Engage Studio can target the installation."]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"warning","name":"Preview"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The SDK token-registration API is part of the preview Mobile SDK integration. Event names, field names, package distribution, and Push handling APIs may change before general availability."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"what-the-sdk-handles","__idx":1},"children":["What the SDK Handles"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The SDK handles the event that registers a token with the configured Records endpoint. The app remains responsible for the Push lifecycle."]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Responsibility"},"children":["Responsibility"]},{"$$mdtype":"Tag","name":"th","attributes":{"align":"right","data-label":"App"},"children":["App"]},{"$$mdtype":"Tag","name":"th","attributes":{"align":"right","data-label":"SDK"},"children":["SDK"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Request notification permission"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"right"},"children":["✓"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"right"},"children":[]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Obtain an APNs or FCM token"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"right"},"children":["✓"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"right"},"children":[]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Register the token with Treasure AI"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"right"},"children":["Calls the SDK"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"right"},"children":["✓"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Receive a Push notification"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"right"},"children":["✓"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"right"},"children":[]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Display a system notification"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"right"},"children":["✓"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"right"},"children":[]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Handle a notification tap"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"right"},"children":["✓"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"right"},"children":[]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Display a URL as Hosted Pages after a tap"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"right"},"children":["Calls ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["openUrl"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"right"},"children":["Displays the WebView"]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The SDK does not currently own the APNs or FCM receiver. Do not describe token registration as complete Push notification delivery."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"ios-token-registration","__idx":2},"children":["iOS Token Registration"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Obtain the APNs token in the app and pass it to the SDK with the provider and destination table."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"func application(\n    _ application: UIApplication,\n    didRegisterForRemoteNotificationsWithDeviceToken token: Data\n) {\n    TreasureData.sharedInstance().registerDeviceToken(\n        token,\n        provider: .apns,\n        table: \"device_tokens\"\n    )\n}\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The app must request notification permission and register for remote notifications separately."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"android-token-registration","__idx":3},"children":["Android Token Registration"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Obtain the FCM token from Firebase and pass it to the SDK with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["TDPushProvider.FCM"]},"."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"kotlin","header":{"controls":{"copy":{}}},"source":"override fun onNewToken(token: String) {\n    TreasureData.sharedInstance().registerDeviceToken(\n        token,\n        TDPushProvider.FCM,\n        \"device_tokens\"\n    )\n}\n","lang":"kotlin"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Call the method again when FCM refreshes the token. The app remains responsible for Firebase setup and notification permission handling."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"preview-record-schema","__idx":4},"children":["Preview Record Schema"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The preview SDK registers a token as an event and flushes the event immediately. The Android M2 implementation uses the following fields:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"td_device_token\": \"<TOKEN>\",\n  \"td_push_provider\": \"fcm\"\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The provider value is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["apns"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["fcm"]},". The record has no separate ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["event"]},"-name field. Optional parameters may be added by the app through the SDK API."]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info","name":"Preview schema versus sample Push events"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The existing Push Events Table describes a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["token_register"]}," event with an ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["fcm_token"]}," field. The preview SDK record uses ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["td_device_token"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["td_push_provider"]}," and adds no ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["event"]},"-name field. Treat these as separate integration contracts until the standard Mobile Push event schema is finalized."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"open-hosted-pages-from-a-push","__idx":5},"children":["Open Hosted Pages from a Push"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["When the app receives a Push payload containing a URL, the app can pass the URL to the SDK:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"TreasureData.sharedInstance().openUrl(\n    URL(string: \"https://example.com/coupon\")!,\n    context: [\"coupon_id\": \"abc123\"]\n)\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"kotlin","header":{"controls":{"copy":{}}},"source":"TreasureData.sharedInstance().openUrl(\n    \"https://example.com/coupon\",\n    mapOf(\"coupon_id\" to \"abc123\")\n)\n","lang":"kotlin"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This direct URL path does not have a campaign offer identity. It is displayed as a Hosted Pages WebView but does not create campaign ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["impression"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["click"]},", or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["dismiss"]}," events."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"security-and-privacy","__idx":6},"children":["Security and Privacy"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Use a write-only API key for event ingestion."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Do not log APNs or FCM tokens in production logs."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Do not put API keys or Personalization tokens in Push payloads."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Validate URLs before opening them as Hosted Pages."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Validate Deep Links and app-owned routes before navigation."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Apply your consent and privacy policy before registering a token or sending associated event data."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"related-documentation","__idx":7},"children":["Related Documentation"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/marketing-cloud/engage-studio/channels/mobile-push"},"children":["Mobile Push Campaign"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/marketing-cloud/engage-studio/channels/mobile-inapp/developer-guide-android"},"children":["Android SDK Integration for Mobile In-App Messaging"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/marketing-cloud/engage-studio/channels/mobile-inapp/developer-guide-ios"},"children":["iOS SDK Integration for Mobile In-App Messaging"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/marketing-cloud/engage-studio/channels/mobile-push/push-events-table"},"children":["Push Events Table"]}]}]}]},"headings":[{"value":"Mobile Push Device Token Registration","id":"mobile-push-device-token-registration","depth":1},{"value":"What the SDK Handles","id":"what-the-sdk-handles","depth":2},{"value":"iOS Token Registration","id":"ios-token-registration","depth":2},{"value":"Android Token Registration","id":"android-token-registration","depth":2},{"value":"Preview Record Schema","id":"preview-record-schema","depth":2},{"value":"Open Hosted Pages from a Push","id":"open-hosted-pages-from-a-push","depth":2},{"value":"Security and Privacy","id":"security-and-privacy","depth":2},{"value":"Related Documentation","id":"related-documentation","depth":2}],"frontmatter":{"seo":{"title":"Mobile Push Device Token Registration","description":"Register APNs and FCM device tokens with the preview Engage Mobile SDK while keeping notification receipt, display, and tap handling in your app."}},"lastModified":"2026-09-28T04:12:49.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/products/marketing-cloud/engage-studio/channels/mobile-push/device-token-registration","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}