Step 1 - Requirements
...
2.1 Please add code block 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 block 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()); } } |
...
You must enter utm parameters in the Custom Parameters field on the push screen.
Ex: utm_medium=apppush;utm_source=related;utm_campaign=campaign_name
P.S: Since utm_campaign should be different each time, you can use the ID of the push campaign you created as a variable. You can optionally use the <## CAMP_ID ##> variable for this.After clicking the push notification, a data will be returned to you as below.
Örnek Sample Data:
Code Block { “data”: { “pushType” : “Text”, “url” : “”, “mediaUrl” : “”, “pushId” : “df73706e-1138-40f2-b687-c10c43ee8138”, “altUrl”: “”, “sound”:“”, “message”:“Message”, “title”:“Title”, “utm_medium”: “apppush”, “utm_campaign”: “campaign_name”, “utm_source”: “related”, } }
You should handle this data just like using deeplink and send the utm parameters as event to Visilabs when the push message is clicked. You can find sample Visilabs event codes on the bottom line.
Code Block HashMap<String, String> parameters= new HashMap<String, String>(); parameters.put("utm_campaign ","campaign_name"); parameters.put("utm_source","related"); parameters.put("utm_medium","apppush"); parameters.put("OM.exVisitorID”, "KeyID veyaor Mail"); //Your reference in the RMC system parameters.put("OM.sys.TokenID","User Token for Push Message"); parameters.put("OM.sys.AppID","AppAlias"); Visilabs.CallAPI().customEvent("Campaign", parameters);
...