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
Post a Comment