Skip to content

Instantly share code, notes, and snippets.

@flurrydev
Created October 10, 2018 22:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flurrydev/d52da2fb7a52a1d7efc6ff02e298baa9 to your computer and use it in GitHub Desktop.
Save flurrydev/d52da2fb7a52a1d7efc6ff02e298baa9 to your computer and use it in GitHub Desktop.
Send a payment request to App Store once user select a product to purchase (Obj-C)
-(void)purchase:(SKProduct *)product {
if ([SKPaymentQueue canMakePayments]) {
// add this payment to the payment queue
SKPayment *payment = [SKPayment paymentWithProduct:product];
[[SKPaymentQueue defaultQueue] addPayment:payment];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment