It looks like you're new here. If you want to get involved, click one of these buttons!
--require plugin require "iab" --create iab instance based on store you want to use iab = IAB.new("google") --provide key(s) needed for the store iab:setUp("base code from playstore") --> base64 code from playstore right --provide list of products you will be using --(key is your internal products id, value is store specific product id) iab:setProducts({p1 = "product_001", p2 = "product_002"}) --which of your products are consumables, --that people can buy many times (provide internal product ids) iab:setConsumables({"p1", "p2"}) --[[ CHECKING IF STORE IS AVAILABLE ]]-- iab:addEventListener(Event.AVAILABLE, function(e) print("is available") --usually here we would set a flag that it is possible to make purchases --basically you can allow doing all the iap stuff after this event is called --[[ REQUESTING PRODUCTS ]]-- --if this event is called, we received the list of products and information about them iab:addEventListener(Event.PRODUCTS_COMPLETE, function(e) for i = 1, #e.products do local p = e.products[i] --id, title, description and price print(p.productId, p.title, p.description, p.price) end end) iab:addEventListener(Event.PRODUCTS_ERROR, function(e) print(e:getType(), e.error) end) --requesting products iab:requestProducts() --[[ PURCHASING ]]-- iab:addEventListener(Event.RESTORE_COMPLETE, function(e) end) iab:addEventListener(Event.PURCHASE_COMPLETE, function(e) for i = 1, #e.products do local p = e.products[i] if p.productId == 1 then print ("Product 1 should be successful bought") end if p.productId == 2 then print ("Product 2 should be successful bought") end end) iab:addEventListener(Event.PURCHASE_ERROR, function(e) Print("Error on Purchasing") end) end) iab:isAvailable() |
Comments
Likes: GiderosFan
Likes: GiderosFan
Likes: GiderosFan
Likes: GiderosFan
Likes: GiderosFan
you need create an google group on googlegroups.com and set this group in the developer account for example your testing group called "mytestinggroup" then you must setup this as mytestinggroup@googlegroup.com and all people which are in the group get information about your product and can download it by an special alpha release link. btw. my inapp working long night but it works yet.
about apple @freessp this is not so complicated because on StoreKit and Apple Allows very easy and quick InApp Tests. No creation of groups etc... just setting up sandbox user accounts
Thank you very much @freessp
Likes: GiderosFan