Android Question In app Promotion Codes

tsteward

Well-Known Member
Licensed User
Longtime User
Google now offersIn-App promo codes.
My app uses annual subscription and I'd like to use promo codes to offer rewards to some clients.

Does In app billing support this or any examples how I might accomplish this.

Thank you
 

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
I should just give it a try hey.
that what me thought too.
My reading suggested the app had to have something setup.
- You need to setup the promocodes in Google Console

Support promo codes in your app
To support promotion codes, your app must call the queryPurchases() method whenever the app starts or resumes. This method returns a bundle of all current, unconsumed purchases, including purchases the user made by redeeming a promo code. The simplest approach is to call queryPurchases() in your activity's onResume() method, since that callback fires when the activity is created, as well as when the activity is unpaused. Calling queryPurchases() in onStart() and onResume() guarantees that your app finds out about all purchases and redemptions the user may have made while the app wasn't running. Furthermore, if a user makes a purchase while the app is running and your app misses it for any reason, your app still finds out about the purchase the next time the activity resumes and calls queryPurchases().

Your Activity's onPurchasesUpdated() method receives a response intent identifying when a purchase is completed. However, your app should still call queryPurchases() in onStart() and onResume(), in the case the purchase and consumption workflow didn't complete. For example, if the user successfully redeems a promo code and then your app crashes before the item is consumed, your app still receives information about the purchase when the app calls queryPurchases() on its next startup.

Your app should also support the scenario where a user redeems a promo code in the Play Store app while the app is running. Your app can find out about the redemption through the onPurchasesUpdated() listener.

As written i do not use InApp Purchases but i expect that getting the owned products is available in in app billing already.
You should query the purchases on each app start and in activity_resume.

As a fazit i would think that creating a Promotion and generating Codes for this Promotion should be an easy task.

Use the Google Play Console to assign promo codes for your one-time products. To create a promo code for a one-time product, refer to Create promotions.

Step 3: Set up a promotion in the Play Console
  1. Go to your Play Console.
  2. Select an app.
  3. Select User acquisition > Promotions > Add new promotion.
  4. Review and agree to the Terms of Use.
  5. Follow the on-screen instructions to name your promotion, set up start and end dates, select your promotion type, and enter the number of promo codes you want to create.
  6. To turn the promotion on during the start and end dates you entered, set the status to On.
  7. Select Create.
  8. Wait several seconds and select the download link.
Your codes will download to a CSV file. To share with users, you can print the codes or send a deep link allowing users to redeem the codes via email or a notification within your app.

To redeem a Code

- You can give the user a Choice to use a Promocode. Let the user enter a Code (remember google need to know this code.)
- Send the User to https://play.google.com/store?code=ABCDEFG where ABCDEFG is the Code entered by the User.

You can use an Intent (user must open it with a Browser, not with GooglePlay App)
B4X:
    Dim i As Intent
    i.Initialize("android.intent.action.VIEW","https://play.google.com/store?code=ABCDEFG")
    StartActivity(i)
Alternatively the user can use the GooglePlay App to manually enter the code there.
With my tryings the above Intent only works with a Browser.
 
Upvote 0

tsteward

Well-Known Member
Licensed User
Longtime User
Okay looks like I'm barking up the wrong tree.

As my app uses annual subscriptionsI can not use Promo Codes :(

Anyone know how I can give away subscriptions to people I choose???
 
Upvote 0

tsteward

Well-Known Member
Licensed User
Longtime User
I though promo codes was my answer. I would like to reward some users for thier feedback or giveaway subscriptions as a promotion but Promo codes wont do this, its only for in app purchases note subscritions.

Open to any suggestions though.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
The user who enter a promo code creates a purchase which you got when checking the owned products. Right?
Can you (your app) recognize the promocode based purchase and just react the same as it was a subscription? Means; your app wil allow 3 months of use or so...

It´s just a thought as i never used IN APP Billings..
 
Upvote 0

tsteward

Well-Known Member
Licensed User
Longtime User
I would have to put some sort of datestamp on the users device and ignore/step over the subscription checks until desired time was up I guess.
So long as I encrypt this data should work.
Will think on this.....
 
Upvote 0

aeric

Expert
Licensed User
Longtime User
How can you allow certain users access?
In your app, create a Reward button/menu. When user tap on it, it opens up a new activity. This activity has an edit text where the user required to enter either their email or code that you send to them. Then when they submit, your app verify whether he/she eligible for the reward. If yes then open another activity that show the button to subscribe for the subscription with free trial period. This subscription product is different with the usual subscription which does not offer free trial.
 
Upvote 0
Top