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.

Launching Drive Add-Ins

Geotab Drive Add-Ins will also display differently, on both the dashboard and the menu.

Drive dashboard

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:

Listing 1 - Geotab Drive "item" configuration

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.

  1. onStartup: Startup Add-Ins are executed when a driver logs in to the Drive App for the first time.
  2. onShutdown: The onShutdown property must be set to true to execute an Add-In when logging out of Geotab Drive.

More information about these 2 methods can be found in this document.

e.g.

Opening third-party applications using URI schema

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

Opening Geotab Drive from third-party applications (aka deep linking)

On Android and iOS devices with the Geotab Drive app installed, a URL handler is registered which can:

  • Launch Drive
  • Navigate to a specified page in Drive
  • Automatically log into Drive with a token (session ID, user name, and database name) retrieved by authenticating against MyGeotab's API in a third-party app

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.

Single sign-on

Automatic login and single sign-on

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:

ParameterExample
UserNamejoe@mycompany.com
Session ID1234567
Database namemy_company
Server namemy.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).

Both the Authenticate() and AuthenticateSaml() API calls return a LoginResult object, containing the credentials (database, userName, and sessionId) and the server name.

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.

Codrivers

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.

Pages & Parameters

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/drive

And then navigating around until the desired page is found. For instance, getting the HOS main page:

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.

In this section, the doc outlined how to pre-authenticate so the driver will be able to instantly launch, login, and visit the target page with one tap.

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:

HOS verify logs

The deep link URL in this case would look something like:

The URL parameters are formatted in Rison, a representation of JSON data which is URL-safe.

Forcing the login workflow

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:

Drive login workflow

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:

Examples

PageDeep link URL
Bring app to foreground on current page; or launch appgeotabdrive://
Maingeotabdrive://main
HOS Maingeotabdrive://hos
HOS Logsgeotabdrive://hos/logs
HOS Graphgeotabdrive://hos/graph
DVIR Maingeotabdrive://dvir
Messages Maingeotabdrive://messaging
Force login workflowgeotabdrive://login
DVIR Logs with workflowgeotabdrive://login,(next:dvir/main)
HOS Verify with workflowgeotabdrive://login,(next:'hos/logs,(verifyOnly:true)')
Automatic logingeotabdrive://login,(credentials:(database:'my_company',userName:'joe@mycompany.com',sessionId:'1234567'),server:'my12.geotab.com')
Automatic login with HOS Main as the target pagegeotabdrive://hos,(credentials:(database:'my_company',userName:'joe@mycompany.com',sessionId:'1234567'),server:'my12.geotab.com')

Encoding Deep Links on iOS

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.

App-bound domains

App-Bound Domains on iOS

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.

App-Bound domain error screen

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.