Reputation: 671
I am integrating ads in my android app, but a thought came up, do I need to create a free and paid app, one with ads and locked features whilst another one with unlocked features, and I also need help on a tutorial to add in app purchases, all tutorials I keep finding advise me to first upload my app to google play, is that the only way? how do i fix bugs if I begin by uploading my app?
Upvotes: 0
Views: 119
Reputation: 644
This is the IAB (In-App Billing) solution. You'd need to tweak and set it up but the functionality is clear. source
function Awake()
{
SetupAds();
}
function SetupAds()
{
if(PlayerPrefs.HasKey("AdFree"))
return;
// Setup your ads here
}
function RemoveAds()
{
if (PlayerPrefs.HasKey("AdFree"))
print("Ads already removed");
else{
PlayerPrefs.SetInt("AdFree", 1);
PlayerPrefs.Save();
// destroy/disable all your ad objects here
}
}
function RestorePurchases()
{
if (IsProductPurchased("ProductId"))
RemoveAds();
}
Upvotes: 2
Reputation: 3238
You can not use same application as both free and paid but you can differentiate by IN APP:
Here is another blog post explaining In App Purchase:Link
Upvotes: 2