microsoft / MapsSDK-Unity

This repository contains samples, documentation, and supporting scripts for Maps SDK, a Microsoft Garage project.
MIT License
648 stars 127 forks source link

Map Session failing during initialization will never try to restore itself automatically #190

Closed Kiwithepaladin closed 6 months ago

Kiwithepaladin commented 1 year ago

Describe the bug MapSession wont ever attempt to re-initialize itself. In essence, if your initialization yields an a network error, You will need to "manualy" resolve it (I.E: reloading the scene)

To Reproduce

Expected behavior I would Expect one of few things to happen:

Screenshots Screenshot_20221205_155020

Environment:

Additional context Marked as bug report however can be also considered a feature request, not enirelty sure if current behaviour is by design.

kircher1 commented 1 year ago

Right, if the map starts offline, there's no automatic connection retry. Unless you are using custom data purely offline, the device needs an active internet connection.

To immediately work around this, you may try hooking into Unity's log events and when intercepting a message like this, you could tear down the MapSession and try and recreate it at some point in the future? Sort of a DIY retry. I think this is the Unity log callback: https://docs.unity3d.com/ScriptReference/Application-logMessageReceived.html