This document outlines step-by-step instructions for setting up native subscription for your Android mobile app powered by Zype's Endpoint API service and app production software and SDK template.
IT or developer support strongly recommended. Completing app submission and publishing requires working with Google Play Console, app bundles and IDE.
A Google Account and Google Developer Account will be needed.
- Log in to your Google Play Console and either select your app, or create one. You can follow this simple Google documentation if you need to create one.
-
After you hit create, look towards the left menu and pull down
Store presence
menu group and then selectIn-app products
option. Then switch toSubscriptions
tab. -
Click
Create subscription
button to create new subscription. Follow this guide for details of the creating subscription process. Take a note of subscriptionProduct ID
. You will need it further. -
Repeat the process for any other subscription options you would like to offer - yearly, weekly, etc.
Note: To add In-app products you need to set up a merchant account. Follow this guide for details.
- Open your Android Studio project and switch to the Android view.
-
Expand the
app
folder and go tojava/com.zype.android
folder. Then open theZypeSettings.java
file. -
Set following constants as stated below::
public static final boolean NATIVE_SUBSCRIPTION_ENABLED = true; ... public static final boolean UNIVERSAL_SUBSCRIPTION_ENABLED = false;
-
Expand the
app
folder and go tojava/com.zype.android/Billing
folder. Then open theSubscriptionsHelper.java
file. -
In the
getSkuList()
method update the code where subscription SKUs are added to the array.For each your subscription option you should have following row:
result.add("<Your product ID>");
Use product ID of the subscription option that you have noted in step 3 as a string parameter of the
add
method.The result code of the method should look like this:
public static List<String> getSkuList() { List<String> result = new ArrayList<>(); result.add("com.zype.android.demo.monthly"); result.add("com.zype.android.demo.yearly"); return result; }
Now that you’ve set up your in-app items and configured your app, it’s time to test out the integration and see how IAP interacts with your media.
-
Build a signed APK file of your app and publish it in Google Play Console into alpha or beta channel.
-
Enable testing in your alpha or beta channel and share opt-in URL with your testers.
-
In left menu of Google Play Console select
Settings
option and theAccount details
. Add your tester accounts to theLicense Testing
list. This will make testers to not charged when they test in-app purchases.