在 React Native 中使用 Android 的 Intent 进行 Deeplinking。代码示例如下:
import { Linking } from 'react-native';
const goToDeeplink = async () => {
const supported = await Linking.canOpenURL('myapp://deeplink');
if (supported) {
await Linking.openURL('myapp://deeplink');
} else {
Alert.alert('Error', 'Deeplink is not supported on your device');
}
};