I have been trying to get IAP running for an existing published app. I released the first version without the store, and am trying to add IAP to the second version.
My problem is that whenever I try to test the store on my device (iPhone3G), when it runs the init for the store it throws the following error:
unknown UIKitApplication:com.mv8studios.fastwalk[0x1732][107] : Lua Runtime Error: lua_pcall failed with status: 2, error message is: ?:0: attempt to call field ‘init’ (a nil value)
I am using the Ad Hoc identity ( which I updated after I enabled the IAP for the app )
The code I am using to test is from this page ( although I have tried code from lots of other posts as well ) http://developer.anscamobile.com/reference/index/storeinit<br>store = require("store")<br> <br>function transactionCallback( event )<br> local transaction = event.transaction<br> if transaction.state == "purchased" then<br> print("Transaction succuessful!")<br> print("productIdentifier", transaction.productIdentifier)<br> print("receipt", transaction.receipt)<br> print("transactionIdentifier", transaction.identifier)<br> print("date", transaction.date)<br> <br> elseif transaction.state == "restored" then<br> print("Transaction restored (from previous session)")<br> print("productIdentifier", transaction.productIdentifier)<br> print("receipt", transaction.receipt)<br> print("transactionIdentifier", transaction.identifier)<br> print("date", transaction.date)<br> print("originalReceipt", transaction.originalReceipt)<br> print("originalTransactionIdentifier", transaction.originalIdentifier)<br> print("originalDate", transaction.originalDate)<br> <br> elseif transaction.state == "cancelled" then<br> print("User cancelled transaction")<br> <br> elseif transaction.state == "failed" then<br> print("Transaction failed, type:", transaction.errorType, transaction.errorString)<br> <br> else<br> print("unknown event")<br> end<br> <br> -- Once we are done with a transaction, call this to tell the store<br> -- we are done with the transaction.<br> -- If you are providing downloadable content, wait to call this until<br> -- after the download completes.<br> store.finishTransaction( transaction )<br>end<br> <br>store.init( transactionCallback )<br>
Also the above code is used within director.
Has anybody encountered that error before and what did you do to get around it? [import]uid: 95403 topic_id: 19841 reply_id: 319841[/import]