Log in or register to post comments

Cloud Reco: ICloudRecoEventHandler.OnInitError() not called when no net

August 16, 2016 - 1:11am #1

I implemented the ICloudRecoEventHandler interface and want my app to show an error message for the user in case initialisation failed due to no network access.

For that I expected that OnInitError(TargetFinder.InitState initError) of ICloudRecoEventHandler gets called and I could check the initError parameter for TargetFinder.InitState.INIT_ERROR_NO_NETWORK_CONNECTION.

However, To test my code I pulled the network cable from my PC to provoke the error. I run my project but OnInitError(TargetFinder.InitState initError) is not being called. Instead OnInitialized() is being called as if everything is alright.

I restarted unity to make sure this is not some strange caching issue but no matter what I do, the fact that there is no network available does not cause OnInitError(TargetFinder.InitState initError) to be called.

So my question is, is this a bug or do I misunderstand something here?

 

 

 

 

Cloud Reco: ICloudRecoEventHandler.OnInitError() not called when no net

August 18, 2016 - 10:30am #6

Hello,

Understood, and thanks for the information/clarifications.

Perhaps you already know this, but our Books sample app under Best Practices samples has a similar check for network connectivity in case you want to compare/contrast your design with ours.

https://developer.vuforia.com/downloads/samples

Thanks


Cloud Reco: ICloudRecoEventHandler.OnInitError() not called when no net

August 18, 2016 - 12:03am #5

Thank you for your reply.



Yes, you are right, I wrote Vuforia but ment CloudReco specifically. I'm still very confused about Vuforia's terminology since so far I could not find an overview of all it's components and how they relate to each other.

At some point I of course will test my app on an actual device. So far I never encountered a situation where unity's play mode produces different results than an app on a device would unless there is a specific reason for it. So I'm going to test this case on a device then.

I am not explicitly using Vuforia's API to check whether network is available. I just make sure I catch all possible points where things can fail. Since the API has a specific callback for failed initialisation and proviedes error codes, then this means that there is a possibility that this could be called and I want to handle this case and let the users know what happened. In this case I need to inform the user to check the network connection and then try to initialize again.

Cloud Reco: ICloudRecoEventHandler.OnInitError() not called when no net

August 17, 2016 - 10:53am #4

Hello,

Thanks for the clarification.

First, Vuforia does not require a network connection to initialize. The CloudReco feature requires an Internet connection and is the only Vuforia feature that does.

Additionally, I don't think it is best practice to evaluate how an app behaves in Unity PlayMode as being analogous to how an app will behave on an embedded device. PlayMode is a convenience feature to help shorten the development cycle by not requiring apps to be deployed to device. Much can be prototyped with it, but I would be cautious about evaluating API behavior (developed for embedded systems) on desktop hardware.

Lastly, I'm confused why you are looking to Vuforia API return codes for testing network connectivity. Seems to me that this could be done using OS APIs at any point in your apps logic.

Thanks.

Cloud Reco: ICloudRecoEventHandler.OnInitError() not called when no net

August 17, 2016 - 1:24am #3

I'm working on an App for android/iOS in Unity. I'm using a webcam while working in the unity editor. When I run my project in the editor with the network cable pulled the described behaviour occures.

My PC has no other network connection (my browser can not find any pages on the internet as long as the cable is pulled).

So there is as I see it truly no way vuforia could initialize correctly if network connection is a requirement for that. Later on I even get correct errors from OnUpdateError(TargetFinder.UpdateState updateError) with UPDATE_ERROR_NO_NETWORK_CONNECTION. But at that point it is to late. I'd rather know this upon initialisation.

I did not yet test this on an actual device because I expect the result to be the same (can not think of a reason so far why in unity editor this should be different).

 

Cloud Reco: ICloudRecoEventHandler.OnInitError() not called when no net

August 16, 2016 - 12:12pm #2

Hello,

I'm trying to better understand your configuration. Are you running the app on a device, which is bridged to the Internet via a PC? If so, this error code will not be returned as it is based more on the device's Wifi connectivity then it is on whether or not you can reach the server.

Thanks.

Log in or register to post comments