Forum Scripting work fine on emulator,but failed on real phone

Post your problems and discussions relating to scripting in Unity here.

work fine on emulator,but failed on real phone

Postby Eee721 » May 10th, 2020, 5:13 pm

hi guys:
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 ?
Attachments
微信图片_20200511001013.jpg
error
微信图片_20200511001013.jpg (536.92 KiB) Viewed 13964 times
Eee721
 
Posts: 2
Joined: March 31st, 2020, 5:27 am

Re: work fine on emulator,but failed on real phone

Postby Eee721 » May 11th, 2020, 7:07 am

Eee721
 
Posts: 2
Joined: March 31st, 2020, 5:27 am


Return to Scripting



cron