Hey all, so I’ve been trying to get Unity IAPs working for a while now and still can’t figure it out. Everything works as intended with the fake store within the Unity editor. But the second I build the iOS build, then use Xcode to put it on my iPhone 6, with a sandbox account, the actual codeless IAP button doesn’t do anything. I mean literally 0.
I get no fatal error messages within Xcode, nor in the Unity log files. This is my log after trying it in the editor:
UnityAdsEditor: Initialize(2630602, True);
UnityEditor.Advertisements.UnityAdsEditor:EditorOnLoad()
Initializing UnityPurchasing via Codeless IAP
UnityEngine.Purchasing.IAPButton:OnEnable()
UnityIAP Version: 1.20.0
UnityEngine.Purchasing.IAPButton:OnEnable()
Using configuration builder objects
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
UnityIAP: Promo interface is available for 1 items
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
Ad was skipped before end.
UnityEngine.Debug:Log(Object)
LevelManager:HandleShowResult(ShowResult) (at Assets/Scripts/LevelManager.cs:171)
UnityEngine.GUI:CallWindowDelegate(WindowFunction, Int32, Int32, GUISkin, Int32, Single, Single, GUIStyle)
IAPButton.PurchaseProduct() with product ID: com.xaagaming.bjorn.123
UnityEngine.EventSystems.EventSystem:Update()
purchase({0}): com.xaagaming.bjorn.123
UnityEngine.EventSystems.EventSystem:Update()
Basically clicking that purchase button and selecting “YES” for purchasing, sets an integer to 1. If that integer is 0, then post death ads play. However, if you purchase this for 0.99 cents, then the post death ads stop playing.
//disabling ads
public void purchaseFulfillmentNoAds(){
noAdsPurchase = 1;
Debug.Log ("No Ads have been purchased");
PlayerPrefs.SetInt ("noAdsPurchase", 1);
}
Then in my respawnCoroutine I have this because it plays ads right before you respawn.
//Advertisement.Show();
if (noAdsPurchase == 0) {
showAds ();
}
I get this message after clicking on the codeless IAP button that reads:
Do you want to Purchase com.CompanyName.GameName ?
Environment: Fake Store
Yes/NO
When I click yes, everything works fine. I just can’t get this to work within a test environment…