iOS IAP 无法在 Unity 上运行,“服务不可用”

Posted

技术标签:

【中文标题】iOS IAP 无法在 Unity 上运行,“服务不可用”【英文标题】:iOS IAP not working on Unity, "Service Unavailable" 【发布时间】:2019-02-20 13:51:11 【问题描述】:

我正在尝试在 Unity 3D 中测试我的游戏的 IAP,但它不起作用,它在 android 上运行良好,但当我在 ios 上测试时它说:服务不可用,请检查您的互联网连接。 这是日志:

AdMob client has been initialized.
EasyMobile.AdClientImpl:Init()
EasyMobile.Advertising:SetupAdClient(AdNetwork)
EasyMobile.Advertising:get_AdMobClient()
EasyMobile.Advertising:GetWorkableAdClient(AdNetwork)
EasyMobile.Advertising:get_DefaultBannerAdClient()
EasyMobile.Advertising:ShowBannerAd(BannerAdPosition)

(Filename: ./Runtime/Export/Debug.bindings.h Line: 45)

2019-02-20 14:39:02.410174+0100 tapsky[6450:2398639] <Google> To get test ads on this device, set: request.testDevices = @[ @"3de524b688608295a3dbf784dd31f9aa" ];
Creating new default banner...
EasyMobile.AdMobClientImpl:InternalShowBannerAd(AdPlacement, BannerAdPosition, BannerAdSize)
EasyMobile.AdClientImpl:ShowBannerAd(AdPlacement, BannerAdPosition, BannerAdSize)
EasyMobile.Advertising:ShowBannerAd(IAdClient, AdPlacement, BannerAdPosition, BannerAdSize)

(Filename: ./Runtime/Export/Debug.bindings.h Line: 45)

UnityAds client has been initialized.
EasyMobile.AdClientImpl:Init()
EasyMobile.Advertising:SetupAdClient(AdNetwork)
EasyMobile.Advertising:get_UnityAdsClient()
EasyMobile.Advertising:GetWorkableAdClient(AdNetwork)
EasyMobile.Advertising:GetAvailableNetworks()
EasyMobile.<CRAutoLoadAllAds>c__Iterator1:MoveNext()
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

(Filename: ./Runtime/Export/Debug.bindings.h Line: 45)

Please initialize the UnityAds client first.
EasyMobile.AdClientImpl:CheckInitialize(Boolean)
EasyMobile.AdClientImpl:LoadInterstitialAd(AdPlacement)
EasyMobile.Advertising:LoadAllInterstitialAds(List`1)
EasyMobile.<CRAutoLoadAllAds>c__Iterator1:MoveNext()
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)


(Filename: ./Runtime/Export/Debug.bindings.h Line: 45)

UnityIAP Version: 1.20.1
UnityEngine.Purchasing.StandardPurchasingModule:Instance(AppStore)
EasyMobile.InAppPurchasing:InitializePurchasing()



(Filename: ./Runtime/Export/Debug.bindings.h Line: 45)

Unavailable product com.yougamestudios.tapsky.10000c -com.yougamestudios.tapsky.10000c
UnityEngine.Purchasing.PurchasingManager:CheckForInitialization()
UnityEngine.Purchasing.PurchasingManager:OnProductsRetrieved(List`1)
UnityEngine.Purchasing.AppleStoreImpl:OnProductsRetrieved(String)
UnityEngine.Purchasing.Extension.UnityUtil:Update()

(Filename: ./Runtime/Export/Debug.bindings.h Line: 45)

Unavailable product com.yougamestudios.tapsky.500c -com.yougamestudios.tapsky.500c
UnityEngine.Purchasing.PurchasingManager:CheckForInitialization()
UnityEngine.Purchasing.PurchasingManager:OnProductsRetrieved(List`1)
UnityEngine.Purchasing.AppleStoreImpl:OnProductsRetrieved(String)
UnityEngine.Purchasing.Extension.UnityUtil:Update()

(Filename: ./Runtime/Export/Debug.bindings.h Line: 45)

In-App Purchasing OnInitializeFailed. InitializationFailureReason:NoProductsAvailable

我将产品添加到 App Store 但仍在审核中,这可能是问题吗?

【问题讨论】:

【参考方案1】:

日志的最后一行写着:

InitializationFailureReason:NoProductsAvailable

是的,我认为您猜对了:当产品处于审核阶段时,您不会在应用中获得它们。

【讨论】:

谢谢!!我将等待完成审核

以上是关于iOS IAP 无法在 Unity 上运行,“服务不可用”的主要内容,如果未能解决你的问题,请参考以下文章

iOS 中的 IAP 停止工作

Unity 接入IAP(上)Android篇

如何从 HMS IAP 服务器端恢复 Non-Consumable IAP 服务?

Swift IOS 13,IAP - “无法连接到 Itunes Connect”

Unity IAP在Apple Testflight中不起作用

Unity游戏开发,Steam的IAP怎么搞