I insert the book demo package and set my own keys in it.
When I scanned the image it showed
Error downloading json
UnityEngine.Debug:LogError(Object)
<LoadJSONBookData>c__Iterator0:MoveNext() (at Assets/scripts/ContentManager.cs:285)
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
I added a log on the json object.
Debug.Log(mJsonBookInfo.text);
And the object contain the json values.
{
"title":"Principles of Computer Vision",
"author":"Fernando Dines",
"average rating":"4",
"# of ratings":"30",
"list price":"39.99",
"your price":"21.99",
"targetid":"95043ce3562046da82e7e0798b6e9660",
"thumburl":"https://developer.vuforia.com/samples/cloudreco/thumbs/02_thumbnail.png",
"bookurl":"https://developer.vuforia.com/samples/cloudreco/book2.html"
}
UnityEngine.Debug:Log(Object)
<LoadJSONBookData>c__Iterator0:MoveNext() (at Assets/scripts/ContentManager.cs:284)
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
Therefore, i assume the json is downloaded.
I do not know why it shows the error. please help!
hello,I can solve this problem.If the download is success,error will return null or an empty string.But some platforms don't allow empty string.So it's better to use String.IsNullOrEmpty to check the error.In this case,you should change mJsonBookInfo.error==null and mBookThumb.error==null to string.IsNullOrEmpty(mJsonBookInfo.error) and string.IsNullOrEmpty(mBookThumb.error).