- if app in background
将打开特定屏幕。
- if app is not in background or kill the app
它只会显示第一个屏幕。
Linking.getInitialURL() 返回 null
如果您想在应用程序被终止或尚未启动的情况下进行重定向,请找到以下简单的解决方案:
// 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();
}, []);
*// 上面的解决方案对我有用
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)