Step 1. Add the JitPack repository to your build file
Add it in your root settings.gradle at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
Add it in your settings.gradle.kts at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url = uri("https://jitpack.io") }
}
}
Add to pom.xml
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
Add it in your build.sbt at the end of resolvers:
resolvers += "jitpack" at "https://jitpack.io"
Add it in your project.clj at the end of repositories:
:repositories [["jitpack" "https://jitpack.io"]]
Step 2. Add the dependency
dependencies {
implementation 'com.github.kitabsawti:wootricsdk-android:2.8.0'
}
dependencies {
implementation("com.github.kitabsawti:wootricsdk-android:2.8.0")
}
<dependency>
<groupId>com.github.kitabsawti</groupId>
<artifactId>wootricsdk-android</artifactId>
<version>2.8.0</version>
</dependency>
libraryDependencies += "com.github.kitabsawti" % "wootricsdk-android" % "2.8.0"
:dependencies [[com.github.kitabsawti/wootricsdk-android "2.8.0"]]
This library is tested to support Android SDK version 16 onwards. Please let us know if you need assistance for lower Android SDK version by emailing support@wootric.com
View the Android demo here.
This library is distributed as Android library project so it can be included by referencing it as a library project.
If you use Maven, you can include this library as a dependency:
<dependency>
<groupId>com.wootric</groupId>
<artifactId>wootric-sdk-android</artifactId>
<version>2.8.0</version>
</dependency>
compile 'com.wootric:wootric-sdk-android:2.8.0'
WootricSDK task is to present a fully functional survey view with just a few lines of code.
Add permissions:
Add the internet permissions to the AndroidManifest.xml file:
<uses-permission android:name="android.permission.INTERNET" />
Add ProGuard rules:
Add the following to your ProGuard rules:
-keepattributes *Annotation*, Signature
##== Wootric ==
-keep class com.wootric.** { *; }
##== Retrofit ==
-keep class retrofit.** { *; }
-keepclassmembernames interface * {
@retrofit.http.* <methods>;
}
Import the SDK's header:
First import the SDK into your Activity of choosing:
import com.wootric.androidsdk.Wootric;
Configure the SDK with your client ID and account token:
All you need to do is to add this code to your Activity's onCreate
method:
Wootric wootric = Wootric.init(this, CLIENT_ID, ACCOUNT_TOKEN);
To display the survey (if user is eligible - this check is built in the method) use:
wootric.survey();
And that's it! You're good to go and start receiving customer's feedback from your Android app.
For a working implementation of this project see the app/
folder.
// Import Wootric
import com.wootric.androidsdk.Wootric;
// Inside your Activity's onCreate method
Wootric wootric = Wootric.init(this, YOUR_CLIENT_ID, YOUR_ACCOUNT_TOKEN);
wootric.setEndUserEmail("nps@example.com");
// Use only for testing
wootric.setSurveyImmediately(true);
// show survey
wootric.survey();
The WootricSDK is released under the MIT license. See LICENSE for details.
If you want to contribute, report a bug or request a feature, please follow CONTRIBUTING for details.