Repository navigation
Use Donations
Donations let your users support you with in-app purchases, from inside your app. This is optional.
In the Google Play Console, create one in-app product for each donation option, for example a small, a medium and a large donation. Write down each Product ID.
Billing is on in the sample. Check these two things:
-
In
MainActivity.kt,billingEnabledistrue:override val billingEnabled = true
-
In
app/src/main/AndroidManifest.xml, this line is there and isn't commented out:<uses-permission android:name="com.android.vending.BILLING" />
Donations need your app's license key, even if you don't use the license checker. See Change Security Settings.
Open app/src/main/res/values/dashboard_setup.xml and add each Product ID as an item:
<string-array name="donation_items">
<item>small_donation</item>
<item>medium_donation</item>
<item>large_donation</item>
</string-array>The IDs must match the ones in the Play Console exactly.
Note
In-app purchases only work for builds installed from Google Play. Upload your app to a testing track (internal testing is the quickest) to try them.
- Set
billingEnabledtofalseinMainActivity.kt. - Delete the
BILLINGpermission line fromAndroidManifest.xml. - Leave
donation_itemsempty.
Note
Would you like to help improve this wiki?
It is advised that you contribute to jahirfiquitiva/dashboards-wikis, which is the repository that holds the contents of this wiki. Please open an issue or a pull request in that repo instead.
Wiki by Jahir Fiquitiva, with contributions from Patryk Goworowski, Lumiq Creative and Jackson Hayes. Special thanks to Sanchith Hegde.
Licensed under the Creative Commons Attribution-ShareAlike 4.0 International License.