スイフトを使用してゲームステージのロックを解除するIAPを実装します。 IPv4でうまく動作します。そこで私はこのバイナリを審査のために提出し、AppleがIPv6ネットワーク上でテストしたときに却下されます。 iPhoneは、のWi-Fi上のiOS 9.3.2を実行しているに見直したときに私たちは、IPv6ネットワークに接続されてアプリ内の1つまたは複数のバグを発見しIPV6の影響を受ける非消耗品のiOSアプリ内購入
:
はバイナリ理由を拒否します。 具体的には、In App Purchaseを購入した後、レベルのロックが解除されません。
私はすべてのケースでブレークポイントを設定しましたが、IPv6ネットワーク上で実行しているときにプログラムが1つも入っていませんでした。
ここでは私のコードは購入できます:
func paymentQueue(queue: SKPaymentQueue, updatedTransactions transactions: [SKPaymentTransaction]) {
print("Received Payment Transaction Response from Apple");
for transaction:AnyObject in transactions {
if let trans:SKPaymentTransaction = transaction as? SKPaymentTransaction{
switch trans.transactionState {
case .Purchased:
print("Product Purchased");
SKPaymentQueue.defaultQueue().finishTransaction(transaction as! SKPaymentTransaction)
self.levelButtonHalloween.enabled = true
lockImage.removeFromSuperview()
Overlay.removeFromSuperview()
userSettingDefaults.setBool(true, forKey: "enableHalloween")
userSettingDefaults.synchronize()
DesertOver50 = userSettingDefaults.boolForKey("enableHalloween")
buyBottom.removeFromSuperview()
backgroundImage.removeFromParent()
backgroundImage = SKSpriteNode(imageNamed: "StageSelect_Background2")
backgroundImage.size = self.frame.size
backgroundImage.position = CGPoint(x: frame.size.width/2, y: frame.size.height/2)
backgroundImage.anchorPoint = CGPointMake(0.5, 0.5)
backgroundImage.zPosition = 0
addChild(backgroundImage)
break;
case .Failed:
print("Purchase Failed");
SKPaymentQueue.defaultQueue().finishTransaction(transaction as! SKPaymentTransaction)
break;
case .Restored:
print("Transaction restored")
SKPaymentQueue.defaultQueue().restoreCompletedTransactions()
self.levelButtonHalloween.enabled = true
lockImage.removeFromSuperview()
Overlay.removeFromSuperview()
userSettingDefaults.setBool(true, forKey: "enableHalloween")
userSettingDefaults.synchronize()
DesertOver50 = userSettingDefaults.boolForKey("enableHalloween")
buyBottom.removeFromSuperview()
backgroundImage.removeFromParent()
backgroundImage = SKSpriteNode(imageNamed: "StageSelect_Background2")
backgroundImage.size = self.frame.size
backgroundImage.position = CGPoint(x: frame.size.width/2, y: frame.size.height/2)
backgroundImage.anchorPoint = CGPointMake(0.5, 0.5)
backgroundImage.zPosition = 0
addChild(backgroundImage)
default:
break;
}
}
}
SKPaymentQueue.defaultQueue().removeTransactionObserver(self)
}
私も購入を復元し、それがIPv4とIPv6の両方のために働くためのボタンを実装します。
ここで購入を復元するためのコード:
func restorePurchaseButtonAction(){
button_Clicked()
if (DesertOver50 == false){
if (SKPaymentQueue.canMakePayments()) {
// Enable SKPayment as soon as possible during viewdidload
SKPaymentQueue.defaultQueue().addTransactionObserver(self)
SKPaymentQueue.defaultQueue().restoreCompletedTransactions()
}
}else{
let alert = UIAlertController(title: "It's already unlocked ¬_¬", message: "Your have already unlocked or purchased the item(s)", preferredStyle: .ActionSheet)
let ok = UIAlertAction(title: "OK", style: .Cancel) { action -> Void in
}
alert.addAction(ok)
alert.popoverPresentationController?.sourceView = view
alert.popoverPresentationController?.sourceRect = self.frame
self.view?.window?.rootViewController?.presentViewController(alert, animated: true, completion: nil)
}
}
誰でもこの前の経験がありますか? IPv4とIPv6の違いは何ですか?私は次に何をすべきですか?
あなたのアプリは承認されましたか?どのような変更を加えましたか? –
はいアプリが承認されました。シナリオ3のようにします。 – Justintas