Linking.addEventListener not working on iOS standalone app

Hello,

I have a standalone iOS app with expo SDK ^26.0.0, react ^16.0.0 and react native https://github.com/expo/react-native/archive/sdk-26.0.0.tar.gz.

I’m trying to use a deep linking from the device browser to app my app. If the app is closed, Linking.getInitialURL() works well but if the app is already opened, Linking.addEventListener does not get triggered.

I don’t know what else to do, I’ve already read everything I have found about this issue but I’ve found no solution. This only happens on iOS because with Android is working just fine.

The code is just what the documentation says:

componentWillMount() {
        Linking.getInitialURL().then((url) => {
            if (url) {
                this.handleUrl(url);
            }
        });
        Linking.addEventListener('url', this.handleUrl);
    }

    componentWillUnmount() {
        Linking.removeEventListener('url', this.handleUrl);
    }

    handleUrl = (url) => {
        alert('url is : '+url);
    };

Thanks in advance!

1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.