Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android in-app purchases: do you need to check for the com.android.vending.BILLING permission when targeting Android 6?

When implementing in-app billing, or IAB, the docs say you have to add this to your manifest:

<uses-permission android:name="com.android.vending.BILLING" />

As of Android 6, apps are expected to check at runtime if users have granted permissions that don't belong to the 'normal' permissions category. Note that, as at API level 23, com.android.vending.BILLING isn't listed anywhere under this category. So...

  1. If it isn't normal, does that mean it's dangerous?
  2. Do I need to check for permission before using IAB?
  3. If I do, how? I can't find any examples of IAB integrated with the new Android 6 permissions model. There doesn't appear to be any permission related to billing under Manifest.permission for example.
like image 729
snark Avatar asked Oct 25 '15 17:10

snark


People also ask

What is Android vending billing permission?

It is the permission required for integration of Billing in your android application.

What is Android in-app purchases?

With some apps, you can buy additional content or services within the app. We call these "in-app purchases." Here are some examples of in-app purchases: A sword that gives you more power in a game.

What is directory Android vending?

android. vending is the package name for the Google Play Store app on your Android devices. The "Process com. android. vending has stopped unexpectedly" error message is a common one, but it can usually be fixed by restarting the Android phone or clearing Google Play Store data.

How do I give in-app billing permission to my Android app?

If your application does not declare the In-app Billing permission, but attempts to send billing requests, Google Play will refuse the requests and respond with an error. To give your app the necessary permission, add this line in your Android.xml manifest file: <uses-permission android:name="com.android.vending.BILLING" />

Is acknowledgement required when using Google Play billing library?

Note: Acknowledgement is not required when using a version of the Google Play Billing Library prior to 2.0. The process to grant entitlement and acknowledge the purchase depends on whether the purchase is a non-consumable, a consumable, or a subscription.

Why can’t I buy books on the Kindle app for Android?

“To remain in compliance with updated Google Play Store policies, the option to buy or rent Kindle books or subscribe to Kindle Unlimited will no longer be available in the Kindle app for Android with the release of app version 8.58,” read an excerpt of an email sent to users of the Kindle app for Android.

How do I start a purchase request from my App?

To start a purchase request from your app, call the launchBillingFlow () method from your app's main thread. This method takes a reference to a BillingFlowParams object that contains the relevant SkuDetails object obtained from calling querySkuDetailsAsync () .


1 Answers

You can't find com.android.vending.BILLING permission in the list of normal or dangerous permissions of Android 6.0 because it isn't a system permission.

It is declared by the package com.android.vending (a.k.a. Google Play Store). You can find it in his AndroidManifest.xml:

<permission
    android:name="com.android.vending.BILLING"
    android:description="@string/perm_billing_desc"
    android:label="@string/perm_billing_label"
    android:permissionGroup="android.permission-group.NETWORK"
    android:protectionLevel="normal"/>

You don't need to check the permission at runtime because it is necessary only to the system permissions.

You can find more information about application declared permission here: http://developer.android.com/guide/topics/manifest/permission-element.html

like image 147
Mattia Maestrini Avatar answered Nov 05 '22 17:11

Mattia Maestrini