How to integrate InApp Purchase in Android - android

I want to use inapp purchase in my application.FOR inapp I have seen so many tutorial and I have get demo project for that.,but the problem is that when I am clicking in google developer console, it's asking for payment and I only want its public key without payment, I don't want to publish my application on googleplay. two things I want to do
how to create my public key for InAPP Purchase api.
from where I can get my key for inapp?/
I have seen this links
here
&
here
and here is the image snippest

I suppose the best tutorials are those of developer.android.com. So first read this:
http://developer.android.com/google/play/billing/billing_overview.html
You definitely want to add this:
<uses-permission android:name="com.android.vending.BILLING"/>
to your manifest so that you can later add your keys on the developer console

Actually you can not test Google InApp purchases without publishing application on play-store whether it is in Alpha Testing Mode.
In your case if you really need to test InApp purchases in your application then below are the steps to do so:
Sign-up on Google Play Console (Paid Once)
Complete your merchant account (Required for InApp)
Get billing-key (Go to Setting->API Access) from play developer console
Use this key into your application to purchase something from
play-store (Follow these steps)
Create application on Play Console and Fill all store listing data
for same application
Create in-app purchases products on console
Generate signed application and publish it to alpha
Add some testing users for demo testing of your application
After final testing publish it to production for all users
Thanks

Related

How to test IAB without being charged

I am trying to testIn App Purshase without being charged on Unity by reading this https://developer.android.com/google/play/billing/billing_testing.html
My application is published as an Alpha version, signed with a real key. I downloaded it with an other Google account that the one I used to publish the app. This account is both added in the testers list of Google Play Service and my app Alpha testers list.
The problem is, when I want to buy an item, I never see the word "test" as the documentation says.
Can someone explain to me which extra steps shall I do in order to be sure to test my In App Billing without being charged?
Thanks a lot.
A new version of Google Play Console was released the 17th April, and I think that the french version of the Google Play Console was not completely implemented.
Right now the section "Test de licence" is available.
Follow the Testing In-app Purchases:
Setting up test purchases
It’s easy to set up test purchases—any user account can be chosen to
be a test account, and any user of a test account can make test
purchases with any available payment method (even though there’s no
charge to the payment method).
First, upload and publish in-app products that you want testers to be
able to purchase. You can upload and publish in-app products in the
Developer Console. Note that you can upload and publish your in-app
items before you publish the APK itself.
Next, create license test accounts for authorized users. In the
Developer Console, go to Settings > Account details, then in the
License Testing section, add the addresses to Gmail accounts with
testing access field. For more information, see Setting Up for Test
Purchases.
Once you’ve added the users as license tester accounts and saved the
change, within 15 minutes those users can begin making test purchases
of your in-app products.

Android "The publisher cannot purchase the item"

I'm not testing my in app purchase !
I have download my app from google play store and I still can't buy any of my In App purchase within the application.
I have the following error : "The publisher cannot purchase the item".
All my In App purchase are also valid and active.
I'm using the same google account than in my google play developer console.
I have read on google that it's normal that developer can't buy it's own items in testing mode (alpha or beta) but here i'm using the official version and I still can't do it !! (It's my first android application)
What did I do wrong ?
Thanks,
if you have the same account configured on the device (the one which you are using for developer console) make sure it is removed. Google Play will allow switching between all google accounts added on device. Also, before removing try switching directly in google play first to an account that is not your developer account and then do the purchase. If that doesn't work you'll probably need to remove the developer account for the device if you want to make a purchase fro your own app.

Implement InApp Purchase in an existng project of Android?

I am working on a android project where I received an enhancement from client to add in App Purchase to add certain points in the game. So the player can increase his life by using in app purchase. I have checked the sample app provided by google and also configured inApp purchase same as it was doing. Now I want to do it from my live account so that live account can be used for testing and in live app.
Please provide links and steps by which I can get the details which I need to set in my application such as AppID etc.
Thanks in Advance.
Add your email id to the testers account on google developer console.
Add the iap products in google developer console.
Sign the build with live keystore.
Do inapp. (Make sure that the prompt that comes up says This is a test account bla bla)

Is their any need merchant account for In app purchase in android

I want to use In app purchase in android. I have a developer account for android play store. But I just want to ask is their any necessary of merchant account details to test android In app purchase functionality.
If no then please guide me how I can test In App using test account.
You will not see an option to create and manage In App products for your app until you have setup your Merchant Account. Due to this, you must have one to test and deploy apps using in app purchases.

How can I test in-app-billing with a non-published app?

I have an Android app that uses In-App-Billing to sell Account Managed Items.
I tested the app with the static response IDs and everything seems to work. I now want to test the app with real product Ids.
I created the app in the Google Play Store and uploaded a draft version of the app with the correct permissions. I now created an In-App-Billing item and published the item.
At the moment the app is unpublished. The item is created and published and I have a test account that is registered in the profile of the developer account and is the only account on the device that I use for testing. The app is signed with the same key as the uploaded draft. Edit:I'm testing with Android 4.1 && 4.03 at the moment
If I try to buy the item the Google Play Store pops up but shows a dialog with the following method: The item you requested is not available for purchase.
How can I test buying the item without publishing the app?
When you test the app, make sure you have exported and correctly signed it (not using debug key). Also make sure that you are using the correct Google account (registered test account) on the device.
Additionally, the registered test account cannot be the developer account.
Apart from this, it should work fine.
Note: Testing your own in-app purchases does require a valid credit card and actual payment.
And finally, it currently takes a few hours for market edits to propagate through the servers and show up.
It may take some time to reflect the changes on google play if you just uploaded the app and added the item there wait for some time near about 2 hr. it will be shown the item you want to purchase.
For others who reach this thread, Now it's not possible to test In-app billing with just a draft version of the app.
Draft Apps are No Longer Supported
Previously, you could publish a "draft" version of your app for testing. This functionality is no longer supported. Instead, there are two ways you can test how a pre-release app functions on the Google Play store:
You can publish an app to the alpha or beta distribution channels. This makes the app available on the Google Play store, but only to the testers you put on a "whitelist".
In a few cases, you can test Google Play functionality with an unpublished app. For example, you can test an unpublished app's in-app billing support by using static responses, special reserved product IDs that always return a specific result (like "purchased" or "refunded").
for details read https://developer.android.com/google/play/billing/billing_testing.html#billing-testing-test
You can test in-app billing by using options, look at this
Edit :
On the link I mentionned, you can see this :
Note: You do not need to publish your application to do end-to-end
testing. You only need to upload your application as a draft
application to perform end-to-end testing.
If you still can not test it, what you can do is to publish it and test it. If you think there might be bugs in your app's in-app billing, refunds are still a solution.
I'm thinking about something, on the dev site, you can see this :
Verify that your device is running a supported version of the Google
Play application or the MyApps application.
On what Android version are you testing on ?
You've to add the products(item sku) in you app product in your play store app account. The SKU you set In-App billine is not available. For testing, set the SKU androidtestpayment. Now you'll now get that error The item you requested is not available for purchase.

Categories

Resources