> Unity IAP: Unity In-App Purchasing requires Unity Gaming Services to have been initialized before use.
This log warning shows when I compile and I've followed the instructions to go to the IAP catalog window and check on 'initialize Unity Gaming Services' so therefore it should be initializing Unity Gaming Services right? Apparently not and I'm not sure why. I've tried the manual way of doing it too suggested in Unity docs. Are there any other ways to initialize Unity Gaming Services that I'm missing because this method doesn't work?
using System;
using Unity.Services.Core;
using Unity.Services.Core.Environments;
using UnityEngine;
public class InitializeUnityServices : MonoBehaviour
{
public string environment = "production";
async void Start()
{
try
{
var options = new InitializationOptions()
.SetEnvironmentName(environment);
await UnityServices.InitializeAsync(options);
}
catch (Exception exception)
{
// An error occurred during services initialization.
}
}
}
https://docs.unity3d.com/Packages/com.unity.purchasing@4.2/manual/UnityIAPInitializeUnityGamingServices.html
↧