Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InAppBrowserNotify example #13

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

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.

👍

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