monotouch - Android InAppBilling using Xamarin.InappBilling -



monotouch - Android InAppBilling using Xamarin.InappBilling -

i'm trying implement inappbilling in android-app i'm developing using xamarin.inappbilling. problem i'm having when seek phone call connection's billing handler homecoming list of available products doesn't homecoming anything. i'm wondering if there have messed in simple illustration or because need configure developeraccount able test it? also, when write empty string key connection should be, still able connect google play. normal? help much appreciated!

namespace testinapp { [activity (label = "testinapp", mainlauncher = true)] public class activity1 : activity { button button; ilist<product> _products; private inappbillingserviceconnection _serviceconnection; protected override void oncreate (bundle bundle) { base.oncreate (bundle); console.writeline ("program starts"); // set our view "main" layout resource setcontentview (resource.layout.main); _products = new list<product> (); startsetup (); } public void startsetup() { // create new connection google play service _serviceconnection = new inappbillingserviceconnection (this, string.empty); _serviceconnection.onconnected += async () => { console.writeline("connected googleplay"); await getinventory (); }; _serviceconnection.connect (); } async task getinventory() { console.writeline ("starting find available products"); _products = await _serviceconnection.billinghandler.queryinventoryasync (new list<string>{ "produkt1", "produkt2" }, itemtype.product); console.writeline ("finished finding available products"); if (_products == null) { console.writeline ("no products available"); return; } else console.writeline ("products available"); foreach (var p in _products) { console.writeline (p.tostring()); } } }

}

there things setup before testing own product (in de google play dev account). can test special test products before:

_products = await _serviceconnection.billinghandler.queryinventoryasync (new list<string> { reservedtestproductids.purchased, reservedtestproductids.canceled, reservedtestproductids.refunded, reservedtestproductids.unavailable }, itemtype.product);

android monotouch xamarin

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -