Search results for "{{ search.query }}"

No results found for "{{search.query}}". 
View All Results

Integration

Add WebEngage Dependencies

WebEngage Android SDK is hosted on jcenter maven repository.
Update your project's build.gradle script to include jcenter.

repositories {
 	...
    
  jcenter()
  
  ...
}

Include WebEngage dependencies in your app/build.gradle

dependencies {
   //WebEngage SDK
   compile 'com.webengage:android-sdk:2.+'

   compile 'com.android.support:support-v4:24.2.1' 
   compile 'com.google.android.gms:play-services-ads:10.0.1'

   //Optional
   compile 'com.google.android.gms:play-services-location:10.0.1'
}

Modify AndroidManifest.xml

Insert the below XML snippet inside application tag of your AndroidManifest.xml file.

<meta-data
  android:name="com.webengage.sdk.android.debug"
  android:value="true" /> <!-- only for debugging -->

<meta-data
  android:name="com.webengage.sdk.android.key"
  android:value="YOUR_WEBENGAGE_LICENSE_CODE" /> <!-- Replace with your WebEngage's license code -->

<meta-data
   android:name="com.webengage.sdk.android.location_tracking"
   android:value="true" /> <!-- Set false if location tracking is not required -->

<service android:name="com.webengage.sdk.android.ExecutorService" />
<service android:name="com.webengage.sdk.android.EventLogService" />

<activity
   android:name="com.webengage.sdk.android.actions.render.WebEngageActivity"
   android:theme="@android:style/Theme.Translucent"
   android:configChanges="orientation|screenSize" />

<receiver
   android:name="com.webengage.sdk.android.WebEngageReceiver">
   <intent-filter>
      <action android:name="com.webengage.sdk.android.intent.ACTION" />
      <category android:name="YOUR.PACKAGE.NAME" /> <!-- Replace with your package name -->
   </intent-filter>
</receiver>

<receiver
   android:name="com.webengage.sdk.android.InstallTracker"
   android:exported="true">
   <intent-filter>
      <action android:name="com.android.vending.INSTALL_REFERRER" />
   </intent-filter>
</receiver>


Make sure to replace YOUR_WEBENGAGE_LICENSE_CODE with your WebEngage license code and YOUR.PACKAGE.NAME with your app's package name.

Insert the below XML snippet inside manifest tag of your AndroidManifest.xml file


<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WAKE_LOCK" />
<!-- Optional -->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

Initialise the SDK

Initialise the SDK from the onCreate method of your Application class.

public class MyApplication extends Application {
   @Override
   public void onCreate() {
      super.onCreate();
      registerActivityLifecycleCallbacks(new WebEngageActivityLifeCycleCallbacks(this));
  }
}

If your app is targeting Android API level less than 14 then use alternative initialisation instead of above approach

Proguard Configuration

Add following lines to your apps' proguard-rules.pro file

-keep class com.webengage.sdk.android.**{*;}

-dontwarn com.webengage.sdk.android.**

Integration