Skip to content

InAppBrowserNotify example#13

Open
pedroabdenor wants to merge 1 commit intomainfrom
in-app-browser-notify-example
Open

InAppBrowserNotify example#13
pedroabdenor wants to merge 1 commit intomainfrom
in-app-browser-notify-example

Conversation

@pedroabdenor
Copy link
Collaborator

@pedroabdenor pedroabdenor commented May 9, 2023

This draft PR is meant to demonstrate an alternative method for handling OAuth login flows using the InAppBrowserNotify option for the metadata.integrationContext property of the Trustly SDK's Establish Data parameter.

In this example, rather than listening for the window.open event in the native application, the Trustly SDK's addPanelListener function is utilized to manually send a message from the web page to the native application.

In this example, the WebKit MessageHandler interface is used to post a message to the iOS app. See the react-app/src/App.js file for more details. However, any method appropriate to communicate with your native applications from this panel listener callback function can be used.

Finally, your native application will need to receive the message and carry on with the secure authentication session implementation. In this example the WKScriptMessageHandler class is used to detect the message and build the ASWebAuthenticationSession. See the ViewController file for more details.

Note: the Android app in this example repository has not been modified to integrate with this variation. If you require assistance with Android implementation, please open an issue in this repository or reach out to your Trustly support team member.

Copy link
Contributor

@marcosrivereto marcosrivereto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@pedroabdenor pedroabdenor marked this pull request as ready for review October 9, 2025 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants