Skip to content

Linking.openUrl not always working #1

@danielmocan

Description

@danielmocan

I'm trying to open a link from the React Native app.
For this, I'm using Linking from react-native package.

The problem is that only sometimes opens the link. In other cases it does nothing.

I also change the <Text> component with a <TouchableOpacity> but its still the same issue.
The problem is not from the if check, because the url its always valid ( and to falsy )

Anyone else had the same issue, any ideas to fix this issue?

Code Sample

  handlerOpenLink = url => {
    if (url) {
      Linking.openURL(url);
    } else {
      Alert.alert( "some message" );
    }
  };

return 
   <View>
     <Text
        onPress={ () => this.handlerOpenLink(url)}
      >
        Open Link
      </Text>
   </View>

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions