[英]React Native - Deep linking is not working when app is not in background (Android, iOS)
specific screen will open.
特定屏幕将打开。
it will show first screen only.
它只会显示第一个屏幕。
Linking.getInitialURL() is return null
Linking.getInitialURL() 返回 null
If you want to do redirection in case of the app is kill or not yet launch, find the below simple solution:如果您想在应用程序被终止或尚未启动的情况下进行重定向,请找到以下简单的解决方案:
// Don't forget to import
import {
Linking
} from 'react-native';
useEffect(() => {
const getAsyncURL = async () => {
const initialUrl = await Linking.getInitialURL();
if (initialUrl != undefined && initialUrl != null){
// Handle initialURL as per your response and open a specific screen using navigation
}
};
getAsyncURL();
}, []);
* // The above solution is work for me * // 上面的解决方案对我有用
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.