Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Step 1 - Requirements

...

2.1  Please add code block to app/build.gradle (Module: app) 

Code Block
languagegroovy
dependencies {
		implementation 'com.euromsg:euromsg:$euromessage_version'
	}

apply plugin: 'com.huawei.agconnect'
apply plugin: 'com.google.gms.google-services'

...

2.2 Please add code block to project / build.gradle'

Code Block
languagegroovy
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
languagejava
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());
    }
}

...

Code Block
languagejava
 @Override
    protected void onNewIntent(Intent intent) {
        super.onNewIntent(intent);

        if (intent.getExtras() != null) {
            EuroMobileManager.getInstance().reportRead(intent.getExtras());
        }
    }

    @Override
    protected void onResume() {
        super.onResume();

        if (getIntent().getExtras() != null && EuroMobileManager.getInstance().getNotification(getIntent()) != null) {
            EuroMobileManager.getInstance().reportRead(getIntent().getExtras());
        }
    }

Proposal :

If the push notification reaches your device in debug mode when sending campaigns from RMC, but not in release mode, take a look at your problems with pro-guard in your application.

You can add the following codes to proguard-rules.pro;

Code Block
-keep class com.visilabs.**{*;} #Visilabs
-keep class euromsg.com.**{*;} #Euromessage


Sample Apps :

Euromessage Demo

...