From def241a9c9e64910960d5423bb95d9a0e16f03a6 Mon Sep 17 00:00:00 2001 From: amaliadwiy Date: Tue, 29 Jul 2025 10:08:45 +0800 Subject: [PATCH] upd: login ios --- providers/AuthProvider.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/providers/AuthProvider.tsx b/providers/AuthProvider.tsx index 77aad39..981b8ee 100644 --- a/providers/AuthProvider.tsx +++ b/providers/AuthProvider.tsx @@ -55,9 +55,11 @@ export default function AuthProvider({ children }: { children: ReactNode }): Rea const hasil = await decryptToken(String(token)) const permission = await requestPermission() if (permission) { - const tokenDevice = await getToken() try { - const register = await apiRegisteredToken({ user: hasil, token: String(tokenDevice) }) + if (Platform.OS === 'android') { + const tokenDevice = await getToken() + const register = await apiRegisteredToken({ user: hasil, token: String(tokenDevice) }) + } } catch (error) { console.error(error) } finally { @@ -77,7 +79,7 @@ export default function AuthProvider({ children }: { children: ReactNode }): Rea try { const hasil = await decryptToken(String(tokenRef.current)) const token = await getToken() - if (Platform.OS === 'android'){ + if (Platform.OS === 'android') { const response = await apiUnregisteredToken({ user: hasil, token: String(token) }) } } catch (error) {