upd: push notifikasi

Deskripsi:
- blm selesai

No Issues
This commit is contained in:
amel
2025-06-18 17:27:03 +08:00
parent 94901e8ec1
commit 56cc74ed19
7 changed files with 101 additions and 9 deletions

View File

@@ -11,10 +11,20 @@ import store from "@/lib/store";
import { useAuthSession } from "@/providers/AuthProvider";
import { Redirect, router, Stack } from "expo-router";
import { StatusBar } from 'expo-status-bar';
import { Text } from "react-native";
import { useEffect } from "react";
import { Alert, Text } from "react-native";
import { Provider } from "react-redux";
import messaging from "@react-native-firebase/messaging";
export default function RootLayout() {
useEffect(() => {
const unsubscribe = messaging().onMessage(async remoteMessage => {
Alert.alert('A new FCM message arrived!', JSON.stringify(remoteMessage));
});
return unsubscribe;
}, []);
const { token, isLoading } = useAuthSession()
if (isLoading) {

View File

@@ -4,9 +4,10 @@ import { useAuthSession } from "@/providers/AuthProvider";
import { Redirect } from "expo-router";
import { useState } from "react";
import { Text } from "react-native";
import { useNotification } from "@/lib/useNotification";
export default function Index() {
useNotification()
const [isValid, setValid] = useState(false)
const [phone, setPhone] = useState('')
const [otp, setOtp] = useState(0)