fix : login
Deskripsi : - login api NO Issues
This commit is contained in:
@@ -41,6 +41,7 @@ export const requestPermission = async () => {
|
|||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
return true
|
||||||
} else if (Platform.OS === 'ios') {
|
} else if (Platform.OS === 'ios') {
|
||||||
const { status } = await Notifications.requestPermissionsAsync();
|
const { status } = await Notifications.requestPermissionsAsync();
|
||||||
return status === 'granted';
|
return status === 'granted';
|
||||||
|
|||||||
@@ -61,6 +61,8 @@ export default function AuthProvider({ children }: { children: ReactNode }): Rea
|
|||||||
if (Platform.OS === 'android') {
|
if (Platform.OS === 'android') {
|
||||||
const tokenDevice = await getToken()
|
const tokenDevice = await getToken()
|
||||||
const register = await apiRegisteredToken({ user: hasil, token: String(tokenDevice) })
|
const register = await apiRegisteredToken({ user: hasil, token: String(tokenDevice) })
|
||||||
|
}else{
|
||||||
|
const register = await apiRegisteredToken({ user: hasil, token: "" })
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error)
|
console.error(error)
|
||||||
@@ -84,6 +86,8 @@ export default function AuthProvider({ children }: { children: ReactNode }): Rea
|
|||||||
if (Platform.OS === 'android') {
|
if (Platform.OS === 'android') {
|
||||||
const token = await getToken()
|
const token = await getToken()
|
||||||
const response = await apiUnregisteredToken({ user: hasil, token: String(token) })
|
const response = await apiUnregisteredToken({ user: hasil, token: String(token) })
|
||||||
|
}else{
|
||||||
|
const response = await apiUnregisteredToken({ user: hasil, token: "" })
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error)
|
console.error(error)
|
||||||
|
|||||||
Reference in New Issue
Block a user