Purchase Check/Auth for Paid Apps - android

I'm thinking of releasing a "PRO" (ad-free) version for my android application and I'm worried that the apk would be shared on blogs/crack sites for free distribution
is there a way to add some kind a purchase check? Since the app will be available for purchase only, there should be a way to check the user's purchase history maybe?
If the user hasn't purchased the app and is using it the app would show a message that they haven't bought it properly and would shut down.

The thing that you are looking for is the App Licensing. Here is the link that can help you.
How can I implement Google Play Licensing for an Android app?

Related

Android in app billing how and where to specify paid feature charges

Can anyone explain how does in-app billing process works for Android?
Do I need to upload two different apk (free and paid) to Play store and link buy button click in free app to paid version on Play store, but in this case will free app get replaced with paid app when user purchases paid one? How to achieve this?
If I give buy button in my free app which enabled purchase of paid full version (extra features) then how does this purchase works? Is it that upon activity startup I get some event when will tell me if app is purchased or not. Based of which I can enable paid features in my code. If yes Will this kind of logic work when user is offline? and how?
Appreciate if someone could clear my confusion with sample code. I have successfully run Google's sample code but not able to understand if I upload my app as free app how and when do I need to mention amount paid features?
Do I need to upload two different apk (FREE & paid) to play store .
This depends on the use case. If you want to give your users different app that has limited and Pro features that differs majorly then you should put two different apk's in market.
Otherwise , If your app has Free and Paid content you should include In-App purchases.
in this case will free app get replaced with paid app when user
purchases paid one ? How to achieve this.
No , Your app won't get replaced , you will only get payment successful/failed response from Google play , you have to save that information in your app shared preferences and manage your app flow accordingly.
If I give buy button in my free app which enabled purchase of paid
full version (extra features) then how does this purchase works?
Your application accesses the In-app Billing service using an API that is exposed by the Google Play app that is installed on the device. The Google Play app then conveys billing requests and responses between your application and the Google Play server. In practice, your application never directly communicates with the Google Play server for purchases. Instead, your application sends billing requests to the Google Play application over interprocess communication (IPC) and receives responses from the Google Play app. Your application does not manage any network connections between itself and the Google Play server.
If yes Will this kind of logic work when user is offline? and How.
To complete in-app purchase requests, the Google Play app must be able to access the Google Play server over the network. But after initiating a purchase request , you can save your payment response in shared preference for maintaining offline status.
Appreciate if someone could clear my confusion with sample code. I
have successfully run google's sample code but not able to understand
You should first start by reading the API docs Google Play In-app Billing and Selling In-app Products ,
if I upload my app as free app how and when do I need to mention
amount paid features ?
After that follow the steps to create In-App products on Google play account and run the API sample for those products.(There are plenty of tutorials online). Also you can take a look at official website for Establishing In-app Billing Products for Sale
Enjoy!

Change a Paid Android app to a Free app with in-app purchasing

