Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Minor

This article describes how to set up Smart ID Mobile Appor an app based on the Smart ID Mobile SDK, to start from another application on the same device. 

...

Prerequisites

The app that is intended to start Smart ID Mobile App must have registered a url-scheme, as described in the article.

...

Add code to start app on idle screen

To open Smart ID Mobile App on the idle screen, waiting for requests:

...

For an authentication or signing message to show up in Smart ID Mobile App, an authentication or signing request first need to be sent

...

to the Hermod Messaging Server or Smart ID Digital Access (Hybrid Access Gateway). 

For more information on how to send authentication and signing requests to Hermod Messaging Server, see here.

  1. Add the following code to start Smart ID Mobile App directly from another app on the same device:

    Code Block
    languagetext
    <URL-Scheme>://start?<Parameter>=<Value>

    For parameter options, see Personal protocol specification.

    Example with a title and a redirect to my-redirect-URL://:

...

...

  1. Example: start app with title and redirect

    Code Block
    languagetext
    personal://start?title=My+title&redirect=my-redirect-URL%3A%2F%2F 

...

Add code to start app for provisioning

To open Smart ID Mobile App for provisioning a new mobile virtual smart card for a user:

  1. Add the following code to start Smart ID Mobile App directly from another app on the same device:

    Code Block
    languagetext
    <URL-Scheme>://<Link to message>?<Parameter>=<Value>

    For parameter options, see Personal protocol specification.

    Example with a <link to message>, a title and a redirect to my-redirect-URL://:

...

...

  1. Example: start app for provisioning with title and redirect

    Code Block
    languagetext
    personal://<my-hermod-host>/hermod/rest/ms/ee2fec93-5daf-436f-b7d2-32a7ff86fe75/0573a28d-ecfa-480d-ade6-11d2144953a8?title=My+title&redirect=my-redirect-URL%3A%2F%2F 

...

Examples

Example: Link in html
Example: Link in html
Code Block
languagexml
title
<a href="bank-app://<my-hermod-host>/hermod/rest/ms/ee2fec93-5daf-436f-b7d2-32a7ff86fe75/0573a28d-ecfa-480d-ade6-11d2144953a8?title=My+title&redirect=<my-redirect-URL>">Open with Bank App</a>
Example: Link in JavaScript
var startURL = 'bank-app://start'
window.location.replace(startURL);
title
Code Block
languagejs
titleExample: Link in JavaScript
Code Block
Example: Link in Swift 3 for iOS 8-10
Code Block
let redirect = "bank-app://start".addingPercentEncoding(withAllowedCharacters: .alphanumerics)!
let scheme = "bank-app://start?redirect=\(redirect)"

if let url = URL(string: scheme) {
    if #available(iOS 10, *) {
        let options = [UIApplicationOpenURLOptionUniversalLinksOnly : true]
        UIApplication.shared.open(url, options: options, completionHandler: {
            (success) in
            print("Open \(scheme): \(success)")
            // handle error or success contitions
        })
    } else {
        let success = UIApplication.shared.openURL(url)
        print("Open \(scheme): \(success)")
        // handle error or success contitions
    }
}

Personal protocol specification

...

General syntax

The general syntax to start Smart ID Mobile App is the following: 

title
Code Block
<URL-Scheme>://<Message>?<Parameter1>=<Value1>[&<Parameter2>=<Value2>]
Expand

<URL-Scheme>

The available values for <URL-Scheme> are described in this table:

<URL-Scheme> option

Description

personal

for the standard Smart ID Mobile App

<my-app-name>

for apps based on the Smart ID Mobile SDK

...


<Message>

The available values for <Message> are described in this table:

<Message> option

Description

start

Starts the app on the idle screen, to wait for requests.

<Link to message>

Starts the app for provisioning, to handle the request in the package.

The <Link to message> is the part after https:// in a normal provision request link.
The app automatically appends https:// before the request is made.

Example: <Link to message>
Code Block
languagetext

...

personal://<my-hermod-host>/hermod/rest/ms/ee2fec93-5daf-436f-b7d2-32a7ff86fe75/0573a28d-ecfa-480d-ade6-11d2144953a8?title=My+title&redirect=<my-redirect-URL>
Info

...

Other message types

The functionality to open a link to an authentication or signing request is not yet implemented.

...

...

<Parameter>=<Value>

The available values for

...

<Parameter> and

...

<Value> are described in this table. Two parameters can be used, separated by '&':

...

<Parameter>=<Value> option

Description

title=<string>

<string> is a URL-encoded string that the app shows to the user while waiting for the request to complete.

redirect=<my-redirect-URL>

Makes the app return to the

...

<my-redirect-

...

URL> after first confirmation is done (Provision, Authentication or Signature).
Failure to open the

...

<my-redirect-URL> means that the user will stay in the personal app.

<my-redirect-URL> is a URL-encoded string to allow return parameters if required.

Example:
redirect=googlechrome://mail.google.com
This will open the chrome browser app, if it is available, and browse to gmail. If chrome is not available, it will fail.