Open onatvaris opened 3 months ago
android/app/build.gradle
apply plugin: 'com.google.gms.google-services' apply plugin: 'com.huawei.agconnect'
multiDexEnabled true
AndroidManifest.xml
application
<service android:name="euromsg.com.euromobileandroid.service.EuroFirebaseMessagingService" android:exported="false"> <intent-filter> <action android:name="com.google.firebase.MESSAGING_EVENT" /> </intent-filter> </service>
* If you are going to do Huawei integration, add the following lines to the file.
<service android:name="euromsg.com.euromobileandroid.service.EuroHuaweiMessagingService" android:exported="false"> <intent-filter> <action android:name="com.huawei.push.action.MESSAGING_EVENT" /> </intent-filter> </service>
<service android:name="com.visilabs.gps.geofence.GeofenceTransitionsIntentService" android:enabled="true" android:permission="android.permission.BIND_JOB_SERVICE" />
<service android:name="com.visilabs.gps.geofence.GeofenceMonitor" android:enabled="true" android:exported="true" />
<receiver android:name="com.visilabs.gps.geofence.GeofenceTransitionsReceiver" android:enabled="true" android:exported="true">
<receiver android:name="com.visilabs.gps.geofence.VisilabsAlarm" android:exported="false" />
<receiver android:name="com.visilabs.gps.geofence.GeofenceBroadcastReceiver" android:enabled="true" android:exported="true" />
* Modify your `MainApplication.java` as below to init library. Change geofenceEnabled parameter as you want. ```java import com.visilabs.Visilabs; import euromsg.com.euromobileandroid.EuroMobileManager;
@Override public void onCreate() { // ... initEuroMessage(); } private void initEuroMessage() { String appAlias = "demo-alias"; String huaweiAppAlias = "demo-alias-huawei"; String organizationId = "OID"; String siteId = "SID"; String datasource = "datasource"; String channel = "Android"; String segmentUrl = "http://lgr.visilabs.net"; String realtimeUrl = "http://rt.visilabs.net"; String targetUrl = "http://s.visilabs.net/json"; String actionUrl = "http://s.visilabs.net/actjson"; String geofenceUrl = "http://s.visilabs.net/geojson"; Visilabs.CreateAPI(organizationId, siteId, segmentUrl, datasource, realtimeUrl, channel, this, targetUrl, actionUrl, 30000, geofenceUrl, true, "reactnative"); EuroMobileManager euroMobileManager = EuroMobileManager.init(appAlias, huaweiAppAlias, this); // optional euroMobileManager.setPushIntent("com.pushsdk.MainActivity", this); euroMobileManager.setNotificationTransparentSmallIcon(R.drawable.ic_launcher, this); euroMobileManager.setNotificationTransparentSmallIconDarkMode(R.drawable.ic_launcher, this); euroMobileManager.useNotificationLargeIcon(true); euroMobileManager.setNotificationLargeIcon(R.drawable.ic_launcher, this); euroMobileManager.setNotificationLargeIconDarkMode(R.drawable.ic_launcher, this); euroMobileManager.setNotificationColor("#d1dbbd"); euroMobileManager.setChannelName("Channel", this); euroMobileManager.setNotificationPriority(RDNotificationPriority.NORMAL, this); // Set to HIGH for push notifications to appear as temporary banners }
android/app/build.gradle
file's bottom.android/app/build.gradle
file's defaultConfig section.AndroidManifest.xml
file'sapplication
section to receive notifications when the app is foreground.* If you are going to do Huawei integration, add the following lines to the file.
AndroidManifest.xml
file'sapplication
section to enable geofence capability.<service android:name="com.visilabs.gps.geofence.GeofenceMonitor" android:enabled="true" android:exported="true" />
<receiver android:name="com.visilabs.gps.geofence.GeofenceTransitionsReceiver" android:enabled="true" android:exported="true">
<receiver android:name="com.visilabs.gps.geofence.VisilabsAlarm" android:exported="false" />
<receiver android:name="com.visilabs.gps.geofence.GeofenceBroadcastReceiver" android:enabled="true" android:exported="true" />