I have a successful paid for application on Google Play Store and want to update this app to be a free application with in-app purchasing.
I have just completed developing the free version of the app which gives users restricted access which can then be unlocked using an in-app purchase system.
The issue i have is that all my existing users who have paid for the app will upgrade and then be prompted to pay again, which of course isn't right.
Is there any way to check the purchase history of the user, identify that they have paid for the app previously and unlock the extra features without the in-app purchase?
Thanks for any help.
Lewis
It's been a year, so the OP probably doesn't need this, but in case anyone else happens upon this one...
You could approach this a couple of ways. Obviously there is some business logic on your new in-app purchasing app to track who has/hasn't paid. So the two ways I see you being able to go about this is as follows:
Idea 1:
You could do a preliminary update to your paid app that stores a SharedPreference or some other persistence in the app (you could store the versionCode, so you know what you're upgrading from and have business logic around that). Then update to the free version, and have the free version check your shared preference and do the right thing on an update from a "paid" versionCode.
Idea 2:
You could keep both apps separate (have a paid version and a free with in-app purchases) and push an update to the paid version to have a BroadcastReceiver that doesn't really do anything other than listen to specific intents and have your in-app purchase check to see if something will receiver your custom intent. If your old paid-version exists, then they paid for it, if not they didn't. (If they paid for the paid version then uninstalled you'll have problems obviously...)
Idea 3:
You could keep both apps separate (have a paid version and a free with in-app purchases), and push an update to the paid version that just posts an Intent to open the in-app purchase app (if it's installed) with some special arguments, to let you know they opened it via a paid app and do the right thing to set them up as having paid for it in-app. That opens yourself up to some detection problems though... (Solvable but kind of clunky)
You can keep the existing paid version and create another free version.
If you really don't want to have 2 versions, just make it free and tell users something like 'Contact us if you have bought the paid version. We will give you redeem code to unlock xxx'.
https://developer.android.com/distribute/tools/launch-checklist.html#decide-price
This link seems relevant, hope it helps
On Google Play, you can publish apps as free to download or priced. Free apps can be downloaded by any Android user in Google Play. Paid apps can be downloaded only by users who are in a country that supports paid downloads and have registered a form of payment in Google Play, such as a credit card or Direct Carrier Billing.
Deciding whether you apps will be free or paid is important because, on Google Play, free apps must remain free.
Once you publish an app as a free app, you cannot change it to being a priced app. However, you can still sell in-app products and subscriptions through Google Play's In-app Billing service.
If you publish your app as a priced app, you can change it at any time to be a free app (but cannot then change it back to priced). You can also sell in-app products and subscriptions.
If your app is be priced, or if you'll be selling in-app products, you need to set up a Google payments merchant account before you can publish.
I feel the most easy way is to use theese line of codes
This gives you the old version code
SharedPreferences prefs = getSharedPreferences("Name_of_Prefs", MODE_PRIVATE);
int oldVersionCode = prefs.getInt("version_code", -1);
This gives you the current version code
int currentVersionCode = getPackageManager().getPackageInfo(getPackageName(),0).versionCode;
Now you can compare and do what you want. Don't forget to update after every time
with this line of code
prefs.edit().putInt(PREF_VERSION_CODE_KEY, currentVersionCode).commit();
In my case (affirmations counter app)
my paid app is running based on sharepreference value "lastaffirmationcount"
in my new iap app i just changed the way of I'm saving the affirmations counter values like "lastaffirmationscount_foriap"
So what i did in my free with In app purchase app is,just cross checked the "lastaffirmationcount" value is not null,if its null then it means new user,if not null then it means he is old user who bought the paid app
so the old user will not suffer forever
(Optionally Once its checked i immediately ask this user to sign in with google and saved his email as a premium user to ur database)
For Google Play there's no distinction between having paid for an app or downloading it for free. For example, if an user download an app while it's free and it's later changed to paid that user will still have full access to it, even being able to download it on other devices.
There are some lame workarounds for that:
Enable google play game services on the paid version and try to convince users to connect to it. Use google play services to store "bought while paid" information to the cloud and restore it whenever that user logins
Give all the users who've bought some key to unlock features
Create a different for the free version of the game
That said, keep in mind that many games have become free after some time. Maybe the users won't mind it that much.

In-App billing get if the user purchased the app before it was free

I want to be able to get the state of the user purchases but on the current app they are in from when it was paid to free.
For example App SuperCars was paid app but the latest update makes it free with in-app purchases. I want previous users who paid for the app to have access to paid content but new users to have no access in which they would need to pay.
Can anyone give me an example of how I would do this? How do I get the user paid sate??
After looking around and contacting certain people I've found out that it's not supported by Google, I'm disappointed at the developing Apps for Google Play, lots of features still missing.
Think about it, essentially you have launched a new product. Its not the same product, its a modified more useful product. Infact you should release this as a different product, different package, and check if your other product is also installed. If yes, provide the in app features free. Let both products coexist.
One more way is to update the older product (with a bug fix) that broadcasts its "paid" status. Then when you install the new app (free with inapp purchases) you can know that they have already paid for the app.
But if they have uninstalled the older app, then they have to install the older app to use it free.
So essentially you customers have 2 choices
Install the older product, pay for it. And install and use the 2nd product free.
Install the newer product and use in-app purchases.
DONT look for a way for google play to give you a status of a user's paid progress of a previous version of the app. Sorry, this looks like a crazy api to implement (even for google :)).

Distribute on Google Play to specific people

I would like to distribute the beta for my Android App to 10,000 specific people that signed up for the prerelease via the Play Store for free. Keeping in mind that the app will eventually be a paid application, is this specificity possible?
If your app has licensing enabled, you can add the people who should get it for free in a "whitelist" with their google play account , so that the app would appear as bought from the market. (i know it is possible but never did it... just google it)
After that you can distribute the apk through email (try http://thebetafamily.com/supersend/ )
and for the previously added accounts the licensing check will pass, and for other users the licensing check will fail if they did not bought the app from market.
This was just a suggestion, never had to do something like this , but thought this might help !
It's not possible. Google Play does not allow paid application to be given away for free (minimum price is ~$1).
You can do it other way:
Publish your application free
For premium features request some in-app payment
Implement in your application some piece of code to unlock premium features to specific users.
I have found a library for it: https://code.google.com/p/remoteunlockerlib/ But not sure if it works at this moment :)

Android application approval process in playstore

i am new to android development i created one android application and i want to test this application in all aspects before submiting to the play store. I don't know the play-store approval process. please let me know the play-store approval process and also tell me how to test my application without any bugs(that will be rejected by play-store) and against to playstore approval process.
There is not much of approval process in play store, certainly not much like apple used to do. You just need to make sure you read this and your app is okay on all points.
tell me how to test my application without any bugs
Well there is no short cut for that. Do your testing.. Google won't do it for you.. If your app is good, then only user downloads it.. It is not only Google that you have to consider..
There is no play store approval process. They run some automated tests for malware and you'll be on the market in a few hours. So just do enough testing that you feel happy with the quality.
You're responsible for testing your own app. Google won't. There are just a few basic rules you need to follow, and your app will be approved:
You can't sell in-app content unless you use Google's in-app purchasing. You CAN sell physical goods using other payment methods.
You can't make your app free and then change them to paid later. Once they're free, they're always free.
You can't do anything racist, criminal, hateful, etc... and you can't do anything you don't disclose -- i.e. steal the user's contacts and upload them to your own server for malicious purposes.
Be very attentive to testing. If your app has bugs, users will quickly complain and down-rate your app.
There is no "bug policy" for google play store. Even if your app contains bugs, google will still publish it. Develop your app keeping user in mind.

Categories

Resources