In-app purchases: stuck when paying Process Process Identifiers are outdated

I am stuck in setting up my in-app purchases.

I can not get this right:

SKPayment *paymentRequest = [SKPayment paymentWithProduct: @"co.za.nideo.100shotsbuybeer"]; 

I got it from

 SKPayment *paymentRequest = [SKPayment paymentWithProductIdentifiers: @"co.za.nideo.100shotsbuybeer"]; 

but it seems outdated. How can I make the first part of the code work?

It seems like SKEProduct, but I don't know how to create / initialize such an object.

+4
source share
1 answer

According to StoreKit and [1], you need to:

  • Create SKProductsRequest with your product identifiers ( initWithProductIdentifiers:
  • Set yourself up as a delegate
  • Send this request to Apple ( start )
  • The answer will call your delegates productsRequest:didReceiveResponse: which contains the SKProductsResponse object
  • You extract SKProduct objects from the products property and display them, saving the objects for future purchase.

This is similar to Important: you must request a product for a specific product identifier before allowing the user to purchase this product. Retrieving product information from the App Store ensures that you use a valid product identifier for the product that you tagged for sale on iTunes Connect. from [1]

[1] http://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/StoreKitGuide/RetrievingStoreInformation/RetrievingStoreInformation.html#//apple_ref/doc/uid/TP40008267-CH2-SW1

+10
source

Source: https://habr.com/ru/post/1383986/


All Articles