Apple Widget Integration (Swift)

We have created a demo application for which uses our widget for authentication:

https://github.com/tryterra/Swift-Integration For aid on development on integration with our Widget on iOS (Swift), please make sure you understand how our widget works here.

Using BetterSafariView

Using a public library called BetterSafariView for the SFSafariViewController class in Swift makes it easier to implement the authentication process with Widget. Find out more here.

Sample usage:

Swift





Constructing the Widget Model

You should first create a model for the Webview as such:

Widget Model

The link should be generated within your backend and passed to create this widget model in the form: https://widget.tryterra.co/session/<SESSION_ID>

This model will hold all the relevant information pertaining to the Widget session

Constructing the WebView Object

As WebViewTerra conforms to an ObservableObject, you will be able to declare a WebView Object with an ObservableObject variable WebViewTerra as such:

WebView Object