4

Here's my implementation:

private IabHelper mIabHelper;
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mIabHelper = new IabHelper(this, GOOGLE_BASE64_KEY);
    mIabHelper.startSetup(this);
}

@Override
public void onIabSetupFinished(IabResult result) {
    if (result.isSuccess()){
        mIabHelper.queryInventoryAsync(true, this);
    } else {
        Log.e("test","onIabSetupFinished-result:"+result.getMessage());
    }
}

Then I got this:

08-09 21:44:00.859 5839-5839/? D/IabHelper: IAB helper created.
08-09 21:44:00.859 5839-5839/? D/IabHelper: Starting in-app billing setup.
08-09 21:44:00.923 5839-5839/? D/IabHelper: Billing service connected.
08-09 21:44:00.925 5839-5839/? D/IabHelper: Checking for in-app billing 3 support.
08-09 21:44:00.934 17057-17069/? I/Finsky: [430] com.google.android.finsky.billing.iab.z.b(44): ...: Account from first account - [...]
08-09 21:44:00.937 17057-17069/? W/Finsky: [430] com.google.android.finsky.billing.iab.z.a(64): Package name ... does not match UID 99089
08-09 21:44:00.938 5839-5839/? E/test: onIabSetupFinished-result:Error checking for billing v3 support. (response: 5:Developer Error)
Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Marcus
  • 6,701
  • 4
  • 19
  • 28
  • 1
    The answer is still No as of now, but you can look for updates at: https://developer.android.com/google/play/billing/billing_library_releases_notes.html and https://developer.android.com/topic/instant-apps/release-notes.html – ManmeetP Nov 03 '17 at 04:45

3 Answers3

4

Google Play Billing is not yet supported with Instant Apps, but we are working on it.

Chris Cartland
  • 3,058
  • 2
  • 17
  • 14
0

With reference to Android Instant Apps policy, android Instant Apps developers must use the Google Payment API if those purchases are not supported by Google Play In-app Billing and the developer does not have the user’s payment information on file. Developers must collect any new or replacement payment information for a user using the Google Payment API.

Developers that have implemented the Google Payment API in their instant app can also offer purely offline payments, like cash on delivery, or store gift cards in their instant app.

more update for Play Billing Library

Prags
  • 2,457
  • 2
  • 21
  • 38
0

As of this writing, 10/12/19, I found I could do in app purchases from the 'instant' version of my own game app. I could find absolutely nothing online or in the docs on this specifically so I just had to experiment myself.

When you do an in app purchase from your own app in the installation version, it does it as a 'test purchase' and doesn't actually charge you. Google Play didn't have payment info on me until I started purchasing items from my instant version. Unfortunately you are not recognized as the developer in the instant version of your own app, at least I wasn't, so it asks for payment info and actually charges you. This is irritating as it interferes with my stats and introduces questions like whether I should refund myself from the developer console or let google keep their cut (would refund requests look bad?).

I found in app purchases from the installation and instant versions appear to be kept separate. Queries yield different results from each version. I was hoping instant purchases would carry over to the installation version. My installation version isn't free, whether or not that makes a difference. I'm doing further testing on this, but if it won't carry over I'll have to remove in app instant app purchasing to not disappoint players who later install the full app.

Getting rid of test purchases is notoriously difficult, by the way. Even when you uninstall your app, go offline, and reinstall it from android studio, an inventory query will find your past purchases as it stores it on your device. Even clearing the caches of the Play Store and the app itself doesn't get rid of it. You have to have a secret button or the like on your release version to 'consume' test purchases with the appropriate code.

Androidcoder
  • 4,389
  • 5
  • 35
  • 50