onepf / OpenIAB

Open In-App Billing for Google Play, SlideMe, Amazon Store, Nokia Store, Samsung Apps, Yandex.Store, Appland, Aptoide, AppMall and Fortumo.
http://onepf.org/openiab/
Apache License 2.0
476 stars 171 forks source link

No suitable appstore was found (SlideME) #440

Closed koljanich closed 9 years ago

koljanich commented 9 years ago

I use SlideME In-App-Payments in Unity (4.6.1f1), OpenIAB v.0.9.8.3. Use Init string when press a button for by item in Unity: var options = new Options(); options.storeKeys.Add(OpenIAB_Android.STORE_SLIDEME,KEY); OpenIAB.init(options); OpenIAB.purchaseProduct(SKU);

And nothing to happen. In Eclipse Debug Error Messages: 01-23 12:57:50.983: E/OpenIAB(18366): Illegal state for operation (launchPurchaseFlow): IAB helper setup is in progress. 01-23 12:57:50.985: E/OpenIAB-UnityPlugin(18366): Error purchasing: IabResult: 3, Cannot start purchase process. Billing unavailable. (response: 3:Billing Unavailable) 01-23 12:57:51.936: E/OpenIAB-UnityPlugin(18366): Problem setting up in-app billing: IabResult: 3, No suitable appstore was found (response: 3:Billing Unavailable)

koljanich commented 9 years ago

I'll try all options: installer; best fit; installer then best fit.

RomanZhilich commented 9 years ago

Apparently you're not handling BillingSupported event. Please check out Unity sample here.

I'm not really into Unity, maybe @GrimReio can help you more.

koljanich commented 9 years ago

Thanks a lot. But i try Unity sample - not work. The same error. But I try https://yadi.sk/d/OpmK8PIydJnzL - and it's work with GooglePlay, but SlideME not supported, and YandexStore has same error. But I need a YandexStore and SlideME.

RomanZhilich commented 9 years ago

Please check your VerifyMode. By default library skips Open Stores without verification key. I saw in your config that you're added one for SlideME, but skipped Yandex. Also try using setSupportedStoresNames() to specify only ones your interested in.

As a last resort, try reinstalling stores on your device, sometimes it helps. But please note that you must install your application after the store. It's necessary to request custom permissions.

koljanich commented 9 years ago

Thank you for the quick response. I'll try to reinstal shops and my application and nothing to work. I'm just going crazy. I downloaded your project "OpenIAB Sample Game", introduced the keys, build... and got the same error! What could be the problem?

Error Log: 01-23 21:44:09.527: E/OpenIAB-UnityPlugin(18247): Error purchasing: IabResult: 3, Cannot start purchase process. Billing unavailable. (response: 3:Billing Unavailable)

Fri, 23 Jan 2015 07:31:09 -0800 от Roman Zhilich notifications@github.com:

Please check your VerifyMode. By default library skips Open Stores without verification key. I saw in your config that you're added one for SlideME, but skipped Yandex. Also try using setSupportedStoresNames() to specify only ones your interested in. As a last resort, try reinstalling stores on your device, sometimes it helps. But please note that you must install your application after the store. It's necessary to request custom permissions. — Reply to this email directly or view it on GitHub .

Best regards, Nikolay

koljanich commented 9 years ago

When I put my yandex public key in the official OpenIAB example v0.9.8.3, then in the initialization I saw the following line before "Billing unavailable": 01-24 11:05:50.255: E/Volley(14686): [1572] ac.a: Unexpected response code 404 for https://mobile.store.yandex.net/api/v3/billing/open_iab_available?package_name=... Maybe problem with yandex store page? How it change? Code: var publicKey = "...Here mykey...";

    var options = new Options();
    options.checkInventoryTimeoutMs = Options.INVENTORY_CHECK_TIMEOUT_MS * 2;
    options.discoveryTimeoutMs = Options.DISCOVER_TIMEOUT_MS * 2;
    options.checkInventory = false;
    options.verifyMode = OptionsVerifyMode.VERIFY_SKIP;
    options.prefferedStoreNames = new string[] { OpenIAB_Android.STORE_YANDEX };
    options.availableStoreNames = new string[] { OpenIAB_Android.STORE_YANDEX };
    options.storeKeys = new Dictionary<string, string> { {OpenIAB_Android.STORE_YANDEX, publicKey} };
    options.storeSearchStrategy = SearchStrategy.INSTALLER_THEN_BEST_FIT;

    // Transmit options and start the service
    OpenIAB.init(options);

