소스 검색

notifications fix

Viktoriia 9 달 전
부모
커밋
6e4bd9f9cd
1개의 변경된 파일4개의 추가작업 그리고 0개의 파일을 삭제
  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) {