When uploading my game to Unity Distribution Portal (UDP), I kept on receiving this message about sandbox testing:
It seems your game was never tested in the UDP Sandbox environment, as no UDP Initialization call was found on the UDP back-end. Launch your APK in the UDP Sandbox environment to ensure it initializes properly. You must complete this step to release your game.
Now, I initially thought that Unity sandbox testing was enabled as soon as you installed the UDP plugins, but I have read that you need to make a script like this for the testing procedures to pass:
using UnityEngine;
using UnityEngine.UDP;
public class InitListener : IInitListener
{
public void Initialize()
{
StoreService.Initialize(IInitListener listener);
}
public void OnInitialized(UserInfo userInfo)
{
Debug.Log("Initialization succeeded");
}
public void OnInitializeFailed(string message)
{
Debug.Log("Initialization failed: " + message);
}
}
However, I kept on encountering a syntax error that said
InitListener.cs(9,49): error CS1003: Syntax error, ',' expected
...Even though there's no need for a ",".
Typppi also suggested calling from another script to refer to this one, which I have made:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UDP;
public Script listener;
public class Initializer : MonoBehaviour
{
void Start()
{
StoreService.Initialize(IInitListener listener);
}
}
Yet it still returns the same syntax error. Even then, what am I supposed to do with this initialization script? Where do I assign it?
Thank you for reading.
Initialize(IInitListener listener);
this isn't a valid method call though. It looks like a declaration, in a place where you're not declaring a function. So you definitely have some kind of syntax error there. \$\endgroup\$IInitListener
doing there? Did you mean to perform a cast of thislistener
variable? Where islistener
declared? \$\endgroup\$InitListener
live somewhere, and callStoreService.Initialize(instance)
with the instance ofInitListener
you have created from some place that gets called at your game initialization. \$\endgroup\$IInitListener listener
and put your argument there instead. \$\endgroup\$