Explorar o código

notifications fix

Viktoriia hai 9 meses
pai
achega
6e4bd9f9cd
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  1. 4 0
      Route.tsx

+ 4 - 0
Route.tsx

@@ -184,6 +184,10 @@ const Route = () => {
 
   const checkTokenAndUpdate = async () => {
     const storedToken = storage.get('deviceToken', StoreType.STRING);
+    const { status } = await Notifications.getPermissionsAsync();
+    if (status !== 'granted') {
+      return;
+    }
     const currentToken = await Notifications.getDevicePushTokenAsync();
 
     if (storedToken && currentToken?.data !== storedToken) {