How to implement subcription in Android SDK - android

In the app can we add a yearly subscription method, so that it stop working each year if subscription is off Or the current year payment won't went successful.
Any Ideas would be helpful.
Thanks in advance.

You could use In-App Billing
Alternatively, if you allow your customers to create an account on your web site. They could pay you there and you could use your own servers to verify the subscription by calling it from the app.

Related

How to implement in app purchase in ionic 3

I am curios to implement in app purchase but there for i have some questions. I have already seen this post that helped to setup google account and products. I have created two subscriptions on google app purchase which is monthly and yearly with 7 day free trial also. Please see below my doubts and questions.
It seems i can get only one product at time with in app purchase 2 plugin
I need to show subscription list manually and click on each subscription will get product details ?
After purchase we need to store current subscription details on server side to maintain user current subscription ?
When auto renewal happen then do i need to register web-hook in google/apple developer account to notify our server so we can extend expiry date ? and with out web-hook is possible then how can achieve that and what can be pros and cons ?
What is basic idea to implement restore purchases if user login on second mobile with same google/apple account ?
Thanks,
Your help will be appreciated.

Implementing a Yearly Subscription

I am developing an app for Android with Android Studio.
My questions are:
"How do I implement A Yearly Subscription for my app? I want the app to not be usable if they don't have a current subscription-how do I do that?
I know that I have to go to the developer area in Google play and setup subscriptions, and that I need a product ID, but what about code in my app? Is there a library, set of code, or an easy way to accomplish what I need? I know I need an API, but where do I add it in my app? I am lost...
Again, all I want is for my app to have a yearly subscription, and the app should not work unless the yearly subscription is paid.
I have went here, and again it only tells me about the play console-nothing about adding code into my app. Google Play Create a Subscription I don't know what I need or where to code for it...
Any help would be greatly appreciated, and thank you in advance!
Step 1
First create a payment profile with Play Console and follow all instructions at https://support.google.com/googleplay/android-developer/answer/7161426
including the pages on the right side of the page.
Step 2
Incorporate billing into your app using the billing API described here
https://developer.android.com/google/play/billing/api

How to implement in-app purchase of application Android?

I have created a android application. Subscription is free. However I have put ads inside application. Now I want provide option within app where people can buy ad-free version. And also provide option to restore purchase.
I went through Android docs didn't understand anything. Please provide a good tutorial.
Hey I had worked on InApp Purchase recently and I've successfully integrated in my existing app and ready to make it live. Initially when i had started doing this I've downloaded google InApp Billing Example called "Trivial Drive" from here.
But it didn't help me much as it has lots of issues and bugs, So I've decided do it on my own from scratch using new v3 api which you can find here. This tutorial has clear explanation that would help you and also if you have time, see this youtube video where google employee had explained clearly how to integrate it.
Also if you want quick example, I've a sample app which you can download from here.
The following video also explains how to integrate InApp Purchase. Please go through it.
https://www.youtube.com/watch?v=-h2ESH71hAI
Thank you
Refer this question on SO Implementing In App purchases in Android?. Also for official documentation of The In-app Billing Version 3 API refer this link http://developer.android.com/google/play/billing/api.html
This is how you create In app purchase inside your app.
1) In your developers console, go to your application and create a in app product(Name it as Ad-Free Access or what ever).(Note: to create a in app product you need to have a merchant account).
2) If you have a merchant account ready, create a InApp Product with the type of Subscription(One time or monthly or yearly) and price.
3) Once you have created the InApp product successfully, you can prompt the user to purchase an InApp product by quering a list of in app products in your app and ask user to purchase them.
Here is a link to query the InApp products:
4) Once a user purchase the product, based on the purchase status of the product, you can disable the ads in your app.
The Simple and very easy way to implement in-app through a library anjilab.
Just add the dependecy
implementation 'com.anjlab.android.iab.v3:library:1.0.44'
Add Permission, implement methods and you done.
For any issues you can see here
issues

Android In-App Billing Version 3 get expired subscriptions

the google api documentation states that you should call the method
getPurchases()
to know currently active subscriptions, but is there a way to get from Google the expired subscriptions too? Or should I store the subscription informations on a custom server?
I'm doing a magazine app and, even if the subscription is expired, I should be able to allow the user to re-download the issues published while the subscription was active…
Yes of course there is the way for the android application and your back end server to check your subscription details and it's expiration date and even if have access to cancel subscription manually from your server. Using "purchase-status-api", you can check it's expiration date and auto-recurring bill flag.
AFTER LOT OF SEARCH I GOT FOLLOWING LINKS,
PURCHASE-STATUS-API
AUTHENTICATION DEVELOPER DOC
GET EXPIRATION DATE FOR SUBSCRIPTION PRODUCT
REFERENCE LINKS:
MORE LINKS TO IMPLEMENT GOOGLE API
HELP TO IMPLEMENT FOR SERVER OR CLIENT SIDE GOOGLE API
Hope it will solved your problem.

Implementing google in-app subscription

The developer guide gives the sample for in-app billing, and for the subscription it takes for the same sample application, and saying to modify it for subscription.I want to modify this "Dungeons" sample application for subscription, But in the developer guide there is no info for modifying this sample to subscription. What should i change for same.I want to know complete steps for modifying this sample. Please help.
Thanks in advance.
if you implement your InApp Product Purchase with old billing API.
then
update the billing API code to version 2
not much change in the InApp subscription. other then mBillingService.requestPurchase(productId, Consts.ITEM_TYPE_SUBSCRIPTION, null)
To check subscribed items, you can use Restore purchases. In App subscriptions also act as a `InApp Products'
I hope it helps you.

Categories

Resources