i'm making a turn base game on unity 2018.4.11 and use playerIO as server.
everything works fine until making apk and running on my 2 android phone.
my auth code as below:
- Code: Select all
#if UNITY_EDITOR
//var deviceId = SystemInfo.deviceUniqueIdentifier;
//var deviceId = Path.GetFileName(Path.GetDirectoryName(Path.GetDirectoryName(Application.dataPath))) + "_" + FakeUser.user_device_id_tail;
var deviceId = "a2354a1b60072487b2757f9279bfbbc9";//SystemInfo.deviceUniqueIdentifier;
#else
var deviceId = "a2354a1b60072487b2757f9279bfbbc9";//SystemInfo.deviceUniqueIdentifier;
#endif
var authvalue = Create(deviceId, "trumpisabadperson");
Debug.LogFormat("deviceid : {0} , auth :{1}", deviceId , authvalue);
PlayerIO.Authenticate(
"advancewar3d-XXXXXXXX", //Your game id
"public", //Your connection id
new Dictionary<string, string> { //Authentication arguments
{ "userId", deviceId },
{ "auth", authvalue},
},
......
it's works fine on unity editor (2018.4.11) and android emulator.
but when lunch on real android phone ,it failed on auth.
How can i fix this problem ?