2

So i set up my environment for testing Android In-App billing.

  • My application Key is stored as a raw string to avoid any issue for now
  • My application has the BILLING permission
  • My application is published in Closed Beta
  • All my products (none are subscriptions) are tagged as ACTIVE
  • My Activity (the one which makes the call to Billing features) overrides onActivityResult
  • I use IABv3 to implement In-App Billing
  • I can successfully get the SkuDetails of my products.

The issue is upon a call to :bp.purchase(activity, productId); (ie starting a purchaseFlow), I get the following logs :


ActivityManager: START u0 {act=com.google.android.finsky.ACQUIRE dat=iabData:inapp:my.package:productId pkg=com.android.vending cmp=com.android.vending/com.google.android.finsky.billing.acquire.AcquireActivity (has extras)} from uid 10131 on display 0

D/com.android.server.am.ExtraActivityManagerService: MIUILOG- Permission Denied Activity : Intent { act=com.google.android.finsky.ACQUIRE dat=iabData:inapp:my.package:productId pkg=com.android.vending cmp=com.android.vending/com.google.android.finsky.billing.acquire.AcquireActivity (has extras) } pkg : com.android.vending uid : 10131 tuid : 10170


From what I see, everything works well until the PurchaseFlow starts (ie when the AcquireActivity Intent is launched). So the permisson is DENIED but I can't understand why or how to fix it as the only mandatory permission is BILLING and it is enabled.

Note : As IAB can only be tested through a real device, it may be an issue with MIUI but I don't own any other device so I can't test if this is the issue.

µTheory
  • 178
  • 10

2 Answers2

2

Just turn on the "Start in background" permission for "Google Play Store"

enter image description here

SDJSK
  • 1,292
  • 17
  • 24
1

After testing on another phone, thanks to a friend, it is indeed a MIUIrelated issue.

Porbably because the application s debuggable or not published at a production stage on the Google Play Store.

µTheory
  • 178
  • 10
  • Thanks for the answer. This was very hard to find. Redmi 4A, Android 7, MIUI 10.2.3. Main activity for app in `debug` version could not start to foreground from service. There was `MIUILOG- Permission Denied Activity` error in `logcat`. Rebuilding this app in `release` version fixed the problem. – Anton Samokat Nov 25 '22 at 23:36