Running a test for my in app purchase (first time doing in app purchases). I get EXC_BAD_ACCESS on the third line of this code:
SKPayment *payment = [SKPayment paymentWithProduct:electronicProd]; [[SKPaymentQueue defaultQueue] addTransactionObserver:self]; [[SKPaymentQueue defaultQueue] addPayment:payment];
The is under an IBAction for a button. electronicPack is declared in the header as a SKProduct. Threw some NSLogs in the productsRequest didReceiveResponse, and when the product was requested (in the viewDidLoad) and they showed it was correctly fetching the product and storing it in electronicPack. Defined electronicPack as [[request.products] objectAtIndex:0] in the didReceiveResponse page. So yea. Thats where im at, dont know what to do. Any help is appreciated.
UPDATE: FIXED accidentally left in code that was adding an extra transaction observer lol
I've had the same issue, my solution was to call
[[SKPaymentQueue defaultQueue] removeTransactionObserver:self];
on leaving the In-App Store in my App. Maybe it will help someone in the future.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With