Giter Site home page Giter Site logo

aepsdk-messaging-android's Introduction

Adobe Experience Platform - Messaging extension for Android

CircleCI Code Coverage

About this project

The AEPMessaging extension for Adobe Experience Platform Mobile SDKs powers push notifications, in-app messages, and code-based experiences for your mobile apps. This extension also helps you to collect user push tokens and manages interaction measurement with Adobe Experience Platform services.

Installation

Integrate the AEPMessaging extension into your app by including the following in your app level gradle file's dependencies:

    implementation platform('com.adobe.marketing.mobile:sdk-bom:3.+')
    implementation 'com.adobe.marketing.mobile:core'
    implementation 'com.adobe.marketing.mobile:assurance'
    implementation 'com.adobe.marketing.mobile:edge'
    implementation 'com.adobe.marketing.mobile:edgeidentity'
    implementation 'com.adobe.marketing.mobile:messaging'

If you use the Messaging extension alongside the Campaign Standard extension, Campaign Standard extension version 3.0.0 or newer must be used to resolve a compatibility issue:

implementation 'com.adobe.marketing.mobile:campaign:3.0.0'

Adding Firebase messaging sdk as it is required for using FCM

implementation 'com.google.firebase:firebase-messaging:<latest-version>'

Development

Open the project

To open and run the project, open the code/build.gradle.kts file in Android Studio

Run demo application

  • Follow this Firebase documentation to add the configuration file for your firebase project.
  • Once you opened the project in Android Studio (see above), select the app runnable and your favorite emulator and run the program.

Documentation

Additional documentation for configuration and sdk usage can be found under the Documentation directory.

Tutorial

A comprehensive tutorial for getting started with In-app messaging can be found here.

Related Projects

Project Description
Core extensions The Mobile Core represents the foundation of the Adobe Experience Platform Mobile SDK.
Edge Network extension The Edge Network extension allows you to send data to the Adobe Experience Platform (AEP) from a mobile application.
Identity for Edge Network extension The Identity for Edge Network extension enables identity management from a mobile app when using the Edge Network extension.

Contributing

Contributions are welcomed! Read the CONTRIBUTING for more information.

Licensing

This project is licensed under the Apache V2 License. See LICENSE for more information.

aepsdk-messaging-android's People

Contributors

pravinpk avatar ravjain-adb avatar rymorale avatar sbenedicadb avatar shtomar-adb avatar spoorthipujariadobe avatar swarna04 avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aepsdk-messaging-android's Issues

Improve code coverage to a least 85%

Expected Behaviour

Actual Behaviour

Reproduce Scenario (including but not limited to)

Steps to Reproduce

Platform and Version

Sample Code that illustrates the problem

Logs taken while reproducing problem

MainActivity restarts when clicking on Push notification that contains a uri

Expected Behaviour

Clicking on a push notification with a uri opens the existing MainActivity and passes the uri to it.

Actual Behaviour

Clicking on a push notification with a uri restarts the MainActivity on Android leading to unexpected behaviour in the app.

Steps to Reproduce

  • Incorporate the react native messaging sdk in a react-native app with the package versions mentioned below.
  • Handle push notification display and tracking using handleRemoteMessage method from MessagingService.
  • Using Adobe Journey Optimizer, send a push notification with a deeplink to the app.
  • Keep the app open and click on the displayed notification.
  • Notice the MainActivity restarts which leads to the application not being ready to handle the uri passed to it by the intent as the app is still booting up.
  • This issue is not observed if the Push notification click behaviour is set to simply open the app instead.

Platform and Version

  • Platform: React-native (Expo Managed) - Android
  • React native SDK: @adobe/react-native-aepmessaging: 5.0.0
  • Native SDK: com.adobe.marketing.mobile:messaging: 2.2.0

Sample Code that illustrates the problem

I have created a NotificationService that gets the notification from firebase and passes it to the handleRemoteMessage method for display:

NotificationService.java

public class NotificationService extends FirebaseMessagingService {
  ...
  @Override
  public void onMessageReceived(RemoteMessage message) {
    MessagingService.handleRemoteMessage(this, message);
  }
}

In my Manifest, I have:

AndroidManifest.xml

<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
...
<service android:name=".NotificationService" android:enabled="true" android:exported="false">
   <intent-filter>
      <action android:name="com.google.firebase.MESSAGING_EVENT"/>
   </intent-filter>
</service>
<activity android:name=".MainActivity" 
   android:label="@string/app_name" 
   android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode" 
   android:launchMode="singleTask"
   android:exported="true"
   android:screenOrientation="portrait">
   <intent-filter>
      <action android:name="android.intent.action.MAIN"/>
      <category android:name="android.intent.category.LAUNCHER"/>
   </intent-filter>
   <intent-filter>
      <action android:name="android.intent.action.VIEW"/>
      <category android:name="android.intent.category.DEFAULT"/>
      <category android:name="android.intent.category.BROWSABLE"/>
      <data android:scheme="testApp"/>
      <data android:scheme="com.testapp.testPackageName"/>
   </intent-filter>
....
</activity>

Upon digging through the Android SDK, I found that MessagingPushTrackerActivity has an openUri method that creates a TaskStackBuilder:

MessagingPushTrackerActivity.java

private void openUri(final String uri) {
   final Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(uri));
   TaskStackBuilder stackBuilder = TaskStackBuilder.create(this);
   stackBuilder.addNextIntentWithParentStack(intent);
   stackBuilder.startActivities();
}

I believe the TaskStackBuilder recreates the task stack thereby restarting the existing MainActivity.

[Question] Extract JSON payload from In-app messages

We would like to display the in-app payload that's gets sent out from AJO as JSON payload without any HTML contents so we can design our UI with native framework without needing to use Webview.

I tried to use MessagingDelegate interface and there are no public method to extract payload.
Only option I could see assign the FullscreenMessage and then read the message with JavaScript which looks bad.

Have you got any delegate to extract the JSON payload?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.