Step 1 - Requirements
Android mobile |
...
app & Android Studio |
Firebase Cloud Messaging ve Huawei Push Kit - google_services.json & agconnect_services.json |
RMC Account - AppAlias |
Minimum 17 API Level test device |
Step 2 - Adding Dependencies
2.1 Please add code blok to app/build.gradle (Module: app)
Code Block | ||
---|---|---|
| ||
dependencies { implementation 'com.euromsg:euromsg:$euromessage_version' } apply plugin: 'com.huawei.agconnect' apply plugin: 'com.google.gms.google-services' |
...
2.2 Please add code blok to project / build.gradle'
Code Block | ||
---|---|---|
| ||
buildscript { repositories { google() jcenter() maven {url 'http://developer.huawei.com/repo/'} } dependencies { classpath "com.android.tools.build:gradle:$gradle_version" classpath 'com.google.gms:google-services:$google_version' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath 'com.huawei.agconnect:agcp:$huawei_version' } } allprojects { repositories { google() jcenter() maven {url 'http://developer.huawei.com/repo/'} } } |
...
Don’t forget to click sync.
Step 3 - Adding codes to Android Manifest
...
You will see example implementation below. For this you need to define FIREBASE_APP_ALIAS and HUAWEI_APP_ALIAS through the RMC panel.
Code Block | ||
---|---|---|
| ||
public class MainApplication extends Application { private final String FIREBASE_APP_ALIAS = "euromessage-android"; private final String HUAWEI_APP_ALIAS = "euromsg-huawei"; private static EuroMobileManager euroMobileManager; @Override public void onCreate() { super.onCreate(); euroMobileManager = EuroMobileManager.init(FIREBASE_APP_ALIAS, HUAWEI_APP_ALIAS, this); euroMobileManager.registerToFCM(getBaseContext()); } } |
...