I’m in the same boat. I was doing a simple update to my app, and my binary got rejected because of this. Here’s my code (note: I only edited out things that might be sensitive information or garbage in the logs like gesture warnings):
function IAPContainer:create() print("store init...") self.store.init( "apple", self.transactionCallback ) end function IAPContainer:transactionCallback( event ) print("=============okay?") print(event) if event then local transaction = event.transaction if event.transaction.state == "purchased" then if (transaction.productIdentifier == self.productIdentifiers[1]) then fortuneContainer:add() end elseif event.transaction.state == "cancelled" then elseif event.transaction.state == "failed" then -- something went wrong native.showAlert( "Transaction Failed", "Try again later.", { "OK" } ) else -- something went wrong native.showAlert( "Transaction Failed", "Try again later.", { "OK" } ) end self.store.finishTransaction( event.transaction ) else print("!!! not okay") end end function IAPContainer:buy(productID) productId = self.productIdentifiers[1] if self.store.isActive == false then native.showAlert("Store purchases are not available. Verify that in-app purchases are enabled and try again later.", {"OK"}) elseif self.store.canMakePurchases == false then native.showAlert("Store purchases are not available. Verify that in-app purchases are enabled and try again later.", {"OK"}) elseif productId then -- print("Purchasing " .. tostring(productId)) self.store.purchase( {productId} ) end end
This is what I get from the console output:
Aug 21 14:06:20 MyDeviceName MyAppName[295] \<Error\>: assertion failed: 12H321: libxpc.dylib + 51867 [3C761F5E-F2FD-315B-895A-4054CAE2232E]: 0x7d Aug 21 14:06:20 MyDeviceName Unknown[295] \<Error\>: Aug 21 14:06:20 MyDeviceName MyAppName[295] \<Warning\>: Platform: iPod touch / iPod5,1 / 8.4.1 / PowerVR SGX 543 / OpenGL ES 2.0 IMGSGX543-115.5 / 2015.2697 Aug 21 14:06:20 MyDeviceName MyAppName[295] \<Warning\>: making store... Aug 21 14:06:20 MyDeviceName MyAppName[295] \<Warning\>: store init... Aug 21 14:06:22 MyDeviceName MyAppName[295] \<Warning\>: =============okay? Aug 21 14:06:22 MyDeviceName MyAppName[295] \<Warning\>: nil Aug 21 14:06:22 MyDeviceName MyAppName[295] \<Warning\>: !!! not okay Aug 21 14:06:22 MyDeviceName MyAppName[295] \<Warning\>: =============okay? Aug 21 14:06:22 MyDeviceName MyAppName[295] \<Warning\>: nil Aug 21 14:06:22 MyDeviceName MyAppName[295] \<Warning\>: !!! not okay Aug 21 14:06:22 MyDeviceName MyAppName[295] \<Warning\>: =============okay? Aug 21 14:06:22 MyDeviceName MyAppName[295] \<Warning\>: nil Aug 21 14:06:22 MyDeviceName MyAppName[295] \<Warning\>: !!! not okay Aug 21 14:06:22 MyDeviceName MyAppName[295] \<Warning\>: =============okay? Aug 21 14:06:22 MyDeviceName MyAppName[295] \<Warning\>: nil Aug 21 14:06:22 MyDeviceName MyAppName[295] \<Warning\>: !!! not okay Aug 21 14:06:22 MyDeviceName MyAppName[295] \<Warning\>: =============okay? Aug 21 14:06:22 MyDeviceName MyAppName[295] \<Warning\>: nil Aug 21 14:06:22 MyDeviceName MyAppName[295] \<Warning\>: !!! not okay Aug 21 14:06:23 MyDeviceName itunescloudd[148] \<Warning\>: Updating media purchase history for initial load... Aug 21 14:06:24 MyDeviceName ubd[157] \<Error\>: account is still enabled for ubiquity! Aug 21 14:06:24 MyDeviceName ubd[157] \<Error\>: account is still enabled for ubiquity! Aug 21 14:06:37 MyDeviceName ubd[157] \<Error\>: account is still enabled for ubiquity! Aug 21 14:06:37 MyDeviceName ubd[157] \<Error\>: account is still enabled for ubiquity! Aug 21 14:06:37 MyDeviceName syncdefaultsd[287] \<Notice\>: (Note ) SYDAccount: no account Aug 21 14:06:37 MyDeviceName itunesstored[83] \<Warning\>: Could not load library [21] Aug 21 14:06:37 MyDeviceName kernel[0] \<Notice\>: AppleKeyStore: operation failed \<removed possibly sensitive data\> Aug 21 14:06:37 MyDeviceName itunescloudd[148] \<Warning\>: Updating media purchase history for initial load... Aug 21 14:06:38 MyDeviceName itunescloudd[148] \<Warning\>: Updating media purchase history for initial load... Aug 21 14:06:38 MyDeviceName accountsd[82] \<Warning\>: [Warning] Unhandled server key: alert Aug 21 14:06:38 MyDeviceName accountsd[82] \<Warning\>: AIDA Notification plugin running Aug 21 14:06:38 MyDeviceName kernel[0] \<Notice\>: AppleAP3GDL::handleInterrupt2 FIFO is Empty Aug 21 14:06:39 MyDeviceName kernel[0] \<Notice\>: AppleKeyStore: operation failed \<removed possibly sensitive data\> Aug 21 14:06:39 MyDeviceName backupd[300] \<Warning\>: INFO: Account changed (enabled=0, accountID=219936675) Aug 21 14:06:39 MyDeviceName kernel[0] \<Notice\>: AppleKeyStore: operation failed \<removed possibly sensitive data\> Aug 21 14:06:39 MyDeviceName syncdefaultsd[287] \<Notice\>: (Note ) SYDAccount: no account Aug 21 14:06:39 MyDeviceName syncdefaultsd[287] \<Notice\>: (Note ) SYDAccount: no account
Basically, something’s going wrong in the startup, and it’s calling the callback with “nil” instead of the event, which probably breaks things under the hood with Corona as well. After that, when I attempt to buy stuff, everything looks like it’s working. I get the “Buy items for $.99” screen and accept, but then, I get an the screen about “In-apps will be restored for free.” The “store.isActive” is returning true, but it’s failing to buy. The buy calls never trigger the transactionCallback (like, not even to pass nil for the event like it does at startup).
Oh, btw, IAPContainer is an implementation of a simple class in my code and “store” is this:
IAPContainer.store = require("store")