Full Error Log from push Init button: 01-24 11:53:26.413: E/NativeCrypto(26149): ssl=0x50fa91d8 cert_verify_callback x509_store_ctx=0x52f29ae8 arg=0x0 01-24 11:53:26.414: E/NativeCrypto(26149): ssl=0x50fa91d8 cert_verify_callback calling verifyCertificateChain authMethod=RSA 01-24 11:53:27.509: E/NativeCrypto(25663): ssl=0x50fa91d8 cert_verify_callback x509_store_ctx=0x53149ae8 arg=0x0 01-24 11:53:27.510: E/NativeCrypto(25663): ssl=0x50fa91d8 cert_verify_callback calling verifyCertificateChain authMethod=ECDHE_RSA 01-24 11:53:27.901: E/Volley(25663): [2691] ac.a: Unexpected response code 404 for https://mobile.store.yandex.net/api/v3/billing/open_iab_available?package_name=... 01-24 11:53:27.918: E/OpenIAB-UnityPlugin(25117): Problem setting up in-app billing: IabResult: 3, No suitable appstore was found (response: 3:Billing Unavailable)

Init GooglePlay works OK, but I don't have a developer account : options.prefferedStoreNames = new string[] { OpenIAB_Android.STORE_GOOGLE }; options.availableStoreNames = new string[] { OpenIAB_Android.STORE_GOOGLE }; options.storeKeys = new Dictionary<string, string> { {OpenIAB_Android.STORE_GOOGLE, publicKey} };

RomanZhilich commented 9 years ago

01-24 11:53:27.901: E/Volley(25663): [2691] ac.a: Unexpected response code 404 for https://mobile.store.yandex.net/api/v3/billing/open_iab_available?package_name=...

Seems indeed like Yanex Store problem. Library checks if Yandex supports billing via isBillingAvailable() call. and apparently it fails. Yandex Store guys intended to check application package in this call, but I'm not sure if they already implemented this behavior. Have you tried uploading test version of your application to Yandex Store?

@akarimova Do you know anything about this problem?

koljanich commented 9 years ago

Yes, I download a test version of my application, generate key and ID of each "Coin" for billing. One more question - if I use STORE_SLIDEME and it's public key, the error on the Yandex service:

01-24 17:18:58.353: E/OpenIAB(25204): getOpenAppstore() verification is required but publicKey is not provided: ComponentInfo{com.yandex.store/com.yandex.store.service.YandexStoreService} 01-24 17:18:59.453: E/OpenIAB-UnityPlugin(25204): Problem setting up in-app billing: IabResult: 3, No suitable appstore was found (response: 3:Billing Unavailable) 01-24 17:19:01.278: E/dalvikvm(26347): Could not find class 'android.app.AppOpsManager', referenced from method com.google.android.gms.common.util.e.a

The Yandex store and SlideMe is the same?

And when i use both keys: var options = new Options(); options.checkInventoryTimeoutMs = Options.INVENTORY_CHECK_TIMEOUT_MS * 2; options.discoveryTimeoutMs = Options.DISCOVER_TIMEOUT_MS * 2; options.checkInventory = false; options.verifyMode = OptionsVerifyMode.VERIFY_SKIP; options.prefferedStoreNames = new string[] { OpenIAB_Android.STORE_YANDEX,OpenIAB_Android.STORE_SLIDEME }; options.availableStoreNames = new string[] { OpenIAB_Android.STORE_YANDEX,OpenIAB_Android.STORE_SLIDEME }; options.storeKeys.Add(OpenIAB_Android.STORE_SLIDEME, "Store SlideMe Key"); options.storeKeys.Add(OpenIAB_Android.STORE_YANDEX, "Store Yandex Key"); options.storeSearchStrategy = SearchStrategy.INSTALLER_THEN_BEST_FIT; OpenIAB.init(options); Error: 01-24 17:25:16.955: E/Volley(29293): [6178] ac.a: Unexpected response code 404 for https://mobile.store.yandex.net/api/v3/billing/open_iab_available?package_name=... 01-24 17:25:17.810: E/OpenIAB-UnityPlugin(28336): Problem setting up in-app billing: IabResult: 3, No suitable appstore was found (response: 3:Billing Unavailable) 01-24 17:25:18.275: E/Trace(29540): error opening trace file: No such file or directory (2)

