Embedding

This section will discuss embedding our application into your app using the embed method - the same approach is used for both Webview and Iframes.

Authentication

If authentication integration is required, the first step will be agree on the protocol that is used.

If standard authentication providers (such as ActiveDirectory, Google, Apple, Auth2, Keycloak etc) are being used in your app, then integration can be achieved by adding your existing authentication provider as a trusted provider in our system.

If your application is using email/password authentication, then most likely you will be using a standard library applicable for the framework that your backend is using e.g. Symfony, Laravel, Play, Spring, .NET etc. Covering all possibilities is beyond the scope of this documentation, but rest assured there will be a safe way to handle token exchange between our systems such that users will be able to authenticate without having to maintain separate lists of users.

Important

Please note that until your application is added as a trusted authentication provider, passing your tokens will have no effect, and our application will require users sign up.

iOS Webview

Below we show a code snippet that illustrate how simple it is to add the webview with our application embedded.

Note

The value of the url is: https://app.pen2click.com?embed=true&token=<usertoken>

The value of <usertoken> should be provided by your application if the user has already authenticated.

import UIKit
import WebKit


class ViewController: UIViewController, WKUIDelegate {

    var webView: WKWebView!

    override func loadView() {
        let webConfiguration = WKWebViewConfiguration()
        webView = WKWebView(frame: .zero, configuration: webConfiguration)
        webView.uiDelegate = self
        view = webView
    }


    override func viewDidLoad() {
        super.viewDidLoad()

        let myURL = URL(string:"https://app.pen2click.com?embed=true&token=<usertoken>")
        let myRequest = URLRequest(url: myURL!)
        webView.load(myRequest)
    }
}

More information can be found here:

Android Webview

A very clear explanation of how to add a webview to your Android app is given here:

More information about Android webviews is given here:

Note

The value of the url is: https://app.pen2click.com?embed=true&token=<usertoken>

The value of <usertoken> should be provided by your application if the user has already authenticated.

IFRAME

<html>
   ...
   <iframe src="https://app.pen2click.com?embed=true&token=<usertoken>"></iframe>
   ...
</html>

Note

The value of the url is: https://app.pen2click.com?embed=true&token=<usertoken>

The value of <usertoken> should be provided by your application if the user has already authenticated.