Skip to content

Commit

Permalink
fix(app): try fix ios notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
cladel committed Aug 25, 2023
1 parent 0e54bc3 commit d5c931a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
5 changes: 3 additions & 2 deletions app/ios/liane/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,14 @@
</dict>
</dict>
</dict>
<key>NSCameraUsageDescription</key>
<string>Liane needs to access your camera to take photos.</string>
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>Liane needs to access your position to display it on a map.</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>Liane needs to access your position to display it on a map.</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Liane needs to access your library to upload photos.</string>
<key>NSCameraUsageDescription</key>
<string>Liane needs to access your camera to take photos.</string>
<key>UIAppFonts</key>
<array>
<string>Inter-Bold.ttf</string>
Expand All @@ -87,6 +87,7 @@
<string>fetch</string>
<string>location</string>
<string>processing</string>
<string>remote-notification</string>
</array>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
Expand Down
10 changes: 3 additions & 7 deletions app/src/components/context/ContextProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { AppServices, CreateAppServices } from "@/api/service";
import { NetworkUnavailable, UnauthorizedError } from "@/api/exception";
import { initializeRum, registerRumUser } from "@/api/rum";
import { initializeNotification, initializePushNotification } from "@/api/service/notification";
import { ActivityIndicator, AppState, AppStateStatus, NativeEventSubscription, Platform, StyleSheet, View } from "react-native";
import { ActivityIndicator, AppState, AppStateStatus, NativeEventSubscription, StyleSheet, View } from "react-native";
import { AppColors } from "@/theme/colors";
import { AppText } from "@/components/base/AppText";
import { RootNavigation } from "@/api/navigation";
Expand Down Expand Up @@ -73,13 +73,9 @@ async function initContext(service: AppServices): Promise<{

if (online && user) {
try {
if (Platform.OS === "android") {
await initializePushNotification(user, service.auth);
}
await initializePushNotification(user, service.auth);
} catch (e) {
if (__DEV__) {
console.warn("[INIT] Could not init notifications :", e);
}
console.warn("[INIT] Could not init notifications :", e);
}
}

Expand Down

0 comments on commit d5c931a

Please sign in to comment.