Skip to content

Commit

Permalink
Release 1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mklb committed Oct 7, 2020
1 parent 48dfcaf commit 7410e66
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 6 deletions.
18 changes: 18 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Mage/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
defaultConfig {
minSdkVersion 16
targetSdkVersion 30
versionCode 2
versionName "1.0.6"
versionCode 3
versionName "1.1.0"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ public static void setOptions(){
put("isProduction", true);
}});

Mage.setUserIdentifier("myUserId");

} catch (Exception e) {
e.printStackTrace();
}
Expand Down
10 changes: 10 additions & 0 deletions Mage/src/main/java/io/getmage/android/Mage.java
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,16 @@ public void call(Exception error, HashMap<String, Object> response) {
}));
}

public static void setUserIdentifier(String userId){
if(sharedInstance().currentState != null){
if (verbose) {
Log.d("MageSDK", "setUserIdentifier: " + userId);
}
sharedInstance().currentState.put("appUserId", userId);
}
sharedInstance().scheduleSaveState();
}

public static String getProductNameFromId(String iapID){
if (verbose) {
Log.d("MageSDK", "getProductNameFromId: " + iapID);
Expand Down
15 changes: 12 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ allprojects {
```gradle
dependencies {
...
implementation 'com.github.getmageio:mage-android-sdk:1.0.6'
implementation 'com.github.getmageio:mage-android-sdk:1.1.0'
}
```

Expand Down Expand Up @@ -62,7 +62,7 @@ try {

### 3) Get your in app purchase IDs

Wherever you show in app purchases call `getIdFromProductName` to get the correct in app purchase ID. This could be, for example, somewhere in your ViewController for your store view / popup.
Wherever you show in app purchases, call `getIdFromProductName` to get the correct in app purchase ID. This could be, for example, somewhere in your ViewController for your store view / popup.

```java
// Get the correct in app purchase id to show to the user
Expand All @@ -72,7 +72,7 @@ Mage.getIdFromProductName("myProduct", "com.myapp.myFallbackID");

### 4) Know what you sold

In some cases you might want to know what the user bought so you can send it to a CRM,
In some cases, you might want to know what the user bought so you can send it to a CRM,
your own backend or for some custom logic inside your app. `getProductNameFromId` will help you out!

```java
Expand All @@ -92,6 +92,15 @@ Auto-purchase tracking is not yet implemented in our Android Java SDK. Whenever
Mage.userPurchased("com.myapp.someIapID")
```

### 6) Identify the user for our Subscription Lifetime Value Tracking (optional)
Subscription status tracking is usually done on your backend or by some third party service. Apple or Google sends real-time subscription status updates that you interpret and take action on. This is why we provide a simple Web API to enable subscription lifetime value tracking for Mage. Apple or Google contacts your backend, your backend contacts Mage.

This way, we can adequately track the durations of your subscriptions and identify free trial and introductory price offer conversion rates. To make this feature work, you need to implement the `setUserIdentifier` method so that we can identify the calls from your backend. [Learn more about our Subscription Lifetime Value Tracking Feature](link...).

```java
Mage.setUserIdentifier("myUserIdentifier")
```


## License

Expand Down

0 comments on commit 7410e66

Please sign in to comment.