0

我在我的一个 react-native expo 托管项目中使用了 expo 通知。现在我想使用深度链接功能处理通知点击事件。我想在单击通知时打开特定屏幕。

我的 app.js 文件如下所示:

import React from "react";
import { NavigationContainer } from "@react-navigation/native";
import * as Linking from "expo-linking";
import * as Notifications from "expo-notifications";
const App = () => {
Notifications.setNotificationHandler({
    handleNotification: async () => ({
      shouldShowAlert: true,
      shouldPlaySound: true,
      shouldSetBadge: false,
    }),
  });
return (
    <NavigationContainer>
       <HomeNavigator />
    </NavigationContainer>
   );
};

export default App;

我的 HomeNavigator 类似于以下内容:

<Stack.Navigator >
        <Stack.Screen
          name="Tabs"
          component={TabNavigator}
          options={{
            headerShown: false,
          }}
        />
        <Stack.Screen
          name={"Sign Up"}
          component={SignUpScreen}
          options={{ headerShown: false }}
        />
</Stack.Navigator >

我的 TabNavigator 类似于以下内容:

<Tab.Navigator>
    <Tab.Screen
        name="Home"
        component={HomeScreen}
      />
     <Tab.Screen
        name="Profile"
        component={ProfileScreen}
      />
</Tab.Navigator>

现在我想从两个不同的通知打开注册屏幕和个人资料屏幕。我在这里看到了我无法理解的博览会通知文档。任何人都可以提供一个教程/视频或小吃来解释我想要做什么吗?

4

0 回答 0