handle notification type and navigate using deeplinking
This commit is contained in:
@@ -21,58 +21,70 @@ import ManagementTabNavigation from "../screens/management/ManagementTabNavigati
|
||||
import TransactionsList from "../screens/transaction/TransactionList";
|
||||
import RandomSelectUserScreen from "../screens/management/RandomSelectUserScreen";
|
||||
import Notification from "../screens/notification/Notification";
|
||||
import ManagementScreen from "../screens/management/ManagementScreen";
|
||||
|
||||
export type RootStackParamList = {
|
||||
Splash: undefined;
|
||||
Login: undefined;
|
||||
OtpVarify: { mobile: string };
|
||||
Home: undefined;
|
||||
HomeTabs: undefined;
|
||||
OrganizerRegister: undefined;
|
||||
Profile: undefined;
|
||||
GroupCreation: undefined;
|
||||
GroupReview: undefined;
|
||||
EditGroup: { groupId: string | number };
|
||||
GroupDetails: { item:object };
|
||||
GroupDetails: { item: object };
|
||||
BecomeOrg: undefined;
|
||||
YourContacts: undefined;
|
||||
Transaction: undefined;
|
||||
EditBankDetails: { currentBankName: string | null; currentAccountNumber: string | null; currentBranchCode: string | null };
|
||||
ManageJoinedGroup: { groupId: string | number };
|
||||
Invite: { groupId: string | number; code: string | number };
|
||||
ManagementTabs:{ groupId: string | number;}
|
||||
TransactionList:undefined
|
||||
ManagementTabs: { groupId: string | number; }
|
||||
TransactionList: undefined
|
||||
RandomSelectUserScreen: { groupId: string | number, cycleNumber: number };
|
||||
Notification:undefined
|
||||
Notification: undefined;
|
||||
Management:
|
||||
| { actionTab: "My Groups" }
|
||||
| { actionTab1: "Joined Groups" }
|
||||
| { actionTab2: "Requests" }
|
||||
| { actionTab3: "Your Requests" };
|
||||
};
|
||||
|
||||
const Stack = createNativeStackNavigator<RootStackParamList>();
|
||||
|
||||
export default function AppNavigator() {
|
||||
const linking = {
|
||||
prefixes: [
|
||||
"myapp://", // Your custom scheme
|
||||
"https://your-production-domain.com" // Your website for Universal Links/App Links
|
||||
],
|
||||
config: {
|
||||
screens: {
|
||||
// Define the route for the InviteScreen
|
||||
Invite: {
|
||||
// This path matches the part after the "://" and before the "?"
|
||||
path: "invite",
|
||||
const linking = {
|
||||
prefixes: [
|
||||
"myapp://", // Your custom scheme
|
||||
"https://your-production-domain.com" // Your website for Universal Links/App Links
|
||||
],
|
||||
config: {
|
||||
screens: {
|
||||
// Define the route for the InviteScreen
|
||||
Invite: {
|
||||
// This path matches the part after the "://" and before the "?"
|
||||
path: "invite",
|
||||
|
||||
// This block tells React Navigation how to handle the query parameters
|
||||
parse: {
|
||||
groupId: (groupId: string | number) => `${groupId}`,
|
||||
code: (code: string | number) => `${code}`,
|
||||
// This block tells React Navigation how to handle the query parameters
|
||||
parse: {
|
||||
groupId: (groupId: string | number) => `${groupId}`,
|
||||
code: (code: string | number) => `${code}`,
|
||||
},
|
||||
},
|
||||
// Add deep linking for notification screens
|
||||
ContributionDetails: "contribution/:contributionId",
|
||||
GroupDetails: "group/:groupId",
|
||||
CycleCompleted: "cycle/completed/:groupId/:cycleNumber",
|
||||
// Add other notification screens as needed
|
||||
// Add other notification screens as needed
|
||||
// Other screens in your navigator can be defined here
|
||||
// e.g., GroupDetails: "group/:id"
|
||||
|
||||
|
||||
},
|
||||
|
||||
// Other screens in your navigator can be defined here
|
||||
// e.g., GroupDetails: "group/:id"
|
||||
},
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
return (
|
||||
@@ -98,6 +110,7 @@ const linking = {
|
||||
<Stack.Screen name="TransactionList" component={TransactionsList} options={{ headerShown: false }} />
|
||||
<Stack.Screen name="RandomSelectUserScreen" component={RandomSelectUserScreen} options={{ headerShown: false }} />
|
||||
<Stack.Screen name="Notification" component={Notification} options={{ headerShown: false }} />
|
||||
<Stack.Screen name="Management" component={ManagementScreen} options={{ headerShown: false }} />
|
||||
</Stack.Navigator>
|
||||
</NavigationContainer>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user