Launch External Urls, Google Maps & Device Timers
Launch External Urls, Google Maps & Device Timers
Use this component to launch google maps based on passed address and latitude/longitude, and launch external urls via the browser. Device Timers are also available for looping actions
To get started using it, you must use KmpLauncher. All functions are thread safe and main thread safe.
Device Timers
KmpLauncher has two functions to invoke device timers. This allows you to pass an action that the device will run after a TimeSpan (in Seconds) that you pass it. So for example, to print a text into the Console every 2 seconds, you would use the following:
_5KmpLauncher.startTimerRepeating(2){_5 // returning false will stop the next iteration of the looping_5 // true continues to the next iteration (meaning the action continues looping)_5 return false_5}
To run an action that runs once, after a certain TimeSpan (Seconds) use the following. Below is an example, that runs the action after a 2 second delay, then stops.
_6KmpLauncher.startTimer(2){_6 // returning false will stop the next iteration of the looping_6 // true continues to the next iteration (meaning the action continues looping)_6_6 return false_6}
Launch Apple/Google Maps for Navigation
To launch the device's internal Google/Apple maps app for Navigation, please use the following:
_19/**_19* Launches the native maps app with directions. Navigates the user to address._19* @param address the full address to direct the user to_19* */_19KmpLauncher.launchExternalMapsAppWithAddress(_19 address: String,_19 markerTitle: String = ""_19)_19_19/**_19* Launches the native maps app with directions._19* @param latitude Latitude of the Address_19* @param longitude Longitude of the address_19* */_19KmpLauncher.launchExternalMapsAppWithCoordinates(_19 latitude: Double,_19 longitude: Double,_19 markerTitle: String = ""_19)
Launch External Urls or Device's Settings App
To launch any external url via the browser or share bottom sheet, please use:
_2KmpLauncher.launchExternalUrlViaBrowser(linkPath: String)_2KmpLauncher.launchExternalUrlViaAnyApp(linkPath: String)
To launch device's internal settings (where users can configure app permissions, or app settings):
_1KmpLauncher.launchAppInternalSettings()
Launch AppStore Review for your App
_4/**_4* Launches app via app store Link (iOS requires an app store Identifier to work)_4* */_4KmpLauncher.launchAppStoreViaIdentifier(appStoreLink: String)
Any Setup Required?
None