Is it possible to implement an in-app purchase within the SKScene
? If so, how? I'm trying to use a SKSpriteNode
as a 'buy' button with no luck. I'm not sure whether the code needs to go in the SKScene
or the view controller. I've looked at loads of tutorials, but they all seem to be aimed at single view applications rather than in SpriteKit.
相关问题
- “Zero out” sensitive String data in Swift
- SwiftUI: UIImage (QRCode) does not load after call
- Get the NSRange for the visible text after scroll
- UIPanGestureRecognizer is not working in iOS 13
- What does a Firebase observer actually do?
相关文章
- Using if let syntax in switch statement
- Enum with associated value conforming to CaseItera
- Swift - hide pickerView after value selected
- Is there a Github markdown language identifier for
- How can I vertically align my status bar item text
- Adding TapGestureRecognizer to UILabel in Swift
- Attempt to present UIAlertController on View Contr
- Swift - Snapshotting a view that has not been rend
First, put this in your game scene line and make sure you have the framework 'StoreKit' imported
Next, your going to want to put these lines in your didmovetoview. Keep in mind that after the "objects:" The string you put should be the in app purchase identifier you set up using iTunes connect.
Outside of any other functions, but still within the game scene, insert these functions and variables
Next you must name the node you need to do the iAP
Finally, do this in the touchesBegan
You will also want this in your touches began to restore the purchases using a different node.