Dear all,
I am using codeless IAP for WP8.1.
Currentily I have some issues and I want to clarify some questions:
Description of my issue
IAP will be made in the settings menu. The menu UI is inactive at game start and will be activated as users clicks on settings. Then IAP will initialize, because the IAP button gameobject is active. Also for testing, I added a script to the button for IAP (“IAP Simulator”).
- Is this a problem if a user clicks on settings and then immediatly on IAP button to purchase? I am not sure IAP is already initialized at this time. Is there a way to do this at game start (with the IAP button script)?
- When do I have to run the Simulator script? Are there dependencies? Do I need to move this into the IAP button script?
- In editor it works like expected. If run the build on phone (“Master”), I get the following log:
UnityIAPWin8:Begin PollForProducts() persistent = True, delay = 0, productsOnly = False
after some time
UnityIAPWin8:Begin PollForProducts() persistent = True, delay = 10000, productsOnly = False
UnityIAPWin8:Begin PollForProducts() persistent = True, delay = 20000, productsOnly = False
As said, I currently want to use the simulator - not publishing the game to the store. I would expect that the simulator script would avoid to poll products from the store (instead simulate).
Components
Unity Version: 5.5.2f1
Unity IAP version: 1.11.1
Platforms target: Windows Store / Phone 8.1
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Purchasing;
//Unity IAP features support for Microsoft’s In App Purchase simulator, which allows you to test IAP purchase flows on devices before publishing your application.
//Possible TODO: Make sure you disable the mock billing system before publishing your application!!!!
public class IAPSimulator : MonoBehaviour
{
// Use this for initialization
void Start ()
{
var builder = ConfigurationBuilder.Instance(StandardPurchasingModule.Instance());
builder.Configure<IMicrosoftConfiguration>().useMockBillingSystem = true;
}
}
Greetings
Pat