Last active
October 29, 2016 01:51
-
-
Save DaisukeNagata/f2e6e09dd8ba0862358fdacbb5bee7b5 to your computer and use it in GitHub Desktop.
Swift3.0 アプリ内課金 非消耗型の対応を実施する。 ref: http://qiita.com/daisukenagata/items/fc653bf358927e24d24e
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import StoreKit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PayViewController: UIViewController,SKProductsRequestDelegate, SKPaymentTransactionObserver { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func productsRequest(_ request: SKProductsRequest, | |
didReceive response: SKProductsResponse) { | |
if response.invalidProductIdentifiers.count > 0 { | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func paymentQueueRestoreCompletedTransactionsFinished(_ queue: SKPaymentQueue){ | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func paymentQueue(_ queue: SKPaymentQueue, updatedTransactions transactions: [SKPaymentTransaction]) { | |
case .restored: | |
SKPaymentQueue.default().finishTransaction(transaction) | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func paymentQueue(_ queue: SKPaymentQueue, removedTransactions transactions: [SKPaymentTransaction]) { | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment