Skip to content

Commit 5065fe3

Browse files
committed
Fix sample so it works again
1 parent 4db2a96 commit 5065fe3

File tree

16 files changed

+12
-770
lines changed

16 files changed

+12
-770
lines changed

README.md

Lines changed: 4 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
![Dashboard Items](https://raw.github.com/BatchLabs/android-sdk/master/readme_logo.png)
22

33
# Batch Sample Apps
4-
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.
55

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.
77

88
## App
99

@@ -23,43 +23,9 @@ Within your newly-created app, find the dev API key either here on step 1 of the
2323

2424
Place the dev API key in your sample app's `BatchSampleApplication.java`, in the startWithAPIKey method call.
2525

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.
2727

28-
> Note: The app starts with 10 `Lives`, as shown below.
29-
30-
![No Redeeemed Items](https://raw.github.com/BatchLabs/android-sdk/master/readme_noredeem.png)
31-
32-
If you are using the wizard, you can now click `Test` and should receive a confirmation of your integration if you launched the app with your API key.
33-
34-
### 4. Add items for Batch Unlock
35-
The samples are configured with three static items: `No Ads`, `Pro Trial`, and `Lives`.
36-
37-
![Dashboard Items](https://raw.github.com/BatchLabs/android-sdk/master/readme_items.png)
38-
39-
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.
53-
54-
![Redeemed Items](https://raw.github.com/BatchLabs/android-sdk/master/readme_redeem.png)
55-
56-
> 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
6329

6430
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.
6531
You will also be able to change the notification settings from the main menu.

Sample_Project/sample/.idea/misc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Sample_Project/sample/app/app.iml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,11 @@
9696
<orderEntry type="library" exported="" name="support-compat-26.0.0" level="project" />
9797
<orderEntry type="library" exported="" name="play-services-ads-9.6.1" level="project" />
9898
<orderEntry type="library" exported="" name="support-vector-drawable-26.0.0" level="project" />
99+
<orderEntry type="library" exported="" name="batch-sdk-1.10.0" level="project" />
99100
<orderEntry type="library" exported="" name="support-core-utils-26.0.0" level="project" />
100101
<orderEntry type="library" exported="" name="play-services-tasks-9.6.1" level="project" />
101102
<orderEntry type="library" exported="" name="support-v4-26.0.0" level="project" />
102103
<orderEntry type="library" exported="" name="play-services-basement-9.6.1" level="project" />
103-
<orderEntry type="library" exported="" name="batch-sdk-1.9.2" level="project" />
104104
<orderEntry type="library" exported="" name="play-services-ads-lite-9.6.1" level="project" />
105105
<orderEntry type="library" exported="" name="support-annotations-26.0.0" level="project" />
106106
<orderEntry type="library" exported="" name="appcompat-v7-26.0.0" level="project" />

Sample_Project/sample/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*/
44

55
repositories {
6-
jcenter()
6+
mavenCentral()
77
google()
88
}
99

Sample_Project/sample/app/src/main/AndroidManifest.xml

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -46,21 +46,6 @@
4646
android:host="notification-settings" />
4747
</intent-filter>
4848
</activity>
49-
<activity
50-
android:name=".activity.UnlockActivity"
51-
android:label="@string/title_activity_unlock"
52-
android:parentActivityName=".activity.MainActivity" >
53-
<meta-data
54-
android:name="android.support.PARENT_ACTIVITY"
55-
android:value="com.batch.android.sample.activity.MainActivity" />
56-
<intent-filter>
57-
<action android:name="android.intent.action.VIEW" />
58-
<category android:name="android.intent.category.DEFAULT" />
59-
<category android:name="android.intent.category.BROWSABLE" />
60-
<data android:scheme="batch-sample"
61-
android:host="unlock" />
62-
</intent-filter>
63-
</activity>
6449

6550
<!-- Batch's Required manifest items -->
6651

Sample_Project/sample/app/src/main/java/com/batch/android/sample/UnlockManager.java

Lines changed: 0 additions & 251 deletions
This file was deleted.

0 commit comments

Comments
 (0)