From 24e1ace521662a653571c904dbe020f3028edbe7 Mon Sep 17 00:00:00 2001 From: amaliadwiy Date: Mon, 1 Sep 2025 17:05:51 +0800 Subject: [PATCH] fix : login Deskripsi : - login api NO Issues --- lib/useNotification.ts | 1 + providers/AuthProvider.tsx | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/lib/useNotification.ts b/lib/useNotification.ts index f23120b..46d562f 100644 --- a/lib/useNotification.ts +++ b/lib/useNotification.ts @@ -41,6 +41,7 @@ export const requestPermission = async () => { } return false } + return true } else if (Platform.OS === 'ios') { const { status } = await Notifications.requestPermissionsAsync(); return status === 'granted'; diff --git a/providers/AuthProvider.tsx b/providers/AuthProvider.tsx index 33795a4..d01eac0 100644 --- a/providers/AuthProvider.tsx +++ b/providers/AuthProvider.tsx @@ -61,6 +61,8 @@ export default function AuthProvider({ children }: { children: ReactNode }): Rea if (Platform.OS === 'android') { const tokenDevice = await getToken() const register = await apiRegisteredToken({ user: hasil, token: String(tokenDevice) }) + }else{ + const register = await apiRegisteredToken({ user: hasil, token: "" }) } } catch (error) { console.error(error) @@ -84,6 +86,8 @@ export default function AuthProvider({ children }: { children: ReactNode }): Rea if (Platform.OS === 'android') { const token = await getToken() const response = await apiUnregisteredToken({ user: hasil, token: String(token) }) + }else{ + const response = await apiUnregisteredToken({ user: hasil, token: "" }) } } catch (error) { console.error(error)