Error saving user score on android device

0 votes
Hi!
 
I got a error when I try to save user score (scoreBoardService.SaveUserScore(gameName, nickName, score);) .
This error only happens on an android device
 
Running the game/code on Unity/Windows everything is ok
 
Could you help me pls? 
 
android version: 4.4.2
unity version: 4.5.2f1
 
Log error below:
 
I/Unity   (20458):
I/Unity   (20458): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49)
I/Unity   (20458):
I/Unity   (20458): Configuration Properties https://api.shephertz.com/cloud/
I/Unity   (20458):
I/Unity   (20458): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49)
I/Unity   (20458):
I/Unity   (20458): apiKeybcdf90841a7e2deb12a98bc484af5c8f869043a744101e2f4f10c473ba983fe5body{"app42":{"game":{"name":"teste","scores":{"score":{"value":-22,"userName":"a"}}}}}timeStamp2014-08-03T00:0
9:51.209Zversion1.0
I/Unity   (20458):
I/Unity   (20458): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49)
I/Unity   (20458):
E/Watchdog(24687): !@Sync 6654
I/Unity   (20458):  QueryString is ?
I/Unity   (20458):
I/Unity   (20458): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49)
I/Unity   (20458):
I/Unity   (20458):
I/Unity   (20458): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49)
I/Unity   (20458):
D/STATUSBAR-NetworkController(24960): refreshSignalCluster - setNWBoosterIndicators(false)
D/STATUSBAR-NetworkController(24960): refreshSignalCluster: data=0 bt=false
D/STATUSBAR-IconMerger(24960): checkOverflow(912), More:false, Req:false Child:3
D/STATUSBAR-NetworkController(24960): refreshSignalCluster - setNWBoosterIndicators(false)
D/STATUSBAR-NetworkController(24960): refreshSignalCluster: data=0 bt=false
D/STATUSBAR-IconMerger(24960): checkOverflow(912), More:false, Req:false Child:3
E/Unity   (20458): Unable to find /System/Library/Frameworks/Security.framework/Security
E/Unity   (20458): Unable to find /System/Library/Frameworks/Security.framework/Security
I/Unity   (20458): WebException: Error writing request: The authentication or decryption has failed.
I/Unity   (20458):   at System.Net.WebConnectionStream.WriteHeaders () [0x00000] in <filename unknown>:0
I/Unity   (20458):   at System.Net.WebConnectionStream.SetHeaders (System.Byte[] buffer) [0x00000] in <filename unknown>:0
I/Unity   (20458):   at System.Net.HttpWebRequest.SendRequestHeaders (Boolean propagate_error) [0x00000] in <filename unknown>:0
I/Unity   (20458):
I/Unity   (20458): (Filename:  Line: -1)
I/Unity   (20458):
asked Aug 3, 2014 in App42 Cloud API-BaaS by alissonsalin (30 points)
edited Aug 3, 2014 by alissonsalin
I found a solution: Remove #if UNITY_EDITOR from Validator method and from
ServicePointManager.ServerCertificateValidationCallback = Validator; call

It works.

Could be a problem removing #if UNITY_EDITOR?

1 Answer

0 votes
 
Best answer
Hi Alis,
 
In sync method, we use .net library for making an https connection with App42. For a security reason, mono does not accept any https cert by default and you have to make the provision to make it accepted to Mono environment. That's why you need to validate the certificate for making a connection with App42 in Unity editor.
 
I would recommend you to use Asynchronous api instead of using synchronous. Kindly find the link for detail documentation for using leaderboard service in your app in asynchronous call.
 
Let me know if it answer your question.
Thanks.
answered Aug 4, 2014 by hs00105 (517 points)
selected Aug 4, 2014 by alissonsalin
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on support@shephertz.com
...