2017-04-19 252 views
1

我創建了一個使用應用程序內購買的應用程序,我已經在iTunes上設置了應用程序內購買,我甚至使用沙箱用戶對其進行了測試,所有這些工作都非常完美。從iMessage應用程序擴展程序購買應用程序

現在我包含了一個iMessage應用程序擴展,同樣的應用程序內購買產品返回invalidProduct ID,但繼續在主應用程序內運行良好。

可能是因爲捆綁ID?

mainapp: com.whatever.bundleid 
app iMessage: com.whatever.bundleid.iMessage 
iMessage extension: com.whatever.bundleid.iMessage.MessagesExtension 

btw,我正在使用SwiftyStoreKit窗格。

if let inappIndentifier = stickerPackage.inAppPurchaseId { 
     SwiftyStoreKit.retrieveProductsInfo([inappIndentifier]) { result in 
      if let product = result.retrievedProducts.first { 
       let priceString = product.localizedPrice! 
       completion(true, priceString) 
      } else if let _ = result.invalidProductIDs.first { 
       completion(false, nil) 
      } else { 
       print("Error: \(result.error)") 
       completion(false, nil) 
      } 
     } 
    } 

enter image description here

回答

0

我做了一個巨大的錯誤,而不是創建一個擴展的iMessage,我創建了一個的iMessage應用程序擴展。 一旦我刪除了「iMessage應用程序」,應用程序內購買開始正常工作。

相關問題