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 -

how to prompt save As Box in Excel Interlop c# MVC 4 -

xslt 1.0 - How to access or retrieve mets content of an item from another item? -