2
我在嘗試連接IAP。該應用程序正在測試飛行。包ID和appID是正確的。SKProductsResponse只返回無效的產品ID's
func requestProductData(productIdentifier: String) {
let pIDS = Set([productIdentifier])
if SKPaymentQueue.canMakePayments() {
let request = SKProductsRequest(productIdentifiers: pIDS)
request.delegate = self
print("yes") // make sure we can pay
request.start()
} else {
let alert = UIAlertController(title: "In-App Purchases Not Enabled", message: "Please enable In App Purchase in Settings", preferredStyle: UIAlertControllerStyle.Alert)
alert.addAction(UIAlertAction(title: "Settings", style: UIAlertActionStyle.Default, handler: { alertAction in
alert.dismissViewControllerAnimated(true, completion: nil)
let url: NSURL? = NSURL(string: UIApplicationOpenSettingsURLString)
if url != nil {
UIApplication.sharedApplication().openURL(url!)
}
}))
alert.addAction(UIAlertAction(title: "Ok", style: UIAlertActionStyle.Default, handler: { alertAction in
alert.dismissViewControllerAnimated(true, completion: nil)
}))
self.viewController!.presentViewController(alert, animated: true, completion: nil)
}
}
func productsRequest(request: SKProductsRequest, didReceiveResponse response: SKProductsResponse) {
print("these are the response products: \(response.products)")
print(response.invalidProductIdentifiers)
print("received response")
}
我正在將產品ID直接複製到iTunes之外。權利是正確的。 SKPaymentQueue.canMakePayments()
返回true,但即使我已經從測試設備上的商店退出,它也不會詢問我的沙盒ID。
我一直在設備上和模擬器上進行測試,結果相同。任何幫助將非常感激!
目前這是應用內購買在iTunes中的樣子。我可以提交新版本進行審查,但這似乎並不正確,因爲此應用程序尚未在應用程序商店中,只能在Test Flight中進行。
您的第一次應用程序內購買必須提交一個新的應用程序版本。 從應用程序的「應用程序內購買」部分選擇它,然後單擊提交。
^整個指令塊完全混淆了。閱讀我已經在應用程序內購買部分,並沒有提交按鈕。我已經上傳了一個新版本,但仍然沒有提交按鈕。