libgdx / gdx-pay

A libGDX cross-platform API for InApp purchasing.
Apache License 2.0
225 stars 83 forks source link

Strange crashes on Google Developer Console #111

Closed centy closed 7 years ago

centy commented 8 years ago

I am receiving some strange crashes.

java.lang.SecurityException: Requires READ_PHONE_STATE: Neither user 10098 nor current process has android.permission.READ_PHONE_STATE. at android.os.Parcel.readException(Parcel.java:1546) at android.os.Parcel.readException(Parcel.java:1499) at com.android.vending.billing.IInAppBillingService$Stub$Proxy.getSkuDetails(IInAppBillingService.java:251) at org.onepf.oms.appstore.googleUtils.IabHelper.querySkuDetails(IabHelper.java:998) at org.onepf.oms.appstore.googleUtils.IabHelper.queryInventory(IabHelper.java:586) at org.onepf.oms.OpenIabHelper.queryInventory(OpenIabHelper.java:1399) at org.onepf.oms.OpenIabHelper$17.run(OpenIabHelper.java:1451) at java.lang.Thread.run(Thread.java:818)

I am using gdx-pay v0.9.2, unfortunatelly I am not sure how to reproduce that issue.

noblemaster commented 7 years ago

Did you add the "READ_PHONE_STATE" permission to the AndroidManifest.xml?

Also note, the Open IAB backend is deprecated (because buggy). I suggest switch to the Google Play backend.

keesvandieren commented 7 years ago

Use gdx-pay-android-googleplay instead.

centy commented 7 years ago

I need SUBSCRIPTION which is not supported by gdx-pay-android-googleplay

czw., 8.09.2016 o 14:27 użytkownik Kees van Dieren notifications@github.com napisał:

Use gdx-pay-android-googleplay instead.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/libgdx/gdx-pay/issues/111#issuecomment-245581334, or mute the thread https://github.com/notifications/unsubscribe-auth/AAjgUuTvE9LcoXy6mPYNSZlZIbBkuQIiks5qn_9NgaJpZM4JRj0C .

keesvandieren commented 7 years ago

Aha. I understand. We are sorry, but I cannot help you debugging the openiab implementation (actually did that for my own app without succes, resulting in spending 2 weeks in writing gdx-pay-android-googleplay :) ).

If you have time to create a pull request for subscriptions in gdx-pay-android-googleplay, that would be really great. I am happy to help you with that.

centy commented 7 years ago

Hi, It looks like I have to add this support for subscriptions, we have a lot of crashes on old engine. Can you guide me how to start?

keesvandieren commented 7 years ago

That is great!

Below a brief introduction that helps to get started.

Technologies and methodologies

The project is maintained using Android Studio, I never tried Eclipse so I am not sure if it is easy to extend with Eclipse.

The unit-tests are created in a Behaviour-driven development style. So each unit-test method describes an expected output for a given event. This discussion might be useful to understand the difference between TDD and BDD: http://softwareengineering.stackexchange.com/questions/135218/what-is-the-difference-between-writing-test-cases-for-bdd-and-tdd

Global Design

The class PurchaseSystem is used as entry point from the app implementing in-app purchasing.

The PurchaseSystem class calls the PurchaseManager implementation currently used, for Android this is AndroidGooglePlayPurchaseManager.

AndroidGooglePlayPurchaseManager interacts with Google Play services In-App-Billing via the class V3GoogleInAppBillingService, which interacts with the weak-typed error-prone Google-Play Services.

Google has a useful page about subscriptions worth reading: https://developer.android.com/google/play/billing/billing_subscriptions.html

Does this info help you? If you really plan to start doing it, lets open a new github issue Add subscription support to gdx-pay-android-googleplay.

Best regards,

Kees

keesvandieren commented 7 years ago

@centy have you read my previous comment with instructions to get started? Not mentioned you in that post, just need to be sure you got notified.

centy commented 7 years ago

Yes. Thanks W dniu sob., 12.11.2016 o 11:08 Kees van Dieren notifications@github.com napisał(a):

@centy https://github.com/centy have you read my previous comment with instructions to get started? Not mentioned you in that post, just need to be sure you got notified.

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/libgdx/gdx-pay/issues/111#issuecomment-260113355, or mute the thread https://github.com/notifications/unsubscribe-auth/AAjgUhIE2WUx2ljOJqQBoFTnCPpzZRJIks5q9ZAegaJpZM4JRj0C .

centy commented 7 years ago

Pull request was submited here: https://github.com/libgdx/gdx-pay/pull/133