{"payload":{"allShortcutsEnabled":false,"fileTree":{"docs/android/messaging-main/push-messaging":{"items":[{"name":"assets","path":"docs/android/messaging-main/push-messaging/assets","contentType":"directory"},{"name":"c-set-up-rich-push-notif-android.md","path":"docs/android/messaging-main/push-messaging/c-set-up-rich-push-notif-android.md","contentType":"file"},{"name":"c-troubleshooting-push-messaging.md","path":"docs/android/messaging-main/push-messaging/c-troubleshooting-push-messaging.md","contentType":"file"},{"name":"push-messaging.md","path":"docs/android/messaging-main/push-messaging/push-messaging.md","contentType":"file"},{"name":"t-mob-impl-push-deeplinking-android-4x.md","path":"docs/android/messaging-main/push-messaging/t-mob-impl-push-deeplinking-android-4x.md","contentType":"file"}],"totalCount":5},"docs/android/messaging-main":{"items":[{"name":"messaging","path":"docs/android/messaging-main/messaging","contentType":"directory"},{"name":"push-messaging","path":"docs/android/messaging-main/push-messaging","contentType":"directory"},{"name":"messaging-main-android.md","path":"docs/android/messaging-main/messaging-main-android.md","contentType":"file"}],"totalCount":3},"docs/android":{"items":[{"name":"acquisition-main","path":"docs/android/acquisition-main","contentType":"directory"},{"name":"analytics-main","path":"docs/android/analytics-main","contentType":"directory"},{"name":"assets","path":"docs/android/assets","contentType":"directory"},{"name":"audience-manager","path":"docs/android/audience-manager","contentType":"directory"},{"name":"c-marketing-cloud","path":"docs/android/c-marketing-cloud","contentType":"directory"},{"name":"c-mob-privacy-gdpr-android","path":"docs/android/c-mob-privacy-gdpr-android","contentType":"directory"},{"name":"configuration","path":"docs/android/configuration","contentType":"directory"},{"name":"getting-started","path":"docs/android/getting-started","contentType":"directory"},{"name":"location","path":"docs/android/location","contentType":"directory"},{"name":"messaging-main","path":"docs/android/messaging-main","contentType":"directory"},{"name":"phonegap","path":"docs/android/phonegap","contentType":"directory"},{"name":"reference","path":"docs/android/reference","contentType":"directory"},{"name":"target-main","path":"docs/android/target-main","contentType":"directory"},{"name":"wearables","path":"docs/android/wearables","contentType":"directory"},{"name":"metrics.md","path":"docs/android/metrics.md","contentType":"file"},{"name":"overview.md","path":"docs/android/overview.md","contentType":"file"},{"name":"rel-notes.md","path":"docs/android/rel-notes.md","contentType":"file"}],"totalCount":17},"docs":{"items":[{"name":"android","path":"docs/android","contentType":"directory"},{"name":"blackberry","path":"docs/blackberry","contentType":"directory"},{"name":"ios","path":"docs/ios","contentType":"directory"},{"name":"unity","path":"docs/unity","contentType":"directory"},{"name":"universal-windows","path":"docs/universal-windows","contentType":"directory"},{"name":"windows-appstore","path":"docs/windows-appstore","contentType":"directory"},{"name":"xamarin","path":"docs/xamarin","contentType":"directory"}],"totalCount":7},"":{"items":[{"name":"docs","path":"docs","contentType":"directory"},{"name":"samples","path":"samples","contentType":"directory"},{"name":"sdks","path":"sdks","contentType":"directory"},{"name":".gitignore","path":".gitignore","contentType":"file"},{"name":".npmignore","path":".npmignore","contentType":"file"},{"name":"LICENSE.md","path":"LICENSE.md","contentType":"file"},{"name":"README.md","path":"README.md","contentType":"file"},{"name":"package.json","path":"package.json","contentType":"file"},{"name":"plugin.xml","path":"plugin.xml","contentType":"file"}],"totalCount":9}},"fileTreeProcessingTime":13.945231000000001,"foldersToFetch":[],"repo":{"id":16493963,"defaultBranch":"master","name":"mobile-services","ownerLogin":"Adobe-Marketing-Cloud","currentUserCanPush":false,"isFork":false,"isEmpty":false,"createdAt":"2014-02-03T21:43:40.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/1440554?v=4","public":true,"private":false,"isOrgOwned":true},"symbolsExpanded":false,"treeExpanded":true,"refInfo":{"name":"master","listCacheKey":"v0:1618423338.265981","canEdit":false,"refType":"branch","currentOid":"bf5c2668ebc79218b2ddf4694ff9952fa52be892"},"path":"docs/android/messaging-main/push-messaging/push-messaging.md","currentUser":null,"blob":{"rawLines":null,"stylingDirectives":null,"colorizedLines":null,"csv":null,"csvError":null,"dependabotInfo":{"showConfigurationBanner":false,"configFilePath":null,"networkDependabotPath":"/Adobe-Marketing-Cloud/mobile-services/network/updates","dismissConfigurationNoticePath":"/settings/dismiss-notice/dependabot_configuration_notice","configurationNoticeDismissed":null},"displayName":"push-messaging.md","displayUrl":"https://github.com/Adobe-Marketing-Cloud/mobile-services/blob/master/docs/android/messaging-main/push-messaging/push-messaging.md?raw=true","headerInfo":{"blobSize":"3.05 KB","deleteTooltip":"You must be signed in to make or propose changes","editTooltip":"You must be signed in to make or propose changes","ghDesktopPath":"https://desktop.github.com","isGitLfs":false,"onBranch":true,"shortPath":"a3026fc","siteNavLoginPath":"/login?return_to=https%3A%2F%2Fgithub.com%2FAdobe-Marketing-Cloud%2Fmobile-services%2Fblob%2Fmaster%2Fdocs%2Fandroid%2Fmessaging-main%2Fpush-messaging%2Fpush-messaging.md%3Flang%3Des-ES","isCSV":false,"isRichtext":true,"toc":[{"level":1,"text":"Push messaging","anchor":"push-messaging","htmlText":"Push messaging"},{"level":2,"text":"Enable push messaging","anchor":"enable-push-messaging","htmlText":"Enable push messaging"}],"lineInfo":{"truncatedLoc":"59","truncatedSloc":"37"},"mode":"file"},"image":false,"isCodeownersFile":null,"isPlain":false,"isValidLegacyIssueTemplate":false,"issueTemplate":null,"discussionTemplate":null,"language":"Markdown","languageID":222,"large":false,"planSupportInfo":{"repoIsFork":null,"repoOwnedByCurrentUser":null,"requestFullPath":"/Adobe-Marketing-Cloud/mobile-services/blob/master/docs/android/messaging-main/push-messaging/push-messaging.md?lang=es-ES","showFreeOrgGatedFeatureMessage":null,"showPlanSupportBanner":null,"upgradeDataAttributes":null,"upgradePath":null},"publishBannersInfo":{"dismissActionNoticePath":"/settings/dismiss-notice/publish_action_from_dockerfile","releasePath":"/Adobe-Marketing-Cloud/mobile-services/releases/new?marketplace=true","showPublishActionBanner":false},"rawBlobUrl":"https://github.com/Adobe-Marketing-Cloud/mobile-services/raw/master/docs/android/messaging-main/push-messaging/push-messaging.md","renderImageOrRaw":false,"richText":"

Push messaging

\n

Adobe Mobile and the Adobe Mobile SDK allow you to send push messages to your users. The SDK also allows you to easily report users who have opened your app after clicking through a push message.

\n

To use push messaging, you must have SDK version 4.6 or later.

\n
\n

Important: Do not manually set the Experience Cloud ID inside your app. This causes the creation of a new unique user that will not receive push messages because of its opt-in status. For example, a user has opted-in to receive push messages logs in to your app. After logging in, if you manually set the ID inside your app, a new unique user is created who has not opted to receive push messages. This new user will not receive your push messages.

\n

Moving your app to a new report suite is not supported. If you migrate to a new report suite, your push configuration can break, and messages might not be sent.

\n
\n

Enable push messaging

\n
\n

Tip: If your app is already set up to use messaging through Firebase Cloud Messaging (FCM), some of the following steps might already be completed.

\n
\n
    \n
  1. \n

    Verify that the ADBMobileConfig.json file contains the required settings for push messaging.

    \n

    The \"marketingCloud\" object must have its \"org\" property configured for push messaging.

    \n
    \"marketingCloud\": { \n  \"org\": <org-id-string> \n }
    \n
  2. \n
  3. \n

    Obtain the registration ID/token by using the Firebase Cloud Messaging (FCM) API.

    \n\n
    String token = FirebaseInstanceId.getInstance().getToken();
    \n
  4. \n
  5. \n

    The registration ID/token must be passed to the SDK by using the Config.setPushIdentifier(final String registrationId) method.

    \n
    Config.setPushIdentifier(token); // token was obtained in step 2
    \n
  6. \n
  7. \n

    Enable reporting by passing your activity in the collectLifecycleData method.

    \n

    Here are the requirements to enable push click-through reporting:

    \n
      \n
    • In your implementation of FireBaseMessageService, the Bundle object that contains the message data, which is passed into the onMessageReceived method with the RemoteMessage object, must be added to the Intent that is used to open the target activity on a click-through. This can be done using the putExtras method. For more information, see putExtras).
    • \n
    \n
    Intent intent = new Intent(this, MainActivity.class);\n   intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n// get the bundle from the RemoteMessage object\n   intent.putExtras(message.toIntent().getExtras());
    \n
      \n
    • \n

      In the target activity of the clickthrough, the activity must be passed into the SDK with the collectLifecycleData call.

      \n

      Remember the following information:

      \n
        \n
      • \n

        Use Config.collectLifecycleData(this) or Config.collectLifecycleData(this, contextData).

        \n
      • \n
      • \n

        Do not use Config.collectLifecycleData().

        \n
      • \n
      \n
    • \n
    \n
  8. \n
\n
","renderedFileInfo":null,"shortPath":null,"symbolsEnabled":true,"tabSize":8,"topBannersInfo":{"overridingGlobalFundingFile":false,"globalPreferredFundingPath":null,"showInvalidCitationWarning":false,"citationHelpUrl":"https://docs.github.com/github/creating-cloning-and-archiving-repositories/creating-a-repository-on-github/about-citation-files","actionsOnboardingTip":null},"truncated":false,"viewable":true,"workflowRedirectUrl":null,"symbols":{"timed_out":false,"not_analyzed":false,"symbols":[{"name":"Push messaging","kind":"section_1","ident_start":2,"ident_end":16,"extent_start":0,"extent_end":3122,"fully_qualified_name":"Push messaging","ident_utf16":{"start":{"line_number":0,"utf16_col":2},"end":{"line_number":0,"utf16_col":16}},"extent_utf16":{"start":{"line_number":0,"utf16_col":0},"end":{"line_number":59,"utf16_col":0}}},{"name":"Enable push messaging","kind":"section_2","ident_start":906,"ident_end":927,"extent_start":903,"extent_end":3122,"fully_qualified_name":"Enable push messaging","ident_utf16":{"start":{"line_number":10,"utf16_col":3},"end":{"line_number":10,"utf16_col":24}},"extent_utf16":{"start":{"line_number":10,"utf16_col":0},"end":{"line_number":59,"utf16_col":0}}}]}},"copilotInfo":null,"copilotAccessAllowed":false,"csrf_tokens":{"/Adobe-Marketing-Cloud/mobile-services/branches":{"post":"iniszxBt8hzw_Pqm0uGx7RN9ryF4Q3fqTmtrLa8nTIyLzvAqSa9-c-yl1tcvkL4gCkBAbpDF4rns3w0WgmAPoA"},"/repos/preferences":{"post":"HWwtRFrvFwl89Pfsw_ug2VUVpxs3_MFSHrRZvbxjj4ENrZqMBR6FAmsMssz-wqD79j2JcW8xwX-KcglHugIcLQ"}}},"title":"mobile-services/docs/android/messaging-main/push-messaging/push-messaging.md at master ยท Adobe-Marketing-Cloud/mobile-services"}