sprite kit - Swift: can't add SKProductsRequestDelegate protocol to GameScene class? -


so i'm trying implement in app purchases in sprite kit game , i'm working in swift. know need add skproductsrequestdelegate , skpaymenttransactionobserver protocols gamescene class in order this, when add them error:

type 'gamescene' not conform protocol 'skproductsrequestdelegate' 

and similar error skpaymenttransactionobserver.

i imported storekit , here code:

import spritekit import avfoundation import storekit  class gamescene: skscene, skphysicscontactdelegate, skproductsrequestdelegate, skpaymenttransactionobserver { 

what doing wrong?

you have old version of function paymentqueue this:

func paymentqueue(queue: skpaymentqueue, updatedtransactions transactions: [anyobject])    {... } 

this functions declared this:

func paymentqueue(queue: skpaymentqueue, updatedtransactions transactions: [skpaymenttransaction])    {... } 

the productrequest should declare this:

func productsrequest (request: skproductsrequest, didreceiveresponse response: skproductsresponse) {... } 

this because have implement methods conform protocol


Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -