File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,10 +3,17 @@ import UIKit
33
44public class RNASAppLifecycleDelegate : ExpoAppDelegateSubscriber {
55 public func applicationDidFinishLaunching( _ application: UIApplication ) {
6- application. ignoreSnapshotOnNextApplicationLaunch ( )
6+ if ( !isPreventRecentScreenshotsEnabled( ) ) {
7+ return
8+ }
9+ application. ignoreSnapshotOnNextApplicationLaunch ( )
710 }
811
912 public func applicationWillResignActive( _ application: UIApplication ) {
13+ if ( !isPreventRecentScreenshotsEnabled( ) ) {
14+ return
15+ }
16+
1017 // https://developer.apple.com/documentation/uikit/app_and_environment/scenes/preparing_your_ui_to_run_in_the_background
1118
1219 // TODO: better error handling in case there's an issue with the splashscreen (instead of !)
@@ -17,6 +24,18 @@ public class RNASAppLifecycleDelegate: ExpoAppDelegateSubscriber {
1724 }
1825
1926 public func applicationDidBecomeActive( _ application: UIApplication ) {
27+ if ( !isPreventRecentScreenshotsEnabled( ) ) {
28+ return
29+ }
30+
2031 UIApplication . shared. windows. first? . rootViewController? . dismiss ( animated: false )
2132 }
2233}
34+
35+
36+ func isPreventRecentScreenshotsEnabled( ) -> Bool {
37+ if let value = Bundle . main. object ( forInfoDictionaryKey: " RNAS_PREVENT_RECENT_SCREENSHOTS " ) as? Bool {
38+ return value
39+ }
40+ return false
41+ }
You can’t perform that action at this time.
0 commit comments