Swift - In App Purchase Tutorial

Seemu Apps · 17K views · 2015 · 41:01

Open on YouTube

Software (other)Software practice, open source & careerstutorialdated

Why Stack Overflow recommends it

Stack Overflow users link it when answering or asking about StoreKit in-app purchase code in Swift, either as a recommended walkthrough or as the tutorial they were following when they hit an error.

Recommended by 1 people across 1 different months, 2015 to 2016.

What it is

A 41-minute screen-recorded tutorial from Seemu Apps that walks through adding In-App Purchases to an iOS app in Swift using StoreKit. It covers fetching products, handling the payment queue, and testing purchases. The channel later published an updated Swift 3 version.

What people said

Recommends user3578549 · 2015-12 · Stack Overflow · on “In-App Purchase Swift”

I recommend you do not use such modules. It would be much better for you and your understanding of IAPs that you check this tutorial and implement the code and methods described there: [this video] Once you have implemented that code, if something doesn't work (you may have forgotten a line somewhere), come back to SO and we will gladly help you out. Already, as quick help, here is an answer that could help you with most errors once you implement your IAP code with something else than IAP helper: My IAP isn't working. Bugs at func Paymentqueue [LINK] In fact, you can watch the video and copy paste the code of my question. My IAP code works ;) Will save you time. But watch the video to understand

Cites Gianluca Raftacco · 2015-05 · Stack Overflow · on “Swift Store Kit In app Purchase transactionState”

I have make an app that uses store kit to add some character .. I have added the paymentQueue function but when the pop-up is displayed and I press Cancel , the transactionState is .Completed In this method if a user cancels the transaction he obtains the character without paying. func paymentQueue(queue: SKPaymentQueue!, updatedTransactions transactions: [AnyObject]!) { println("add paymnet") for transaction:AnyObject in transactions { var trans = transaction as SKPaymentTransaction switch trans.transactionState { case .Purchased: println("Purchase Successful") SKPaymentQueue.defaultQueue().finishTransaction(transaction as SKPaymentTransaction) queue.finishTransaction(trans) break; case .Fa

Cites JamesG · 2016-02 · Stack Overflow · on “Swift iAP Error (Objective-C method * conflicts with optional requirement method)”

I am following this video tutorial: [this video] I followed his tutorial to the letter however, when I do this function: func paymentQueue(queue: SKPaymentQueue!, removedTransactions transactions: [AnyObject]!) { print("removed") } I get the Full error: Objective-C method 'paymentQueue:removedTransactions:' provided by method 'paymentQueue( :removedTransactions:)' conflicts with optional requirement method 'paymentQueue( :removedTransactions:)' in protocol 'SKPaymentTransactionObserver' Also, in the video - the dude has no errors showing on his and he is able to run the app. Does anyone have idea why I am getting this error and how to fix it?