Skip to content

Commit

Permalink
fix(android): add support for latest sdk
Browse files Browse the repository at this point in the history
BREAKING CHANGE: This change is required to supports latest android dependencies for GetFeedback Android SDK 7.5.0 onwards
  • Loading branch information
hiteshjain29 committed Jul 4, 2022
1 parent de689e6 commit 91296f8
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 5 deletions.
36 changes: 36 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ This React Native bridge supports React Native app builds with version `0.61.5`
- [Campaigns](#campaigns)
- [The App Id](#the-app-id)
- [Events](#events)
- [Standard Events](#standard-events)
- [Campaign submission callback](#campaign-submission-callback)
- [Reset Campaign data](#reset-campaign-data)
- [Managing an existing Campaign](#managing-an-existing-campaign)
Expand Down Expand Up @@ -79,6 +80,23 @@ You can start using the Usabilla for React Native module in your app by requirin

`const usabilla = require('usabilla-react-native')`

**Note : For using latest SDK and Standard Events, Hosting App's Gradle needs to be updated**
1. Change `distributionUrl` in **gradle-wrapper.properties** - `distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip`

![](./images/Android1.png)

2. Udate **build.gradle** to use
`buildToolsVersion = "30.0.2"`
`compileSdkVersion = 31`
`targetSdkVersion = 31`
`classpath("com.android.tools.build:gradle:7.1.2")`

![](./images/Android2.png)

3. Explicitly declare the `android:exported=”true”` attribute in the **AndroidManifest**.

![](./images/Android3.png)

## Campaigns

In the Usabilla for Apps Platform, a campaign is defined as a proactive survey targeted to a specific set of users.
Expand Down Expand Up @@ -121,6 +139,24 @@ For more on how to use custom variables, have a look at [Custom Variables](#cust

**Note: A campaign will never be triggered for the same user more than once.**

### Standard Events

From **`v1.0.0`** onwards we are introducing a new feature **Standard Events**.

**Note : Now with Standard Events you can show campaigns in your application(Host application embedded with GetFeedback Digital/ Usabilla SDK) without adding any extra lines of code. You just have to create Standard Campaigns(Campaigns with Default/System Events) with your `User-Account` at `GetFeedback`.**

Currently we are supporting these lifecycle / system events :
- `LAUNCH` : Define as when the app is entering foreground
- `EXIT` : Define as when the app is entering to the background
- `CRASH` : Define as when the app is crashed ( terminated due to an unexpected behaviour)

**Note : SDK will not listen to any Default / System events, until it has been initialised and it is recommended to initialise only once. In order to make this work properly, SDK has to be initialize using `FlutterUsabilla.initialize` at the earliest possibility, preferably in the initState method:**

To get some additional information about the response left by your user, you have the option to use the [`callback`](#campaign-submission-callback) method. This is a listener that listens in to the moment a Campaign with standard events is closed.

[Click here](https://support.usabilla.com/hc/en-us/articles/4747575452562) to read more about Standard Events.


### Campaign submission callback

To get some additional information about the response left by your user, you have the option to use the `setCampaignDidClose` method. This is a listener that listens in to the moment a Campaign is closed.
Expand Down
9 changes: 4 additions & 5 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
apply plugin: 'com.android.library'

android {
compileSdkVersion 28
buildToolsVersion "28.0.3"
compileSdkVersion 31
buildToolsVersion "30.0.2"

defaultConfig {
minSdkVersion 19
targetSdkVersion 28
targetSdkVersion 31
versionCode 1
versionName "1.0.0"
}
Expand All @@ -16,8 +16,7 @@ android {
}

dependencies {
/* TODO: Revert back ubform to semantic version for all minor & patches ~ 7.+ */
implementation 'com.usabilla.sdk:ubform:7.4.0'
implementation 'com.usabilla.sdk:ubform:7.+'
implementation "com.facebook.react:react-native:0.+"
implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.0.0'
}
Binary file added images/Android1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/Android2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/Android3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 91296f8

Please sign in to comment.