Skip to content

Instantly share code, notes, and snippets.

@marco-piccolino
Last active December 6, 2022 06:06
Show Gist options
  • Save marco-piccolino/13ff3392a531087eed2b831107791268 to your computer and use it in GitHub Desktop.
Save marco-piccolino/13ff3392a531087eed2b831107791268 to your computer and use it in GitHub Desktop.
@marco-piccolino
Copy link
Author

marco-piccolino commented Dec 12, 2017

In-app purchases

Overview

https://doc.qt.io/qt-5/qtpurchasing-index.html
http://blog.qt.io/blog/2014/04/02/qt-purchasing-api-1-0-technology-preview-released/

Notes

  • Use the same product identifiers both on Apple App Store and Google Play
  • Once you remove a product you cannot re-use the same identifier (at least on Google Play)

Platforms

Google Play (Android)

Overview

https://developer.android.com/google/play/billing/index.html
https://developer.android.com/training/in-app-billing/index.html
https://developer.android.com/google/play/billing/billing_reference.html
https://developer.android.com/google/play/billing/billing_admin.html

Versions

https://developer.android.com/google/play/billing/versions.html

Availability & Fees

https://support.google.com/googleplay/android-developer/answer/1153481

Subscriptions

https://developer.android.com/google/play/billing/billing_subscriptions.html
http://support.google.com/googleplay/android-developer/bin/answer.py?hl=en&answer=140504

"When the subscription payment is approved, Google Play provides a purchase token back to the purchasing app through the In-app Billing API. Your apps can store the token locally or pass it to your backend servers, which can then use it to validate or cancel the subscription remotely using the Google Play Developer API."

"The getPurchases() method does not return failed or expired subscriptions."

"Recommendation: Include business logic in your app to notify your backend servers of subscription purchases, tokens, and any billing errors that may occur. Your backend servers can use the server-side API to query and update your records and follow up with customers directly, if needed."

"Users can view the status of all of their subscriptions and cancel them if necessary from the My Apps screen in the Play Store app. Currently, the In-app Billing API does not provide support for programmatically canceling subscriptions from inside the purchasing app."

Google Wallet

https://support.google.com/wallet/answer/6285485?hl=en&ref_topic=6285481

Qt for Android

https://doc.qt.io/qt-5/qtpurchasing-googleplay.html

Notes

  • Make sure <uses-permission android:name="com.android.vending.BILLING"/> is present, either added automatically by Qt or manually by you if Qt didn't
  • You need to upload an apk to Google Play before you can create products and publish the app (not release, alpha). After that you can also use a development build, provided the bundle id is the same.
  • If you want to test the payments without being charged you need to add one or more test user emails in Google Play Console's account options
  • You will need a Google Wallet associated to the Google Play account
  • There is an isBillingSupported method in the Android API to check for country

Apple App Store (iOS)

Overview

https://developer.apple.com/in-app-purchase/
https://developer.apple.com/app-store/freemium-business-model/
https://developer.apple.com/library/content/technotes/tn2259/_index.html
https://developer.apple.com/library/content/technotes/tn2413/_index.html

Subscriptions

https://developer.apple.com/app-store/subscriptions/
https://itunespartner.apple.com/en/apps/faq/In-App%20Purchases_Auto-Renewable%20Subscriptions
https://developer.apple.com/videos/play/wwdc2016-301/?time=717
https://developer.apple.com/videos/play/wwdc2017/814/
https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/StoreKitGuide/Chapters/Subscriptions.html

"Subscribers who were acquired outside of your app can read or play content through the app. However, you may not provide external links in your app that allow users to purchase subscriptions outside of the app."

"You can set the prices you think are suitable for subscribers in different markets"

"Apps using the auto-renewable subscription model can keep active subscribers at their existing price while increasing the price for new users."

Concept of subscription groups (mutually exclusive subscription levels).

Receipts

https://developer.apple.com/library/content/releasenotes/General/ValidateAppStoreReceipt/Introduction.html

Testing

Test users: http://help.apple.com/itunes-connect/developer/#/dev8b997bee1

Review

Submit in-app purchase to review: http://help.apple.com/itunes-connect/developer/#/dev1986a0e5c

Apple Pay?

https://developer.apple.com/support/apple-pay-sandbox/

Qt for iOS

https://doc.qt.io/qt-5/qtpurchasing-appstore.html

Notes

  • Make sure you accept the "Paid apps agreement" in iTunes Connect by also providing bank and tax information
  • You need to upload an ipa
  • Make sure you add (even fake) pictures to the products in iTunes Connect, otherwise it will complain about missing metadata
  • You can create a sandbox Apple test user in iTunes Connect to test purchases without actually buying (make sure you log out of App Store in the device's Settings so that you can login with the fake account when requested)
  • You can also use a development build to test, provided you use the same bundle id and the appropriate development provisioning profile

Qt APIs

QML

https://doc.qt.io/qt-5/qtpurchasing-gettingstarted-qml.html

C++

https://doc.qt.io/qt-5/qtpurchasing-gettingstarted-cpp.html

Examples

https://doc.qt.io/qt-5/qtpurchasing-qthangman-example.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment