All Add-Ins that have been designed to work with MyGeotab will work on the Geotab Drive app as well. Your Add-In will be completely downloaded for all referenced links, images, and scripts upon user login. This way, as the user is authenticated over the internet - they will have your Add-In with them as they travel or disconnect from the network. If your Add-In requires dynamic loading of CSS, images, or JavaScript - these requests will fail if the user does not have a network connection. As such you should either: include all dependencies on creation of the Add-In, explicitly link to them, or provide a fallback if state.online returns False.
Geotab Drive Add-Ins will also display differently, on both the dashboard and the menu.
To make an Add-In on the Geotab Drive app, the item in your configuration file must have a path that equals "DriveAppLink/" (including a trailing forward slash). The menuName, url, and version will remain unchanged. For example:
The array of items also allows you to have one link item in MyGeotab, and another link item to Geotab Drive
There are also 2 additional properties that are optional for the configuration file that control the availability to additional page lifecycle methods, onStartup and onShutdown. These configuration properties are boolean, they can be set to true if they are to be used and false when not in use. By default these 2 properties will be set to false if not included in the configuration file.
More information about these 2 methods can be found in this document.
e.g.
Drive app v4.1.0+
It's possible to open different applications like prontoforms or native calendar from Add-Ins. To do so, it's important to construct correct URI schema string and pass it to window.open
.
For example:
Make sure to read carefully documentation of the app you're trying to open to use correct schema. For example, to open twitter application from Add-In you should use:
You can't use just twitter://
as it's not correct and app won't open. You need to specify which page you want to open: messages
, account
etc.
To open webpage you need to use the same method, but with this notation:
_blank
is important, especially for iOS devices
On Android and iOS devices with the Geotab Drive app installed, a URL handler is registered which can:
Deep linking is used to provide a seamless link from a third-party app into the Geotab Drive app.
On the most basic level, launching Geotab Drive to the main screen, can be executed by creating a link to:
From there, it's possible to automatically login and/or link to specific modules or pages of the Geotab Drive app.
For more information on how to automatically log in, enable single sign-on, and navigate to desired pages on the Geotab Drive app, please refer to the Single sign-on section below.
If the application is newly installed (the driver has not previously logged in) or the authentication is handled by a 3rd party application, it's possible to login using the geotabdrive://
link. This prevents a driver from having to enter their login information twice.
Note that automated login will always direct the driver through the login workflow as per regulations
The required parameters to automatically login are:
Parameter | Example |
---|---|
UserName | joe@mycompany.com |
Session ID | 1234567 |
Database name | my_company |
Server name | my.geotab.com |
The session ID is obtained by authenticating against the MyGeotab API, which should be performed by the 3rd party application. This can be obtained using the standard Authenticate API call or, if you're using SAML, the authenticateSaml API call (refer to the SAML 2.0 Setup guide for more details).
Once these parameters are obtained, the URL can be constructed as follows, using the example information as above:
If there is a target page, add the 'next' parameter to the page parameters, like:
The above will log in the driver, direct them through the login workflow (selecting vehicle, performing DVIR), and then end up at the target page.
To login a co-driver, if there's already a driver logged in, then by triggering a geotabdrive://
scheme URL with a new driver's session it will log them in as a co-driver.
There isn't an API available to discover whether drivers are already logged in.
If the new driver's session is for a different database or server URL, then they will be rejected for automatic authentication.
The deep link URL follows the URL scheme found by using Geotab Drive in the browser, and as such, the URLs for pages can be found by first navigating to:
https://my.geotab.com/driveAnd then navigating around until the desired page is found. For instance, getting the HOS main page:
The URL fragment of interest here is the hos/main segment, which can then be used in the above deep link URL as:
If the driver is not currently logged in, they will be prompted to first, before being redirected to the target page.
For an example of how to pass page parameters to the page, the HOS Verify page uses a parameter “verifyOnly” to the main HOS Logs page. The URL fragment of interest as before now includes a parameter, in parentheses, separated from the main page name by a comma:
The deep link URL in this case would look something like:
Linking to the pages above using the deep link scheme does not force the user to use the login workflow if they are already logged in (for example, selecting vehicles and performing DVIR).
If the login workflow is required without using a target page, deep link to:
If the login workflow is required when using a target page, pass the target page as the “next” parameter to the login page:
The deep link URL would look like:
If a link is required to a page with parameters, the "next" value should be enclosed in apostrophes:
Page | Deep link URL |
---|---|
Bring app to foreground on current page; or launch app | geotabdrive:// |
Main | geotabdrive://main |
HOS Main | geotabdrive://hos |
HOS Logs | geotabdrive://hos/logs |
HOS Graph | geotabdrive://hos/graph |
DVIR Main | geotabdrive://dvir |
Messages Main | geotabdrive://messaging |
Force login workflow | geotabdrive://login |
DVIR Logs with workflow | geotabdrive://login,(next:dvir/main) |
HOS Verify with workflow | geotabdrive://login,(next:'hos/logs,(verifyOnly:true)') |
Automatic login | geotabdrive://login,(credentials:(database:'my_company',userName:'joe@mycompany.com',sessionId:'1234567'),server:'my12.geotab.com') |
Automatic login with HOS Main as the target page | geotabdrive://hos,(credentials:(database:'my_company',userName:'joe@mycompany.com',sessionId:'1234567'),server:'my12.geotab.com') |
Recent versions of iOS require encoding of deep links when they are used with the platform's URL class.
Use the addingPercentEncoding(withAllowedCharacters: .urlPathAllowed)
API to transform the path component of the link and append it to the geotabdrive://
scheme afterward.
Geotab Drive uses App-Bound Domains on iOS, boosting the privacy and security for its users. This feature ensures that when you're using the Geotab Drive app, it remains within Geotab's own websites and doesn't venture out to others that are not predefined—fortifying driver digital protection.
With App-Bound Domains, the primary web view of the Geotab Drive app will be blocked from loading any website not belonging to Geotab's designated domains, such as those under geotab.com. If the web view tries to navigate to a site outside of the allowed domains, an error message will pop up.
Note that this domain-bound restriction is specific to direct navigation within the main web view—things like link clicks or script-directed changes to the web page address. Alternative elements like new browser windows, inline frames (iframes), or general web requests aren't affected by this restriction, although standard rules of web interaction still apply.
If you need your Add-In to go beyond the geotab.com domain within the web view, opting for an iframe or triggering a new browser window with window.open()
with a target set to _self
, could be the workaround.
Moreover, the native APIs that Geotab apps inject into web views are only accessible on the bound domains on the main web view. Consequently, any Add-In running in an iframe or a new window won't be able to tap into the api.mobile JavaScript API.