in-app-billing

What is the response for RESTORE_TRANSACTIONS in case of subscription bought twice?

最后都变了- 提交于 2019-12-12 05:40:04
问题 I can't test this myself, because there is no way to completely terminate subscription, apparently. So, I want to test the following use case: user buys subscription, cancel's it (or it expires), than user buys same subscription. What will I get with RESTORE_TRANSACTIONS response? Will I get two items with same item id, different purchase tokens and different state? Or purchaseToken will remain the same? I'm afraid that there will be only one subscription with different order ID and purchase

In-app billing verification. Does server side code example exist somewhere?

戏子无情 提交于 2019-12-12 03:43:16
问题 A lot of people ask how to write server side code for in-app billing verificartion. Can anybody publish such code? Or know where such code is. How to install in on the server? There are similar subjects I could not understand it. I don't know php. Is it the next nightmare which I must study? Thanks for help and advices. 回答1: Actually it's pretty easy, you just need a small function like this in PHP: function checkPayment($data, $signature) { $base64EncodedPublicKey = "yourBase64PublicKey";

Google Play In-app billing V3 - Error - Authentication is Required

大憨熊 提交于 2019-12-12 03:18:55
问题 I have looked at other similar questions on SO regarding the same issue and all point to the same point. To check the ID of the product. I am implementing in-app purchases for the first time and i think i am using the correct product id in the code. I am following TrivialDrive sample. So, the error is as follows: My product id from Google Play: My code is as follows: package com.xx.xxx; import android.content.Intent; import android.os.Bundle; import android.support.v7.app.AppCompatActivity;

Testing non-consumable IAP items in Google Play

自闭症网瘾萝莉.ら 提交于 2019-12-12 02:33:45
问题 I'm using Google Play IABv3 and want to be able to easily test what I do (not surprisingly). Since IABv3 all items are managed and it's up to the application to consume the items that it considers consumables. I'm not sure what the expected work flow is with testing non-consumable products. To be able to test the purchase flow more than once you need to be able to remove the previous purchase. However, the purchase is intended to be non-consumable so we obviously don't want to add any code

In-app purchases are lost after uninstall on “managed” purchase type

三世轮回 提交于 2019-12-12 01:48:57
问题 I have read other threads here and they say that In-app purchases are stored as long as "managed" purchase type is chosen when in-app billing is set up. Managed means that when the app is reinstalled, it can ask the in-app billing service which items this particular user has already purchased. I have set up "managed" purchase type in all my apps with In-app billing. The purchases are still lost when the apps are uninstalled and then installed again. I tested with a test account as a alpha

Why do I get null from retrieving the user's gmail?

寵の児 提交于 2019-12-12 01:07:21
问题 With the following code that retrieves the user's Google account, gmail, I was wondering why I get null from devices like mine (that of course runs on my gmail), whereas it works on my mom's devices: public class MainActivity extends AppCompatActivity { final String TAG = "Sample2"; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); String test = getEmail(getApplicationContext()); Log.d(TAG, "Email is: " +

Consume purchase for In-app billing does not work on Android 6

走远了吗. 提交于 2019-12-12 00:42:13
问题 I am testing as an alpha tester. The code that I am using is the latest "Trivial drive" classes from Google and IAP5. I can consume my purchase on an older device that has an older version than Android 6. I test exactly the same code on a device with Android 6 and I get the error below. Why does this happen?Here is my code and error message: http://www.mobile-visuals.com/mess.txt I have to post my code and error message in this link, because Stackoverflow kept saying that it was not properly

In-app billing save the item with SharedPreferences

杀马特。学长 韩版系。学妹 提交于 2019-12-11 21:24:11
问题 I'm writing an application for android and I have difficulties with saving int variable with SharedPreferences when using In-App billing. I'd like to add 50 points to my int variable and then save it with SharedPreferences. When the purchase is finished the user got nothing, but it said Payment Succesfull.How should I add and save the 50 points? Here is my code: private static final String HINT = "Hint"; private static final String VALUE = "VALUE"; int hints; private static final String TAG =

Working with Google in-app billing?

独自空忆成欢 提交于 2019-12-11 19:06:03
问题 I'm trying to use Google in app billing in my app. My code dose not have any error in eclipse but when I run it on my phone it force closes! and log cat points error to "new Thread" line. what is the problem? I'll be thankful if someone could help. Here is my code: in onCreate under donate button: @Override public void onClick(View v) { new Thread(new Runnable() { public void run() { ArrayList<String> skuList = new ArrayList<String>(); skuList.add("My Selling Obj ID"); Bundle querySkus = new

how to implement Android In App BillingClient in Xamarin.Android Asynchronously

故事扮演 提交于 2019-12-11 18:47:14
问题 I am trying to implement below java code in c# referring to Android documentation List<String> skuList = new ArrayList<> (); skuList.add("premium_upgrade"); skuList.add("gas"); SkuDetailsParams.Builder params = SkuDetailsParams.newBuilder(); params.setSkusList(skuList).setType(SkuType.INAPP); billingClient.querySkuDetailsAsync(params.build(), new SkuDetailsResponseListener() { @Override public void onSkuDetailsResponse(BillingResult billingResult, List<SkuDetails> skuDetailsList) { // Process