AlexDisler / cordova-plugin-inapppurchase

A lightweight cordova plugin for in app purchases on iOS/Android
316 stars 191 forks source link

productid in google developer console #56

Open fkindy01 opened 8 years ago

fkindy01 commented 8 years ago

Hello everyone,

I am using this plugin to learn how to purchase an item. I have create the item in google developer console (with productid prod1 and the apk connection ). how to call it in my app.js (e.g var productIds = ['prod1']; ) or what others steps should i do in order the following code not lead to catch

$scope.loadProducts = function () { $ionicLoading.show({ template: spinner + 'Loading Products...' }); inAppPurchase .getProducts(productIds) .then(function (products) { $ionicLoading.hide(); $scope.products = products; }) .catch(function (err) { $ionicLoading.hide(); console.log(err); }); };

Another problem i faced beside this is the index-android.js:115 Uncaught ReferenceError: module is not defined

I am new to this and every advice will be appreciated

marcusforsberg commented 8 years ago

What error are you getting in the catch block? The code looks correct, assuming you've added a product with ID 'prod1' to Google Play, and set its status to active, and you are running your signed app in release mode when testing.

fkindy01 commented 8 years ago

Hey there i have done all the steps above that you have mentioned. But what i didnt do is set if my product is consumable and that kind of information cause i dont know where to set this kind of informations.

Object {code: -2, message: "Billing cannot be initialized"} This is the error i am getting.