Your game must clear a basic UDP Sandbox test before its first release. UDP will verify that your game initializes and purchases IAP items properly before letting you release your first revision and move to the submission stages.
How to complete this step?Collapse
First, be sure to create UDP Sandbox Test accounts. You can do this in the section directly below, or in the Unity Editor. (Done)
Run your UDP APK on an emulator or a real Android device. (Done)
Use your UDP Sandbox Test account credentials to log in. (wait how do I do that ?)
Test your game, and make at least one IAP transaction. It’s a sandbox environment, no real money is involved!
During the course of the above steps, your game will call the Initialize() and Purchase() methods.
You will see the results during your sandbox testing, and UDP will also capture the results on its back-end.
The most confuse step is when running on a real device, also the test account I mean I have to use my Unity account here ?
I’m confused in this step. Also what about when my game don’t use IAP ?
Probably not necessary but do I really need IAP to use UDP ?
Yess! I wanted to ask the exact same question!
I’m using unity IAP, and selected Unity IAP->Android->“target Unity Distribution Portal (UDP)”
I uploaded the latest apk binary to the UDP portal
However, it’s this step that confuses me:
Use your UDP Sandbox Test account credentials to log in.
When launch the app nothing happens, and in the debug console I just get a message that IAP is not initialized.
The code I’m using was tested for google play and ios iaps and there it worked
I added my gmail email that device uses to the sandbox accounts in the UDP dashboard.
How do I get this magical UDP sandbox login screen?
08-24 16:43:13.963 25037-25056/? I/Unity: UnityIAP Version: 1.23.5
08-24 16:43:14.113 25037-25056/? I/Unity: IAP OnInitializeFailed InitializationFailureReason:AppNotKnown```
I've been comparing all the ID's in the UDP settings and in the dashboard, all seem to match up ( unity project ID, client ID, Client key, etc), but for whatever reason the "game ID" is different, however there is no way to change it in either unity or the dashboard
public class InitListener : IInitListener
{
public void OnInitialized(UserInfo userInfo)
{
Debug.Log("Initialization succeeded");
// You can call the QueryInventory method here
// to check whether there are purchases that haven’t be consumed.
}
public void OnInitializeFailed(string message)
{
Debug.Log("Initialization failed: " + message);
}
}```
After this the game will show up a new view to write your email and password that you manually set in the UDP console (the website).
Too bad App Gallery will demand to be a premium App or must have IAP to publis via UDP.
So after completed all the steps I cannot publish my app because of that.
In this case I cannot upload my game because it's not a premium app or don't have IAP.
This is really strange - the manual clearly states to use one implementation, either Unity’s IAP or the UDP code but not to mix them. I tried adding your code and also
StoreService.Initialize(this);
However, now I’m getting this error when running the app on the device:
I tried importing/installing UDP from both the package manager and IAP store, and it gives this error.
I tried adding
android:name="UDP_SDK_VERSION"
android:value="2.0.0" />
<meta-data
android:name="UDP_SDK_DIST"
android:value="unityiap" />```
but that didn't help - that just gave the error that this was already added somewhere
Hi yuriythebest, you should be only using either the UDP SDK or Unity IAP package. If you are using Unity IAP package currently, please update to the latest version and reinstall again. It should guide you through to install the UDP package along the update.
Hi!
If I did try using the Unity IAP code previously but got this error: InitializationFailureReason:AppNotKnown
Hi Unity - Chiboon!
Is Unity IAP for UDP currently actually supported? When using Unity IAP, should the “log into sandbox” dialog actually appear or is that only for the UDP SDK? Use your UDP Sandbox Test account credentials to log in.
Should the UDP SDK be present, but not used, when using Unity IAP?
Should be added to the androidmanifest in the case of using UDP SDK?
I use unity 2018.4.10f and the latest version of Unity IAP / UDP SDK ( I was trying both since neither worked), is this version of unity supported? I do get the option of “target UDP” in the unity IAP settings
Okay, trying it again, the steps I did in my project was:
Delete all unity IAP/Unity SDK stuff
Added Unity IAP through services. It complained that stuff was missing so had to add unity IAP in the package manager as well.
3). Now getting this error:
Unable to resolve reference 'UDP'. Is the assembly missing or incompatible with the current platform?
Reference validation can be disabled in the Plugin Inspector.```
4) because of #3, I had to install UDP: I clicked the imported UDP unitypackage that appeared when I imported unity IAP from services
note: I had to install by clicking the packages, since the Install UDP dialog kept freezing
**Result1:** When I set Unity IAP’s Target to Google Play I get the error NoProductsAvailable - fair enough, since I added them specifically for the UDP Version
**Result2:** When I set Unity IAP’s Target to UDP, I get
```IAP OnInitializeFailed InitializationFailureReason:AppNotKnown```
I rechecked all the settings and compared the UDP settings in the dashboard and project,
and the Game ID is different, all other things are the same, and there is no way to change the Game ID. Could this issue be because of the Game ID, and if so how do I change it?
![6250956--688944--FullSettings-1.png|1824x1763](upload://vISAPyjdeIPQRJ2XuK0nq0cDHLk.png)
Okay, Small update if anyone has this same issue: I tried creating an empty project in 2020.1.3 and just installed unity IAP/configured the UDP settings inside unity, added a test iap from inside unity and now the UDP sandbox screen magically appears!! I’m able to login and make the test purchase ( it’s only visible in the android studio logcat but returns purchase succeeded)
EDIT: To anyone else having this issue, I was able to solve this by creating an empty project and setting everything up as described above, then go to my old project and export everything as a unitypackage, and import into the new project.
The UDP Sandbox login thing is real, and should appear at the very start of your app if everything works. I tested it using Unity IAP
Also not sure if it somehow “helped”, but I also changed my iaps from “myiapname” to “com.myapp.myiapname” but not sure if this was critical
Well, after struggling with this for a while because the documentation wasnt very helpful (unclear, typos in the code etc). Here is the solution of “Initializing the UDP SDK” for newbies :
Create a new C# file (the file name is not important) and put the following code inside (the code from the documentation contains some errors that I fixed btw) :
using UnityEngine;
using UnityEngine.UDP;
public class InitListener : IInitListener
{
public void OnInitialized(UserInfo userInfo)
{
Debug.Log("Initialization succeeded");
// You can call the QueryInventory method here
// to check whether there are purchases that haven’t be consumed.
}
public void OnInitializeFailed(string message)
{
Debug.Log("Initialization failed: " + message);
}
}
Now go to your game main file and add using UnityEngine.UDP; at the top then put the following code in the Awake() or Start() method. In my case, I have a GameManager file that handle the game cycle, so I put this code inside its Awake() method.
# Instantiate the listener
IInitListener listener = new InitListener();
# Use the listener to initialize the UDP stuff
StoreService.Initialize(listener);
Finally, build your project and run it on a real device (emulators may work but not the unity simulator). when the game launches you will be prompted by the UDP authentication dialog. Use the Sand box test account(s) to login and voilĂ !
I am implementing UDP via Unity IAP and when I try to select “Window → Unity IAP → Android → Target Unity Distribution Portal” I am getting the following response:
And when I am trying to import UDP package from package manager then getting the response as shown in the attached screenshot. Don’t know what to do next