You can create your app on Review Relic Web portal
Review Relic for Android supports API 16 and above.
Add the JitPack repository to your build file
Add it in your root build.gradle at the end of repositories:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Add the dependency
dependencies {
implementation 'com.github.reviewrelic-universe:android-sdk:1.0.1'
}
A project with some basic example is provided here.
We include the INTERNET permission by default as we need it to make network requests:
<uses-permission android:name="android.permission.INTERNET"/>
To initialize the Review Relic SDK in your app, use below snippet in your app's Application class or where ever you seems appropiate:
ReviewRelic
.setSecretKey("") /* Secret key obtained from Web portal of review relic */
.setToken("") /* Token obtained from Web portal of review relic */
.setMerchantId("") /* Merchant Id obtained from Web portal of review relic */
.enableLogging() /* Set to true if you want to see logs */
.setInitializeListener() /* Callback for successful initialization of SDK */
.build()
Following are functions you need to call for SDK initialization:
Attribute | Function | Description | Type | Required | Default value |
---|---|---|---|---|---|
secretKey | setSecretKey() | Set the environment API key | String | Yes | Should be non-null |
token | setToken() | Set the environment Token | String | Yes | Should be non-null |
merchantId | setMerchantId() | Set the merchant ID | String | Yes | Should be non-null |
logging | enableLogging() | Toggle logging for SDK | Boolean | No | false |
onInitializedListener | setInitializeListener() | Listener for successful intializaiton of SDK | ReviewRelicOnInitializedListener | No | Null |
ReviewRelic.showSheet(
transactionId = "", /*Transaction Id*/
thankYouMessage = "", /*Thank you message*/
fragmentManager = , /* Pass fragment manager from your Activity/Fragment */
reviewRelicBottomSheetInputs = ReviewRelicBottomSheetInputs(
title = "", /*Title you want to show (will override the title set on Web portal)*/
subtitle = "", /*Subtitle you want to show (will override the subtitle set on Web portal)*/
image = null /*Icon you want to show (will override the icon set on Web portal)*/
),
onSubmitCallback = {} /* Callback for successfully submitting review */
)
Following are the parameters details for showing sheet:
Parameters | Description | Type | Required | Default value |
---|---|---|---|---|
transactionId | Transaction Id for your review | String | No | null |
thankYouMessage | Thank you message you want to show | String | No | "Thank you" |
reviewRelicBottomSheetInputs | BottomSheet inputs user can override (See table for detailed attributes) | com.review.relic.ui.ReviewRelicBottomSheetInputs | No | null |
fragmentManager | Pass fragment manager from your Activity/Fragment | FragmentManager | Yes | Should be non-null |
onSubmitCallback | Callback for successfully submitting review | No |
Following are the parameters details for ReviewRelicBottomSheetInputs class:
Parameters | Description | Type | Required | Default value |
---|---|---|---|---|
title | Title you want to show (will override the title set on Web portal) | String | No | null |
subtitle | Subtitle you want to show (will override the subtitle set on Web portal) | String | No | null |
image | Icon you want to show (will override the icon set on Web portal) | com.review.relic.utils.ReviewRelicImage | No | null |
Following are the parameters details for ReviewRelicImage class:
Parameters | Description | Type | Required | Default value |
---|---|---|---|---|
image | Image ResourceId (Drawable Int) or Base64 (String) | Any | No | null |
type | ImageType (ResourceId,Bas64) from com.review.relic.utils.ImageType Enum | com.review.relic.utils.ImageType | No | null |