簡體   English   中英

iPhone消費品表現得像非消費品(已經購買......)

[英]iPhone consumable product is behaving like a non-consumable product (already purchased…)

我們的應用程序有一個鎖定產品列表,這些產品共享相同的耗材產品ID(即許多產品的一個耗材產品ID)。 我們的服務器向我提供了產品列表以及與之關聯的產品ID:

item name =“itemA”iphoneProductId =“consumable.test.1”

item name =“itemB”iphoneProductId =“consumable.test.1”

item name =“itemC”iphoneProductId =“consumable.test.1”

我們之所以選擇耗材是因為我們的產品是動態創建的,需要立即供用戶使用(請不要回復,建議我們使用非耗材,還有很多其他原因因為我沒有放棄私人而難以解釋關於我們正在使用的公司的詳細信息,以及我們使用消耗品的原因)。 這使我們可以讓多個產品共享相同的價格。

當用戶購買itemA(例如)時,該項目被解鎖。 但是,有時,當用戶嘗試成為itemB時,Apple會返回“您已經購買過此內容但尚未下載的內容”。 點按確定立即下載'。 消費品肯定不會發生這種情況。 我知道我們的系統非常復雜,但就蘋果商店套件而言,只是再次購買相同的產品。

這可能只是一個沙箱問題嗎? 由於應用程序尚未發布,我們無法進行實時測試。 事實上,由於我們的客戶關注這個問題,所以這整個問題暫緩了發布。

我已經按照iphone文檔中的相同代碼和少數應用程序購買教程進行了操作。 我看到論壇上的很多人似乎目睹了上面“已購買”的消費品產品對話,但沒有一個能得到回應。

請幫忙! 謝謝

問題是你永遠不會完成交易。 您需要將其從隊列中刪除。

喜歡:

[[SKPaymentQueue defaultQueue] finishTransaction:transaction];

我假設你已經打過-[SKPaymentQueue finishTransaction:]

在我的頭頂,有幾種可能性:

  • 商店尚未收到“完成”消息(我不知道有什么訂購保證)。
  • 你試圖在調用finishTransaction之前購買第二個項目:在第一個項目上,App Store認為這是重播。
  • App Store會檢測您何時重復購買相同的商品,並假設某些商品一定出錯了。

黑客是循環遍歷幾個(10?100?)消耗品的列表,假設當你回到列表中的早期消耗品時,它將完成處理。

另一種解決方案是預先分配大量非消耗品(“product.1”,“product.2”,......,“product.100”),並將具有適當價格的產品分配給服務器上的產品。 然后可以在iTunes Connect上更改價格,或者根據需要分配其他產品ID。

感謝您的快速回復,但我的應用似乎確實正在完成交易等。

我的應用程序購買類項目變得非常復雜,所以我回過頭來創建一個帶有測試耗材產品的新基礎項目,以及來自這個開源的應用程序購買管理器/觀察者的標准實現:
http://blog.mugunthkumar.com/coding/iphone-tutorial-%E2%80%93-in-app-purchases/#idc-cover

出現同樣的問題。 這是訂單:
1.首次購買耗材(以下是我打印出的調試版)
_MKStoreManager:buyFeature:test.consumable.1
__MKStoreObserver:SKPaymentTransactionStatePurchased
__MKStoreObserver:completeTransaction
_MKStoreManager:provideContent
2. Apple顯示“感謝您購買”對話框
3.第二次購買消費品:
_MKStoreManager:buyFeature:test.consumable.1
__MKStoreObserver:SKPaymentTransactionStatePurchased
__MKStoreObserver:completeTransaction
_MKStoreManager:provideContent
__MKStoreObserver:SKPaymentTransactionStateFailed
__MKStoreObserver:failedTransaction
4.“你已經購買了它但尚未下載。點擊OK立即下載。[環境:沙箱]”對話框由apple顯示。

在步驟3中,交易既被購買又失敗的同時也沒有意義。 你有什么想法。

使用消耗品不值得使用,因為Apple會拒絕它。 這是發生在我身上的事情:

我有同樣的問題。 解釋您已經購買該商品的消息只會偶爾顯示一次,並且主要是因為您購買了很多東西 - 一個接一個地購買。

無論如何,我們已經在App Store中進行了審核,得到了以下答案:

..... We have completed the review of your in-app purchase but cannot post it to the App Store because the Purchasability Type is not set correctly. For information on Purchasing and Currency guidelines, please see section 11 of the App Store Review Guidelines [ https://developer.apple.com/appstore/resources/approval/guidelines.html ]. ..... The purchase of a [magazine issue] is set to "consumable", however based on product functionality it should be set as non-consumable instead. ......... You are required to create a new in-app purchase product with the correct purchasability type. ..........

我希望這能節省時間和頭痛。

我遇到了同樣的問題。 我犯的錯誤是在發送finishTransaction之前取消分配購買。 確保在完成交易后處理交易結果

- (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions {

 BOOL success = YES;

 for (SKPaymentTransaction *transaction in transactions){

  switch (transaction.transactionState){

   case SKPaymentTransactionStatePurchased:

    success = YES;

    break;

   case SKPaymentTransactionStateFailed:

    if (transaction.error.code == SKErrorPaymentCancelled){
     if(DEBUG) NSLog(@"Transaction failed => Payment cancelled.");
    }else if (transaction.error.code == SKErrorPaymentInvalid){
     if(DEBUG) NSLog(@"Transaction failed => Payment invalid.");
    }else if (transaction.error.code == SKErrorPaymentNotAllowed){
     if(DEBUG) NSLog(@"Transaction failed => Payment not allowed.");
    }else if (transaction.error.code == SKErrorClientInvalid){
     if(DEBUG) NSLog(@"Transaction failed => client invalid.");
    }else if (transaction.error.code == SKErrorUnknown){
     if(DEBUG) NSLog(@"Transaction failed => unknown error.");
    }else{
     if(DEBUG) NSLog(@"I have no idea.");
    }

    success = NO;

    break;

   case SKPaymentTransactionStateRestored:

    success = YES;

    break;

  }

  [[SKPaymentQueue defaultQueue] finishTransaction:transaction];

  NSLog(@"transaction finished: %@", transaction);

 }


 if(success){
             // do something
        }

}

希望能幫助你們中的一些人。

干杯,K。

你應該在交易之后把這一行[[SKPaymentQueue defaultQueue] finishTransaction:transaction]放在你新購買還是恢復購買上。

[[SKPaymentQueue defaultQueue] addTransactionObserver:observer];

確保在處理請求的控制器上添加了此方法。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM