Versions Compared

Key

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

...

  • Geofence özelliğini etkinleştirmek için AndroidManifest.xml dosyanıza aşağıdaki kodu ekleyin.

    Code Block
    languagexml
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
    
    <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">
        <intent-filter> <action android:name="com.visilabs.android.gps.geofence.ACTION_RECEIVE_GEOFENCE" /> </intent-filter>
    </receiver>
    
    <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" />

     

  • Sdk’yı çalıştırmak için alttaki init kodunu MainApplication.java dosyanıza ekleyin.
    Geofence özelliğini etkin hale getirmek için Visilabs.CreateAPI fonksiyonunun son parametresini(12.) true değeri girin.

    Code Block
    languagejava
    import com.visilabs.Visilabs;
    import euromsg.com.euromobileandroid.EuroMobileManager;

     

    Code Block
    languagejava
    @Override
    public void onCreate() {
      // ...
    
      initEuroMessage();
    }
    
    private void initEuroMessage() {
        String appAlias = "ALIAS";
        String huaweiAppAlias = "HUAWEI-ALIAS";
        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);
        euroMobileManager.setPushIntent("com.demo.MainActivity", this);
        euroMobileManager.setNotificationLargeIcon(R.drawable.ic_launcher,this);
        euroMobileManager.setNotificationTransparentSmallIcon(R.drawable.ic_launcher, this);
    }

...