SDK Installation

Step 1: Open Project in Android Studio IDE

Open Android Studio IDE and open the project that you are working on.

Step 2: Include MessagingSDK Library Dependency

In order to deliver Push Notifications to your App, add the followingMessagingSDK dependencies in app.gradle.

build.gradle (Module: app):

...  
   android {  
       ...  
 }
   dependencies {
   ...
   implementation 'com.messaging.sdk:core:0.13.0'
   ...
 }
  ...

build.gradle:

  buildscript {  
       // ... 
       dependencies {  
           // ... 
           classpath 'com.google.gms:google-services:4.3.1' // google-services plugin  
       }
   }

   allprojects {
       // ... 
       repositories {
           google()
           jcenter()


            maven { url "https://nexus.messangi.me/repository/maven-public/" }
           // ...
       }  
   }

Step 3: Configure FCM in Android Project

You may add the FCM directly using the Android Studio IDE or in Firebase account.

From Android Studio IDE

Open Android Studio IDE and open the project that you are working on

Select your project, go to the Tools tab, and select the Firebase option

image18.jpg
  • Select Cloud Messaging, and then click to Set up Firebase Cloud Messaging.

image19.jpg
  • Connect your app to an existing Firebase project or create a new Firebase project in the console.

image14.jpg
image5.jpg
  • Add FCM to the Application

image15.jpg
  • Once you have connected the Android Studio project to a Firebase Project and Added CFM to the App, you shall see the following confirmation screen:

image8.jpg

Note

From the Android Studio IDE configuration, do not complete the"Handle message" step as the SDK will do it for you.

you can also see:

https://firebase.google.com/docs/cloud-messaging/android/client?hl=es

Step 4: Obtain and Add Messangi.xml file in values project

Obtain the configuration fileMessaging.xmlfrom the Mobile Messaging Platform. This is found in the Preferences section under the Push tab after completing the initial App Integration setup.

image7.png

Example ofMessaging.xmlfile:

  <string name="messangi_host" translatable="false" templateMergeStrategy="preserve">https://service.messangi.me/aemon/v1</string>
 <string name="messangi_app_token" translatable="false">YourAppToken</string>
 <bool name="analytics_allowed">false</bool>
 <bool name="location_allowed">false</bool>
 <bool name="logging_allowed">true</bool>
</resources>

Put the configuration file in the values folder of the Android project.

Once you have completed these steps, Push Notifications will be able to be delivered to the Device managed by the OS functionality.

Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Article is closed for comments.