It looks like you're new here. If you want to get involved, click one of these buttons!
waxClass({"Buyer", NSObject, protocols = {"SKProductsRequestDelegate"}}) function init() return self end function buy() print("start buy") local setProduct = NSSet:setWithObject("myProductId") local productsRequest = SKProductsRequest:initWithProductIdentifiers(setProduct) productsRequest:setDelegate(self) productsRequest:start() print("end buy") end function productsRequest_didReceiveResponse(request, response) print("callback") end buyer = Buyer:new() buyer:buy() |
Comments
Are you sure that SKProducts is added and available? Check if the productsRequest is nil or an actual table value (i.e. valid result).
I think you need to include the required libraries and recompile to include them. To me it seems that the functionality you are wanting is not available and hence the errors.
Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
Cool Vizify Profile at https://www.vizify.com/oz-apps
If I put these methods on the xcode side and call it like this:
The problem is that I can't figure out how to get back to Lua after the callback. If I can do it, I don't mind having all the code on the objective c side. I just need a way to get back to Lua to update the purchase status.
In Android the JVBrigde works like a charm. I have complete control both ways.