Add Android FCM SDK to Android Studio for Mapp Cloud (deprecate)
This document describes the steps to add the Android SDK to Android Studio
SDK Versions
As of April 10, 2019, Google has deprecated support for GCM. Please ensure you have the correct Android FCM SDK file for FCM compatibility. The Android GCM SDK will NOT work with FCM tokens.
Download the latest SDK files here: https://developers.mapp.com/#mobile-sdk
Pre-requisites:
- Android SDK FCM v5.0.5 aar file
- An Android FCM example app for v5+ contains a full code same.
Steps
- Open Android Studio and create your application. Application must have a minimum version of Android SDK Version 19.
- Import the Android FCM SDK aar file, click on File->New->New Module.
- Select "Import .JAR/.AAR Package", click Next.
- Select the Android FCM SDK aar file from the location you have saved it, click Next.
- Add new Module Dependency
- Go to File->Project Structure->app dependencies
- Go to File->Project Structure->app dependencies
- Click on + button and choose Module dependency
- Choose your added module, click OK.
- The Gradle project sync will start. If it does not start, you can sync it using Sync button.
- Make sure your application build.gradle file include the applicationId attribute for android defaultConfig. Alternately, you can replace ${applicationId} with your application package (e.g com.yourapppackage.app). Include the following dependencies to your app's gradle.build dependencies section :
app build.gradle
android { compileSdkVersion 28 //or above buildToolsVersion '28.0.3' //or above ... defaultConfig { applicationId "com.yourapppackage.app" //make sure you have this minSdkVersion 19 targetSdkVersion 28 ... } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } } dependencies { implementation 'com.android.support:appcompat-v7:28.0.0' //or above implementation 'com.google.code.gson:gson:2.8.2' //2.8.2 or above implementation('com.google.firebase:firebase-messaging:17.3.4') { //or above exclude group: 'com.android.support' } implementation 'com.google.dagger:dagger:2.16' //or above implementation "com.google.dagger:dagger-android-support:2.16" //or above implementation project(':appoxee_sdk_5.0.4') //or above } apply plugin: 'com.google.gms.google-services' //please add the following dependencies to your project gradle.build dependencies section : dependencies { classpath 'com.android.tools.build:gradle:3.2.1' // or above classpath 'com.google.gms:google-services:4.0.1' // or above }