Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Play App Signing and In App Billing Testing

I have Google Play App Signing enabled for my project, so google play is resigning my apk after upload. If i want to install my apk on the device via adb for testing in app billing, the apk has to be signed with the same key than the version in google play, but with Google Play App Signing enabled, this seems to be impossible. If i use the same apk i uploaded to google play, i get a "this version of the app is not configured for billing through google play" error when trying to purchase a product.

My question is: With Google Play App Signing enabled, how to test in app billing without upload all test versions to google play?

like image 228
Florian L. Avatar asked Jun 19 '17 21:06

Florian L.


People also ask

How do I test my Google Play billing library integration?

To test your Google Play Billing Library integration using test tracks, do the following: Publish your app to a test track . Note that after you publish an app to a testing track, it can take a few hours for the app to be available for testers.

How do I sign an app on Google Play?

When you use Play App Signing, you can either upload an existing app signing key or have Google generate one for you. Keep your app signing key secret, but you can share your app’s public certificate with others. Upload key The key you use to sign your app bundle before you upload it on Google Play.

What is Play app signing and is it safe?

When you use Play App Signing, your keys are stored on the same secure infrastructure that Google uses to store its own keys. Keys are protected by Google’s Key Management Service. If you want to learn more about Google’s infrastructure, read the Google Cloud Security Whitepaper. Android apps are signed with a private key.

How do I configure license testers for in-app billing?

To configure license testers, see Test in-app billing with application licensing. Using license testers provide the following benefits: Ordinarily, the Google Play Billing Library is blocked for apps that aren't signed and uploaded to Google Play.


3 Answers

Only licensed testers can bypass the need for matching signatures. See https://developer.android.com/google/play/billing/test

License testers can bypass this check, meaning you can sideload apps for testing, even for apps using debug builds with debug signatures without the need to upload to the new version of your app.

To fully test in app purchases with actual charges, the APK must be published to the play store in any of the test channels.

like image 122
Ty_H Avatar answered Sep 22 '22 13:09

Ty_H


I was looking for the same thing. But didn't want to link another app like your answer. So here is what I did:

Even though I already added my email to the testers list, I visited the opt-in link to register my email as tester. Apparently that's also something that has to be done.

After that I downloaded the alpha app from the Play Store (link is also in opt-in page). I then tried to run it from Android Studio (signed with the upload key. I haven't checked if debug key is enough). This gives the invalid signature warning and will reinstall the app. But when the app is installed you can now test the in-app purchases.

like image 32
Kevin van Mierlo Avatar answered Sep 25 '22 13:09

Kevin van Mierlo


For those who are looking for a alpha testing the "Game Services", I guess, I found the solution (or a workaround).

Go to the play console (https://play.google.com/apps/publish) > Game Services > Linked Apps.

Here click on "Link Another App" and choose the same app while adding. At the end when you are authorizing this app, change the SHA-1 key to your apps debug key.

How to find the SHA-1 key in android studio? Go to "Gradle" tab > app > Tasks > android > double click on "signingReport".

Hope this helps. :)

like image 45
Hemendra Sharma Avatar answered Sep 21 '22 13:09

Hemendra Sharma