RomanZhilich commented 9 years ago

if I use STORE_SLIDEME

You mean using setAvailableStoreNames()?

The Yandex store and SlideMe is the same?

Their both Open Stores so they're very similar.

koljanich commented 9 years ago

I mean: var options = new Options(); options.checkInventoryTimeoutMs = Options.INVENTORY_CHECK_TIMEOUT_MS * 2; options.discoveryTimeoutMs = Options.DISCOVER_TIMEOUT_MS * 2; options.checkInventory = false; options.verifyMode = OptionsVerifyMode.VERIFY_SKIP; options.prefferedStoreNames = new string[] {OpenIAB_Android.STORE_SLIDEME }; options.availableStoreNames = new string[] { OpenIAB_Android.STORE_SLIDEME }; options.storeKeys.Add(OpenIAB_Android.STORE_SLIDEME, "Store SlideMe Key"); options.storeSearchStrategy = SearchStrategy.INSTALLER_THEN_BEST_FIT; OpenIAB.init(options);

And The Error is: getOpenAppstore() verification is required but publicKey is not provided: ComponentInfo{com.yandex.store/com.yandex.store.service.YandexStoreService

Where the relationship SlideMe with YandexStoreService?

RomanZhilich commented 9 years ago

Well, that is strange. I'll have to investigate.

RomanZhilich commented 9 years ago

Sorry for taking so long.

Regarding 'publickKey is not provided' with Yandex - It's actually fine. During setup, library discovers all Open Stores available on device, and checks provided configuration to see it they're usable or not. And only after that it filters result according to provided names. This is actually an architectural flaw, as there's no way to find out Open Store name unless you connect to it. I understand that this log message might be somewhat misleading, and we'll think about removing it in future. But there's nothing wrong with the fact that this message was shown.

What is strange, is that in your config you ignore purchase verification:

options.verifyMode = OptionsVerifyMode.VERIFY_SKIP;

With that option, this message should never occur. So, either you've listed wrong options set, or there's bug with Unity Plugin handling this option. Also, bug might be in library itself, but I checked it and everything seems fine.

Now about your 'No suitable appstore was found' issue. I'm pretty sure the problem is with you not being logged in with either of this stores. Their current implementation of isBillingAvailable() returns false, if user is not logged in. There's nothing that can be done in library to work around this at the moment.

Hope that helps.

koljanich commented 9 years ago

Thanks for the answer. I delete options.verifyMode = OptionsVerifyMode.VERIFY_SKIP; from source. And errors change: 01-26 19:36:35.029: E/OpenIAB(12354): getOpenAppstore() verification is required but publicKey is not provided: ComponentInfo{com.slideme.sam.manager/com.slideme.sam.manager.inapp.openiab.OpenIabStoreService} 01-26 19:36:35.057: E/[YandexAccountManager].f: Error while querying version 01-26 19:36:35.057: E/[YandexAccountManager].f: java.lang.SecurityException: Permission Denial: reading com.yandex.auth.store.AccountProvider uri content://com.yandex.auth.store/lib from pid=12354, uid=10038 requires com.yandex.permission.READ_CREDENTIALS, or grantUriPermission() 01-26 19:36:35.057: E/[YandexAccountManager].f: at android.content.ContentProvider$Transport.enforceReadPermission(ContentProvider.java:332) 01-26 19:36:35.057: E/[YandexAccountManager].f: at android.content.ContentProvider$Transport.query(ContentProvider.java:188) 01-26 19:36:35.057: E/[YandexAccountManager].f: at android.content.ContentResolver.query(ContentResolver.java:371) 01-26 19:36:35.057: E/[YandexAccountManager].f: at android.content.ContentResolver.query(ContentResolver.java:314) 01-26 19:36:35.057: E/[YandexAccountManager].f: at com.yandex.auth.sync.database.f.b(SourceFile:57) 01-26 19:36:35.057: E/[YandexAccountManager].f: at com.yandex.auth.sync.h.a(SourceFile:51) 01-26 19:36:35.057: E/[YandexAccountManager].f: at com.yandex.auth.sync.h.a(SourceFile:72) 01-26 19:36:35.057: E/[YandexAccountManager].f: at com.yandex.auth.m.a(SourceFile:18) 01-26 19:36:35.057: E/[YandexAccountManager].f: at com.yandex.auth.YandexAccountManager.from(SourceFile:12) 01-26 19:36:35.057: E/[YandexAccountManager].f: at me.f(SourceFile:114) 01-26 19:36:35.057: E/[YandexAccountManager].f: at me.e(SourceFile:109) 01-26 19:36:35.057: E/[YandexAccountManager].f: at me.j(SourceFile:244) 01-26 19:36:35.057: E/[YandexAccountManager].f: at us.a(SourceFile:136) 01-26 19:36:35.057: E/[YandexAccountManager].f: at us.a(SourceFile:55) 01-26 19:36:35.057: E/[YandexAccountManager].f: at com.yandex.store.service.YandexStoreService$4.isBillingAvailable(SourceFile:274) 01-26 19:36:35.057: E/[YandexAccountManager].f: at org.onepf.oms.IOpenAppstore$Stub.onTransact(SourceFile:74) 01-26 19:36:35.057: E/[YandexAccountManager].f: at android.os.Binder.execTransact(Binder.java:367) 01-26 19:36:35.057: E/[YandexAccountManager].f: at dalvik.system.NativeStart.run(Native Method) 01-26 19:36:35.073: E/OpenIAB-UnityPlugin(12354): Problem setting up in-app billing: IabResult: 3, No suitable appstore was found (response: 3:Billing Unavailable)

But I register a new accounts (not developer) in both appstores. How can ...(No suitable appstore was found)? About isBillingAvailable() - I just do Init function and get "No suitable appstore was found". This return "billingNotSupportedEvent(string error)" event in my code.

RomanZhilich commented 9 years ago

I delete options.verifyMode = OptionsVerifyMode.VERIFY_SKIP

By default, verifyMode is set to VERIFY_EVERYTHING. So you do need this option to use Open Store without public key.

It's really strange if it doesn't work. @GrimReio Can you please verify that this option is handled correctly by Unity Plugin.

Meanwhile, try following:

koljanich commented 9 years ago

When I login to SlideMe, and change config (options.addAvailableStoreNames(NAME_SLIDEME) do not accepted by compiler, i use just "options.availableStoreNames"=new...): var options = new Options(); options.verifyMode = OptionsVerifyMode.VERIFY_SKIP; options.availableStoreNames = new string[] { OpenIAB_Android.STORE_SLIDEME}; options.storeKeys.Add(OpenIAB_Android.STORE_SLIDEME," My Key"); OpenIAB.init(options); Error is very simply: 01-26 20:45:49.269: E/Trace(4720): error opening trace file: No such file or directory (2) 01-26 20:45:50.101: E/OpenIAB-UnityPlugin(4635): Problem setting up in-app billing: IabResult: 3, No suitable appstore was found (response: 3:Billing Unavailable) 01-26 20:45:51.910: E/NativeCrypto(4461): ssl=0x5181a4f0 cert_verify_callback x509_store_ctx=0x52eb0ae8 arg=0x0 01-26 20:45:51.911: E/NativeCrypto(4461): ssl=0x5181a4f0 cert_verify_callback calling verifyCertificateChain authMethod=RSA

akarimova commented 9 years ago

To obtain more logs, please call void enableDebugLogging(bool enabled); or void enableDebugLogging(bool enabled, string tag); of OpenIAB

koljanich commented 9 years ago

I enable Info+Eror in Eclipse and I get: 01-26 21:06:21.135: I/System.out(8851): httpget:https://api.slideme.org/services/rest/service_mobileiap/list.json?app_nid=.......My app....&udid=004f107df3a5fba9d7dd2d568f296687&product_id=&sam_version=6.23&locale=ru_RU&api_version=3&partner=global 01-26 21:06:21.136: I/System.out(8851): https://api.slideme.org/services/rest/service_mobileiap/list.json?app_nid=....MyApp......&udid=004f107df3a5fba9d7dd2d568f296687&product_id=&sam_version=6.23&locale=ru_RU&api_version=3&partner=global 01-26 21:06:21.138: I/System.out(8851): [CDS]rx timeout:1 01-26 21:06:21.138: I/System.out(8851): [CDS]rx timeout:1 01-26 21:06:21.143: I/System.out(8851): [CDS]rx timeout:15000 01-26 21:06:21.143: I/System.out(8851): [CDS]rx timeout:15000 01-26 21:06:21.144: I/System.out(8851): [CDS]close[43943] 01-26 21:06:21.145: I/System.out(8851): close [socket][/0.0.0.0:43943] 01-26 21:06:21.147: I/System.out(8851): propertyValue:true 01-26 21:06:21.148: I/System.out(8851): [socket][8] connection /216.246.6.157:443;LocalPort=44069(15000) 01-26 21:06:21.148: I/System.out(8851): [CDS]connect[/216.246.6.157:443] tm:15 01-26 21:06:21.174: I/WifiStateMachine(352): fetchRssiAndLinkSpeedNative, newRssi=-51 01-26 21:06:21.435: I/System.out(8851): [socket][/192.168.1.102:44069] connected 01-26 21:06:21.435: I/System.out(8851): [CDS]rx timeout:15000 01-26 21:06:21.724: I/SurfaceFlinger(102): [SurfaceFlinger] frames:24, duration:1.043000, fps:22.996626 01-26 21:06:21.757: I/System.out(8851): >doSendRequest 01-26 21:06:21.758: I/System.out(8851): <doSendRequest 01-26 21:06:22.166: E/OpenIAB-UnityPlugin(7995): Problem setting up in-app billing: IabResult: 3, No suitable appstore was found (response: 3:Billing Unavailable)

I was confused timeouts. Maybe that's the problem?

Do not understand void enableDebugLogging(bool enabled); If this a declaration - where is the body of function? If call - "void"?

RomanZhilich commented 9 years ago

I was confused timeouts. Maybe that's the problem?

I really doubt it.

I enable Info+Eror in Eclipse and I get:

This only enables you too see logs, but what @akarimova meant was to enable logging option in library. By default it doesn't print em to keep output clean.

koljanich commented 9 years ago

void enableDebugLogging(bool enabled); Where to insert? If this a declaration - where is the body of function? If call - "void"?

RomanZhilich commented 9 years ago

I'm not 100% sure with Unity, but I think it should be something like:

OpenIAB.enableDebugLogging(true);

Somewhere before OpenIAB.init()

koljanich commented 9 years ago

100% True! It's work. How add big log? txt,zip not support blog...

RomanZhilich commented 9 years ago

Well you can try to set up filter (by tag, or application - you better google how to do that) and paste here only relevant part.

RomanZhilich commented 9 years ago

There's almost no relevant information here. I still can't tell what's wrong. Either SlideME, for some reason, is not found by the library or its isBillingAvailable() returns false.

Try using all the options from one of my previous responses, but also add options.storeSearchStrategy = SearchStrategy.BEST_FIT; this time.

koljanich commented 9 years ago

Maybe the problem is localization? I'm on the Russian forums read that the new version did not manage to run. They use old.

RomanZhilich commented 9 years ago

Sorry for deleting your logs, they didn't contain anything new while making this issue almost impossible to navigate.

As for localization.. I've tried this with out test app (from Russian IP) with last version of SlideME store - everything worked fine.

Maybe you should try only Yandex for now, to try to get at least something working and make sure there's not something fundamentally wrong with your device or setup.

koljanich commented 9 years ago

From Yandex the log much bidgger, and I don't print it: "your comment is too long (maximum is 262144 characters). Please try again". And init shop doesn't work too. Only GooglePlay work, but i do not have an account, and can not list $ 25 for registration, because the banks in our country do not work, there is a war. Anyway thanks for your help and your time

RomanZhilich commented 9 years ago

This issue becomes quite cumbersome, maybe it'll be easier do discuss it in chat? We could try https://gitter.im/onepf/OpenIAB or you can email me your Skype account name.