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

Authentication required for google #452

Open dpa456 opened 9 years ago

dpa456 commented 9 years ago

Hey Hi,

i using OpenIAB i see checking "Authentication required" OpenIAB issue and i'm waitting google but.. same like it. i don't have confident, and i think... this is wrong my code.

Please Checking my Code.

void Start(){ OpenIAB.mapSku(SKU,OpenIAB_Android.STORE_GOOGLE,"InApp01"); OpenIAB.mapSku(SKU, STORE_ONEPF, "InApp01"); string publicKey = "my public key code"; //MIAKSDL2@$@:Dasldas... Options 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_GOOGLE }; options.availableStoreNames = new string[] { OpenIAB_Android.STORE_GOOGLE }; options.storeKeys = new Dictionary<string, string> { {OpenIAB_Android.STORE_GOOGLE, publicKey} }; options.storeSearchStrategy = SearchStrategy.INSTALLER_THEN_BEST_FIT; // Transmit options and start the service OpenIAB.init(options); }

void GameInApp(){ OpenIAB.queryInventory(); OpenIAB.purchaseProduct("InApp01"); //OpenIAB.unbindService(); }

This is finshed my code. "GameInApp" Code is Load a 'GameInApp' when pushed inapp button Thank you see that.

GrimReio commented 9 years ago

Hello,

If i understood you correctly, you get response from the store "Authentication required". In that way you simply need to log in to your Google Play account.

But this function is wrong.

void GameInApp(){
OpenIAB.queryInventory();
OpenIAB.purchaseProduct("InApp01");
//OpenIAB.unbindService();
}

You need to let user purchase only when inventory is queried. Somewhere in the query inventory callback.

dpa456 commented 9 years ago

dear Grim Reio.

beg pardon, What do i?

Can you help me? I don't understand OpenIAB purchased code.

Thank you. 2015/02/16

GrimReio commented 9 years ago

Please try to log in to your Google Play account and run something like this sample.

dpa456 commented 9 years ago

Dear GrimReio

Oh.. I saw that sample code when i first start OpenIAB.

but.. I don't know this do that

i using this code.

OpenIAB.queryInventory(new string[] { SKU }); OpenIAB.purchaseProduct(SKU); OpenIAB.consumeProduct(_inventory.GetPurchase(SKU));

but this code show me "Authentication required for google"

Oh.. maybe i must having testing code? OpenIAB.purchaseProduct("android.test.purchased"); OpenIAB.consumeProduct(_inventory.GetPurchase("android.test.purchased")); I didn't Release. so i using testing code?

Ok.. What mean's "android.test.purchased"? this mean : SKU? or not? android.test.purchased? and What this mean Purchase, Consume in OpenIAB

Purchase -> Purchasing Consume -> Purchased Out? this mean right?

Thank you. 2015/02/16

GrimReio commented 9 years ago

"android.test.purchased" is a test SKU for Google Play. "Authentication required for google" is a response from the Google Play. So library works fine. There is some problem with your registration, credentials, developer account, etc. Please take a look here.

akarimova commented 9 years ago

Hi everyone. Google Play play returns billing is supported for an app only if a user is logged in. Probably, the suggest is shown only due to suspicious activity on your device.

akarimova commented 9 years ago

@dpa456 About the code

void Start(){ OpenIAB.mapSku(SKU,OpenIAB_Android.STORE_GOOGLE,"InApp01"); - OK OpenIAB.mapSku(SKU, STORE_ONEPF, "InApp01"); - what is STORE_ONEPF in your app? string publicKey = "my public key code"; //MIAKSDL2@$@:Dasldas... - OK Options options = new Options(); - OK options.checkInventoryTimeoutMs = Options.INVENTORY_CHECK_TIMEOUT_MS * 2; - could be removed options.discoveryTimeoutMs = Options.DISCOVER_TIMEOUT_MS * 2; - could be removed options.checkInventory = false; - could be removed, false is by default options.verifyMode = OptionsVerifyMode.VERIFY_SKIP; - VERIFY_EVERYTHING, you have a key and you pass it options.prefferedStoreNames = new string[] { OpenIAB_Android.STORE_GOOGLE }; - OK options.availableStoreNames = new string[] { OpenIAB_Android.STORE_GOOGLE }; - OK options.storeKeys = new Dictionary { {OpenIAB_Android.STORE_GOOGLE, publicKey} }; - OK options.storeSearchStrategy = SearchStrategy.INSTALLER_THEN_BEST_FIT; - OK // Transmit options and start the service OpenIAB.init(options); - OK }

akarimova commented 9 years ago

OpenIAB.queryInventory(); - ok, but do you handle the result in a calllback? OpenIAB.purchaseProduct("InApp01"); - pass SKU, not the real value of it

If you're querying inventory, wait for the result callback. Probably, you need to consume. Probably, your sku is already bought and the inventory contains it.

dpa456 commented 9 years ago

Hi. Dear akarimova

Thank you for replay

but i don't want to queryInventory. i want purchase item. in test

so.. i wait delay for google play when i updating my app apk. but show me Authentication required for google login yet OpenIAB.mapSku(SKU, STORE_ONEPF, "InApp01"); "InApp01" this is my google play Inapp name one of the name/ID. this SKU mean -> my google play Inapp ID code.

if i will want to purchased, Do i launch in google play store?

i don't have Launch app. but i have upload apk file in google play development store. i want to testing purchase. don't do that launch

Thank you 2015/02/17

dpa456 commented 9 years ago

Dear GrimReio

Thank you, i'm looking for this page.

um.. i'm trying to this way. but my phone always show me "authentication required for google login"

thank's 2015/02/17

akarimova commented 9 years ago

@dpa456 did you try to log in? could you please share your screenshot with the dialog? what version of Android is used, is it Google Android or AOSP with additional pack of services?

dpa456 commented 9 years ago

Dear Anastasiia Karimova

yes i try to log in. but don't do that.

Dialog is

Error Authentication required for google login

i using android 9 version.

and i used google play & google admob. (google play - leaderboard & Achievment)

google play service package. i'm trying to google login at google play

i think.. i wrong using source code.

i using purchased but i don't launch app.am i using test purchased? so.. what code testing code for purchased?

thank you 2015/02/17

dpa456 commented 9 years ago

Dear Anastasiia Karimova

I'm using test code. penIAB.purchaseProduct("android.test.purchased");

yes.. this is very work well. (0.99$ credit)

but still yet penIAB.purchaseProduct(SKU); this code is not work.

being i wrong? that i know mean SKU i mean SKU =>google play In app ID code "sku" this mean => google play In app Name code

No?or not?

but right that i mean, Perhaps.. cause i didn't have launch my app for google play?

thank you. 2015/02/18

akarimova commented 9 years ago

Unfortunately, we don't understand 80% of your explanation in English.

openIAB.purchaseProduct("android.test.purchased");

As far as I understand, this code is OK, it works.

openIAB.purchaseProduct(SKU);

What exactly is going on? 1) no callback at all 2) bad answer 3) error 4) crash ?

dpa456 commented 9 years ago

Dear Anastasiia Karimova

sorry, my bad english.

yes, first i don't understand SKU and "sku" what this mean?

i use SKU,-> "my google inapp ID code" use "sku" -> "my google inapp Name code"

and Second i use OpenIAB.purchaseProduct(SKU);

this exactly error.

Authentication required for google login.

i wait when uploading a my apk file. but not do work.

thank you 2015/02/19

MaxEden commented 9 years ago

OpenIAB.mapSku(SKU, OpenIAB_Android.STORE_GOOGLE, Android_sku); SKU - abstract name of product, call it however you want Android_sku - IAP id http://i.imgur.com/tdwuwE5.png Don't forget to activate it

dpa456 commented 9 years ago

Dear MaxEden

Thank you, you're answer.

yes, i know sku now.

but.. this is a error..

Authentication required for google login.

umm.. need i launch app? or not?

thank you. 2015/02/22

akarimova commented 9 years ago

umm.. need i launch app? or not?

akarimova@onepf.org please send me your apk