Skip to content
This repository has been archived by the owner on Mar 12, 2020. It is now read-only.

LaunchUri override is not working on 1.3.2 #191

Open
mitsuruog opened this issue Mar 20, 2019 · 1 comment
Open

LaunchUri override is not working on 1.3.2 #191

mitsuruog opened this issue Mar 20, 2019 · 1 comment

Comments

@mitsuruog
Copy link

mitsuruog commented Mar 20, 2019

Environment:

  • amazon-cognito-auth-js: 1.3.2
  • react-native: 0.58.1

I tried to use this project on react-native. and tried to use "LaunchUrl override functionality".
My code is something like this:

import { Linking } from 'react-native';
import { CognitoAuth } from 'amazon-cognito-auth-js';

const config = {
    // ... other options here
    LaunchUri: (uri) => Linking.openURL(uri),
};

const client = new CognitoAuth(config);

But, LaunchUrl persists refer to window.open. It seems not working on 1.3.2.

So, I finally found the issue that the /lib folder still refer to 1.3.1.
I wonder you just forgot to replace under /lib when publishing 1.3.2...?

Thanks.

@schellack
Copy link

I am able to override the LaunchUri with react-native by setting LaunchUri like this:

const config = {
    // ... other options here
    LaunchUri: async url => {
        const result = await WebBrowser.openAuthSessionAsync(url, signInUrl);
        // do stuff with the result
    }

Note that I am using Expo.WebBrowser instead of Expo.Linking so that my app opens a web browser within the app instead of kicking the user out to the device's browser app.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants