Closed giladrom closed 6 years ago
there is no DIV element to attach to ...
You have to specify div that is under the body.
The DIV is there. If you read my report you will see that this only happens when the app is started in the background.
the app is started in the background.
Not supported.
Not supported.
This is not a support request, just something you could add to the documentation to make sure people don't waste time on this like I did. Maybe someone else can find this useful.
Yes, I understand. There is no same report so far, and you don't provide enough crash log (logcat). So I just say, thank you for reporting.
I'm submitting a ... (check one with "x")
If you choose 'problem or bug report', please select OS: (check one with "x")
cordova information: (run
$> cordova plugin list
)Current behavior:
This is just a solution description to help anyone else who might be encountering this problem (Not sure it's a bug) - when developing an Ionic/Cordova app that has any kind of background activity which might cause the app to "wake up" in the background (iBeacon, for example) after it has been terminated by the user or iOS, and attempt to initialize the map inside ionViewDidLoad(), the plugin will crash with the following error after about 30 seconds (retrieved from Ionic Pro console, only generic error in the logs):
This happens because there is no DIV element to attach to, even though the app itself is running, and the map appears to have been initialized successfully and without an error.
The solution is to only initialize the app when ionViewDidEnter() is called, and not on ionViewDidLoad() like in the example on the main page. For example, use an Observable to initialize the map view when the page is first opened:
Related code, data or error log (please format your code or data):