I have a general question about android and debug in-app purchase.
I have developed my application and I am stuck to test the purchase of my product.
If I launch the application on my phone from Android Studio I have an error, something like there is no product. I think my application is not identified/accepted by the Play store.
If I create a release and install the application from the play store I can purchase the product but I do not know if it's working. My application react like if it's ok but I can't check it. I use a test account consequently I do not pay and I do not see the purchase in my account. Is there somewhere we should see the tests purchases ?
Finally, now if I try to launch the application on the phone from Android Studio, Android Studio tell me the sign key is different and I need to uninstall the application first.
I think my problem is there, I should be able to have the same sign keys this way I can test/use the play store from android studio directly ( and have the debug mode ...).
I have configured the build process with the same configuration that in "Build -> Generated signed bundle" but it's not working.
Is there something like Google sign the app with a specific key to authorized it to access to the play store ?
How should we debug the process of purchase in the play store ?
Related
I've setup Firebase App Distribution on our projects with the provided "App Tester" android app which is amazing. Although I identified one major issue that I know a lot of people using this tool are experiencing and from what I saw, nobody actually knows the reason behind it.
The issue is : I download my app from the Play Store. Then I deploy a new version of my App on Firebase App Distribution to test it, go to App Tester, click on my app and click on install. I get the error "Installation failed" with no more details. To resolve the issue, I must uninstall the app from my phone and click install again to have a successful install.
The reason behind this is that Android does not allow a signed APK to be updated by another APK signed with a different key.
The APK that I download from the Play Store is signed by my CI but then it is signed again by the Play Store with their signing feature (can enable/disable it I know but I prefer to keep it enabled). The key used by Play Store to sign again my APK is private and nobody can access it.
But the APK that I upload on Firebase App Distribution with Fastlane is signed by my CI, not Play Store. So the key is different and that's why App Tester fails installing the app.
Can't I tell Firebase to do the same process of resigning my APK with the key used by the Play Store ? It is really annoying to uninstall my app whenever I previously installed it from the Play Store. More importantly, it's annoying for the testers at my company that don't understand why they get this error and don't know what to do...
Question: The application that you share with your testers using app distribution, does it have the same app Id (eg. com.xyz.abc) as the one on playstore?
There cannot be two signed applications with same app id on a single device.
One of the solutions will be to update the development app id to be different than production app id.
Eg.
Production app id - com.xyz.abc
Development app id - com.xyz.abc-dev
This will also enable both apps to co-exist on the same device.
I'm attempting to get https://github.com/j3k0/cordova-plugin-purchase working for Cordova/PhoneGap and I'm getting an "Invalid" error when I try to retrieve the product info.
I don't know what I'm doing wrong, but here is what I have done:
The plug-in is installed with the proper billing API key in platforms\android\res\values\billing_key.xml
The store.ready() event does fire without errors, so I know I'm at least connecting.
I've uploaded a signed APK to Beta and published it.
I created an in-app purchase and confirmed it is active.
I confirmed I'm calling the right product ID within the code by hard-coding the ID.
I get callbacks from store.when("product").updated(fnProcessProduct), but the product.state is always store.INVALID
Is there something I'm missing, either within Google Play, PhoneGap, deploying, or the plug-in?
Got the answer - once you upload an APK to Google Play as beta and activate your IAP product, you must test using APKs signed with the same key. I was using Ionic, and Ionic was signing with a debug key.
More info: https://github.com/j3k0/cordova-plugin-purchase/issues/75
I set up test users so that I can test that in-app billing works, but I am a bit confused by the process.
I am following the android developer billing test guide here: http://developer.android.com/guide/google/play/billing/billing_testing.html
It has a few confusing points. It says not to publish your app, but somehow I need to get the app on my phone. So how can I get an un-published app on my phone?
Also, am I supposed to make an area on the app with the 4 product ids that google reserves and try to buy those, and then once I see it works, just get rid of those buttons to buy those test products? Is that how this is meant to be done?
Thanks!!
It says not to publish your app, but somehow I need to get the app on
my phone. So how can I get an un-published app on my phone?
There's no need to publish your app to get it installed. Create a signed build (See http://developer.android.com/tools/publishing/app-signing.html). Then install it on your phone using adb install <apk name> The SAME build you must upload to your playstore dashboard. After uploading, you will see 2 options:
PUBLISH
SAVE
Click on 'SAVE'. After saving your uploaded app, you will be able to add InApp products for that app. You MUST save and publish your inapp products in order to test them.
You should upload the apk to your developer account and fill in the mandatory fields and save it without publishing it and then you can create in-app products for the application and publish it. please note that the in-app products must be published before testing billing. But you don't require to publish the application to test billing.
Try the MoVend library for Android. it supports google play in-app billing, paypal and many more.
http://www.movend.com/
How to sign an android apk file
To install it you can use adb or you can send this file by mail. Then download in the device and install it.
Check that Settings > Applications > Unknown sources is checked in the Device.
If you are having problems implementing in-app purchase I recommend you the library AndroidBillingLibrary.
When I implement InAppBilling, the Following screen appears.. I used this link
http://blog.blundell-apps.com/simple-inapp-billing-payment/
for implementing InAppBilling
so where am I wrong?
Most likely you are using a version of the app that is signed with your debug key or you are trying to purchase using your developer account which is not allowed.
You should also have uploaded an apk to Play store that has the billing permissions (although you do not need to publish it)
You need to sign your apk with your release key. Trying to purchase in debug mode will not work.
See this link for full testing instructions.
http://developer.android.com/guide/google/play/billing/billing_testing.html
May be you are running this app from eclipse directly.
Whenever you are using In-App purchase in your app.
Export signed APK then try out this...
I uploaded my signed app to the android market, I made some in app contents that I've published (but not the app).
Now I trying to purchase my own products on a real device: do I need to test with the same signed .apk I uploaded to the market? Or a "normal" one I can launch with Eclipse?
Cause when I launch my app with Eclipse and send a requestPurchase(), a pop up tells me that this app version is not ready for market purchase...
You do not need to publish your application to perform end-to-end testing with real product IDs; you only need to upload your application as a draft application. However, you must sign your application with your release key before you upload it as a draft application. Also, the version number of the uploaded application must match the version number of the application you load to your device for testing.
And as it's write on google's doc, the version number of the app on the market and of the app on the device are the same :/
You need to use a signed APK, the same one you uploaded to the app market.
You also need to use a different gmail account to your developer account to access the market.
There's a good tutorial here: Simple In App Billing with some alternative explanations
The testing developer guide is pretty thorough: Testing Billing Statically
You just need to sign the apk (in Eclipse : Android Tools -> Export Signed Application Package...) and reinstall it on the device (with the device attached to USB : adb install _YOUR_APK_).
There's also a way to test your app on the emulator with your own products before going to the real money : android test billing library.
This library is the In-App billing implementation for the emulator, which was tested in the application Horer horaires de RER.