diff --git a/apps/mobile/native/ios/Notesnook.xcodeproj/project.pbxproj b/apps/mobile/native/ios/Notesnook.xcodeproj/project.pbxproj index 89c964e9b..25347ac55 100644 --- a/apps/mobile/native/ios/Notesnook.xcodeproj/project.pbxproj +++ b/apps/mobile/native/ios/Notesnook.xcodeproj/project.pbxproj @@ -29,6 +29,7 @@ 65AA857E25E6DDEC00772A01 /* NotesWidget.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65AA857D25E6DDEC00772A01 /* NotesWidget.swift */; }; 65AA858025E6DDEE00772A01 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 65AA857F25E6DDEE00772A01 /* Assets.xcassets */; }; 65AA858425E6DDEE00772A01 /* NotesWidgetExtension.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 65AA857725E6DDEC00772A01 /* NotesWidgetExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; + 65B450AD2976AF0C00EA090B /* RNBackgroundFetch+AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 65B450AC2976AF0B00EA090B /* RNBackgroundFetch+AppDelegate.m */; }; 65B5014425A672B200E2D264 /* ShareViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 65B5014325A672B200E2D264 /* ShareViewController.m */; }; 65B5014725A672B200E2D264 /* MainInterface.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 65B5014525A672B200E2D264 /* MainInterface.storyboard */; }; 65B5014B25A672B200E2D264 /* Make Note.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 65B5014025A672B200E2D264 /* Make Note.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; @@ -122,6 +123,7 @@ 65AA857D25E6DDEC00772A01 /* NotesWidget.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotesWidget.swift; sourceTree = ""; }; 65AA857F25E6DDEE00772A01 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 65AA858125E6DDEE00772A01 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 65B450AC2976AF0B00EA090B /* RNBackgroundFetch+AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "RNBackgroundFetch+AppDelegate.m"; path = "../../node_modules/react-native-background-fetch/ios/RNBackgroundFetch/RNBackgroundFetch+AppDelegate.m"; sourceTree = ""; }; 65B5014025A672B200E2D264 /* Make Note.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = "Make Note.appex"; sourceTree = BUILT_PRODUCTS_DIR; }; 65B5014325A672B200E2D264 /* ShareViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ShareViewController.m; sourceTree = ""; }; 65B5014625A672B200E2D264 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/MainInterface.storyboard; sourceTree = ""; }; @@ -221,6 +223,7 @@ 13B07FAE1A68108700A75B9A /* Notesnook */ = { isa = PBXGroup; children = ( + 65B450AC2976AF0B00EA090B /* RNBackgroundFetch+AppDelegate.m */, 6593E4A2281C345400492C50 /* AppDelegate.mm */, 6529A13D279BC4C70048D4A8 /* BootSplash.storyboard */, 659BE46625E11A5100E05671 /* notesnook-text.png */, @@ -941,6 +944,7 @@ 65E0340B257B9FF100793428 /* File.swift in Sources */, 6593E4A3281C345400492C50 /* AppDelegate.mm in Sources */, 13B07FC11A68108700A75B9A /* main.m in Sources */, + 65B450AD2976AF0C00EA090B /* RNBackgroundFetch+AppDelegate.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/apps/mobile/native/ios/Notesnook/AppDelegate.mm b/apps/mobile/native/ios/Notesnook/AppDelegate.mm index 1947363b4..623c30992 100644 --- a/apps/mobile/native/ios/Notesnook/AppDelegate.mm +++ b/apps/mobile/native/ios/Notesnook/AppDelegate.mm @@ -7,6 +7,7 @@ #import #import #import "RNShortcuts.h" +#import #if RCT_NEW_ARCH_ENABLED #import @@ -62,6 +63,7 @@ RCTBridge *bridge; self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; self.window.rootViewController = rootViewController; [self.window makeKeyAndVisible]; + [[TSBackgroundFetch sharedInstance] didFinishLaunching]; return YES; } diff --git a/apps/mobile/native/ios/Notesnook/Info.plist b/apps/mobile/native/ios/Notesnook/Info.plist index a956ee851..67cf00624 100644 --- a/apps/mobile/native/ios/Notesnook/Info.plist +++ b/apps/mobile/native/ios/Notesnook/Info.plist @@ -4,6 +4,7 @@ BGTaskSchedulerPermittedIdentifiers + com.transistorsoft.fetch $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleDevelopmentRegion diff --git a/apps/mobile/native/ios/Podfile.lock b/apps/mobile/native/ios/Podfile.lock index d134d3ec6..7e6ece667 100644 --- a/apps/mobile/native/ios/Podfile.lock +++ b/apps/mobile/native/ios/Podfile.lock @@ -345,6 +345,8 @@ PODS: - React-Core - rn-fetch-blob (0.12.0): - React-Core + - RNBackgroundFetch (4.1.7): + - React-Core - RNBootSplash (4.3.2): - React-Core - RNCCheckbox (0.5.12): @@ -481,6 +483,7 @@ DEPENDENCIES: - ReactCommon/turbomodule/core (from `../../node_modules/react-native/ReactCommon`) - rn-extensions-share (from `../../node_modules/rn-extensions-share`) - rn-fetch-blob (from `../../node_modules/rn-fetch-blob`) + - RNBackgroundFetch (from `../../node_modules/react-native-background-fetch`) - RNBootSplash (from `../../node_modules/react-native-bootsplash`) - "RNCCheckbox (from `../../node_modules/@react-native-community/checkbox`)" - "RNCClipboard (from `../../node_modules/@react-native-clipboard/clipboard`)" @@ -622,6 +625,8 @@ EXTERNAL SOURCES: :path: "../../node_modules/rn-extensions-share" rn-fetch-blob: :path: "../../node_modules/rn-fetch-blob" + RNBackgroundFetch: + :path: "../../node_modules/react-native-background-fetch" RNBootSplash: :path: "../../node_modules/react-native-bootsplash" RNCCheckbox: @@ -736,6 +741,7 @@ SPEC CHECKSUMS: ReactCommon: 1e783348b9aa73ae68236271df972ba898560a95 rn-extensions-share: 3f0ecce20dfbca1f0358deb4ebfb9ee121a6d92a rn-fetch-blob: f065bb7ab7fb48dd002629f8bdcb0336602d3cba + RNBackgroundFetch: 13fbe7b23d4a082eac8caa7b08c5bcbeabd92f79 RNBootSplash: 5f346163977573d6b2aeba1b25df9d2245c0d73c RNCCheckbox: ed1b4ca295475b41e7251ebae046360a703b6eb5 RNCClipboard: 2834e1c4af68697089cdd455ee4a4cdd198fa7dd