Closed Krishna25Vrinsoft closed 7 years ago
Launch Mode is only available on Android, so not defined in the iOS version of the plugin. You can eliminate the error with:
launchMode: launchnavigator.LAUNCH_MODE ? launchnavigator.LAUNCH_MODE.MAPS : null
Yes. Thanks a lot
I will define launchnavigator.LAUNCH_MODE
as an empty object on iOS and Windows in the next release, so launchnavigator.LAUNCH_MODE.MAPS
will evaluate to undefined
without raising an exception.
launchnavigator.isAppAvailable(application, function (isAvailable) { if (!isAvailable) { application = launchnavigator.APP.GOOGLE_MAPS; } launchnavigator.navigate(coords, { successCallback: function () { console.log("Launched navigator app"); }, errorCallback: function (err) { console.log("Error launching navigator app: " + err); }, app: application, transportMode: launchnavigator.TRANSPORT_MODE.DRIVING, launchMode: launchnavigator.LAUNCH_MODE.MAPS }); });
This is my code. I got bellow error when run in iOS. TypeError: undefined is not an object (evaluating 'launchnavigator.LAUNCH_MODE.MAPS')