android - Can't access In-App Products in Play Store -


i'm working on android app developed on titanium sdk 3.2.0.ga , i'm using in-app billing module appcelerator.

my implementation of module it's follows (omitting functions purpose display log info):

var identifierproduct = ''; var inappbilling = require('ti.inappbilling'); var publickey = alloy.globals.android.publickey_1 + alloy.globals.android.publickey_2 + alloy.globals.android.publickey_3 + alloy.globals.android.publickey_4; inappbilling.setpublickey(publickey);  function initializebilling() {                var synchronousresponse = inappbilling.checkbillingsupported();     displaysynchronousresponsecodes(synchronousresponse); }  function requestpurchase(identifier, item_type) {      // check if billing current product type supported before sending purchase request     var checkbillingresponse = inappbilling.checkbillingsupported(item_type);     if (checkbillingresponse.responsecode == inappbilling.result_ok)     {         ti.api.info('current product type supported, continuing request');          var tmpargs = {             productid: identifier,             producttype: item_type,             developerpayload: 'devpayload'         };          ti.api.info('args product request\n' + json.stringify(tmpargs));         var synchronousresponse = inappbilling.requestpurchase({             // productid: 'android.test.purchased',             // productid: 'android.test.canceled',             // productid: 'android.test.refunded',             // productid: 'android.test.item_unavailable',             productid: identifier,             producttype: item_type,             developerpayload: 'devpayload'         });         displaysynchronousresponsecodes(synchronousresponse);     }      else      {         ti.api.info('current product type not supported, aborting request');         displaysynchronousresponsecodes(checkbillingresponse);     } }  function on_bind_event(e) {     if (e.result == inappbilling.success) {         notifyme('billing service bound');         enableinapppurchases(true);           //call      } else {         notifyme('billing service bind failed');         enableinapppurchases(false);     } } inappbilling.addeventlistener(inappbilling.on_bind_event, on_bind_event);  function on_connect_event(e) {     notifyme('connect called');     if(ti.app.properties.getbool('transactionsrestores') === null)     {         ti.api.info('fresh install, lets restore transactions');         try         {             inappbilling.restoretransactions();         }         catch(err)         {             ti.api.info('error');             ti.api.info(json.stringify(err));         }     } } inappbilling.addeventlistener(inappbilling.on_connect_event, on_connect_event);  function response_event(e) {     // events (e.sync == true) deprecated , removed. use event object methods return.     if(!e.sync){         notifyme('response called ' + e.requestid + ' ' + e.responsecode);         ti.api.info('response called \n' + 'request id:\n' + e.requestid + ' ' + '\nresponse code:' + responsestring(e.responsecode));         if(e.responsecode === inappbilling.result_error)         {                                    // error in request             ti.api.info('response event error');             ti.api.info(json.stringify(e));          }         else if(e.responsecode === inappbilling.result_item_unavailable)         {              // item unavailable in request             ti.api.info('response event item unavailable');             ti.api.info(json.stringify(e));         }      } } inappbilling.addeventlistener(inappbilling.response_event, response_event);   function purchase_state_changed_event(e) {     ti.api.info('purchase_state_changed_event parameters:\n' + json.stringify(e) );     notifyme('purchase state changed called ' + e.signeddata + ' ' + e.signature+'\n'+ 'security result ' + e.result);      ti.api.info('purchase state changed called');     ti.api.info('signature verification result:\n' + verificationstring(e.result));     ti.api.info('signed data:\n' + e.signeddata);      if (e.signeddata != null) {         var response = json.parse(e.signeddata);         /*          * not guaranteed have orders returned           * need make sure 1 exists before using it.          *           * if there no notificationid there no need confirmnotifications().          * happens when restoretransactions() triggers purchase_state_changed_event.          */         for(var = 0; < response.orders.length; i++)         {             if(typeof response.orders[i] !== 'undefined')             {                 setpurchaseflag(response.orders[i].productid);             }             if (response.orders[i] && response.orders[i].notificationid)              {                  ti.api.info('confirming notification order ' + json.stringify(response.orders[i]));                 var synchronousresponse = inappbilling.confirmnotifications({                     notificationids: [response.orders[i].notificationid]                 });                 displaysynchronousresponsecodes(synchronousresponse);             }         }     } } inappbilling.addeventlistener(inappbilling.purchase_state_changed_event, purchase_state_changed_event);  function notify_event(e) {     ti.api.info('notify called \n' + 'notify id:\n' + e.notifyid);      var synchronousresponse = inappbilling.getpurchaseinformation({         notificationids: [e.notifyid]     });     displaysynchronousresponsecodes(synchronousresponse); } inappbilling.addeventlistener(inappbilling.notify_event, notify_event);  inappbilling.startbillingservice(); 

the following list of steps i've reviewed errors:

  • i've checked package name same 1 in application draft in play store
  • i checked license key correct
  • all of in-app products in active state
  • the request sent play store product ids correspond in-app products.
  • my device account in registered test account should let me make purchase.

i added in-app products around 2 weeks ago , every time try request purchase, of them return not found response, play store couldn't take long activate the, right?

and yet, response "the item attempting purchase not found".

the response code 2, thought meant result_service_unavailable, dialog appears says item not found, interpreting response code wrongly? or should why service unavailable?

i followed guide test in-app purchases , i'm getting error no clear cause.

edit

i've been searching around , found few questions (here , here) developers result_service_unavailable when making many restoretransactions() calls. checked code , saw that, indeed, making restoretransactions() call every time launched app.

now have added validation on on_connect_event make sure if there transactions restore @ all, in case doesn't set flag prevents app making restoretransactions() call next launches.

the problem, though, still remains, can contact google in way ask in-app services enabled again? how long have wait? users on questions mention take 3 weeks, can accelerate process?

unfortunately without in-app purchases cannot release our app.

try publishing app in alpha or beta. have changed way of doing tests , required.

cheers


Comments

Popular posts from this blog

c++ - OpenCV Error: Assertion failed <scn == 3 ::scn == 4> in unknown function, -

php - render data via PDO::FETCH_FUNC vs loop -

The canvas has been tainted by cross-origin data in chrome only -