You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The samples are minimal examples demonstrating proper integrations of the Batch SDK, including implementation of Batch Unlock and Batch Push functionality.
4
+
The samples are minimal examples demonstrating proper integrations of the Batch SDK, including implementation of Batch Push functionality.
5
5
6
-
You will need an up-to-date SDK and Android Studio installation in order to properly utilize this sample.
6
+
You will need an up-to-date SDK and Android Studio installation in order to properly use this sample.
7
7
8
8
## App
9
9
@@ -23,43 +23,9 @@ Within your newly-created app, find the dev API key either here on step 1 of the
23
23
24
24
Place the dev API key in your sample app's `BatchSampleApplication.java`, in the startWithAPIKey method call.
25
25
26
-
At this point, feel free to launch your app. If you select `Unlock`, you should see that you haven't yet redeemed any *features* or *items*.
26
+
At this point, feel free to launch your app.
27
27
28
-
> Note: The app starts with 10 `Lives`, as shown below.
While the names can vary in the *NAME* field, the *REFERENCE* is the case-sensitive value used in the sample code.
40
-
41
-
*No Ads* is used to demonstrate restorability. It is recommended to set this to *Always restore*.
42
-
43
-
*Pro Trial* demonstrates a time-to-live (TTL) for expiring offers. Set the option to *trial (days)* and choose a valid amount of days for the feature to be active.
44
-
45
-
*Lives* is an example of a resource, or consumable item. You can define the given quantity in the campaign.
46
-
47
-
### 5. Create campaign
48
-
In the campaign screen of your dashboard, create a new *Unlock* campaign. You can use any of the wizard options, or choose a *Custom Offer* for manual setup.
49
-
50
-
As long as the conditions (time, user targeting, URL scheme, capping) match when you launch the app, you will recieve whatever configuration of features and resources you specify. You will also recieve the `reward_message` custom parameter, sent as alert, to give feedback to the user about the offer redeemed.
51
-
52
-
In this example, `No Ads` is given in the offer with *restore* enabled, `Pro Trial` is given with a 9 day trial set, and 5 `Lives` are given, adding to the previously-mentioned default of 10.
> Note: If you set a campaign targeting only new users, ensure that you're running the app for the first time on the device, otherwise it will be considered an existing user. Delete and reinstall to be considered new.
57
-
58
-
### 6. Testing Restore
59
-
60
-
To test the restore functionality, delete the app from your testing device and then reinstall from Android Studio. Upon relaunch you will see that your inventories have been reset to defaults. Within *Unlock*, select *Restore* and you will see a confirmation of the restore. Your inventory will now reflect any content you have enabled for restoration.
61
-
62
-
### 7. Testing Push
28
+
### 4. Testing Push
63
29
64
30
To test the push functionality, add your GCM Sender ID in `BatchSampleApplication.java`. Your token will be logged in your device's logcat, which you can use in the dashboard's test push function. This can be found on the Message screen of the push campaign creation wizard.
65
31
You will also be able to change the notification settings from the main menu.
0 commit comments