I’m having some troubles in implementing IAP codeless restore.
I have added 2 IAP buttons in 2 different scenes for non consumables products, I can buy them (already tested live in alpha closed group), problems come when I unistall/reinstall the app and I try to restore my previous purchases.
I’m using UnityIAP version 1.22.0 and playerPrefs to save the product settings.
Once a user buy the “No Ads” option the relative IAP button are disabled and Ads disappear, this should happen again when I reinstall my app, but it doesn’t.
My questions are:
-
I’ve understood that I have to implement 2 IAP listener and check if user have already payed for the products but for some reason it doesn’t work, am I missing something?
-
Should I add a listener for each scene where IAP buttons are present, or should I use a single listener at the app start up?
-
In IAP listener should I retrieve product ID or similar in order to enable the purchases or this should be automatic?
Below the implementation of a listener:
At the moment, as you can see below, in AcquistiMain.ListenerAcquistoCompletato(Product product) there is only a function that log the call To IAP Listener, Set PlayerPrefs Settings and refresh the scene.
public void ListenerAcquistoCompletato(Product product)
{
Debug.Log("IAPListener OK");
PlayerPrefs.SetInt("noAds", 1);
SceneManager.LoadScene(SceneManager.GetActiveScene().name);
}
Thanks in advance to everybody for you suggestions and your patience.
Have a nice day
Riccardo