File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -105,6 +105,12 @@ @interface CDVWKWebViewEngine ()
105105@property (nonatomic , readwrite ) NSString *CDV_LOCAL_SERVER;
106106@end
107107
108+ // expose private configuration value required for background operation
109+ @interface WKWebViewConfiguration ()
110+
111+ @property (setter =_setAlwaysRunsAtForegroundPriority:, nonatomic ) bool _alwaysRunsAtForegroundPriority;
112+
113+ @end
108114
109115
110116// see forwardingTargetForSelector: selector comment for the reason for this pragma
@@ -174,6 +180,8 @@ - (WKWebViewConfiguration*) createConfigurationFromSettings:(NSDictionary*)setti
174180 if (settings == nil ) {
175181 return configuration;
176182 }
183+ // required to stop wkwebview suspending in background too eagerly (as used in background mode plugin)
184+ configuration._alwaysRunsAtForegroundPriority = [settings cordovaBoolSettingForKey: @" WKEnableBackground" defaultValue: NO ];
177185 configuration.allowsInlineMediaPlayback = [settings cordovaBoolSettingForKey: @" AllowInlineMediaPlayback" defaultValue: YES ];
178186 configuration.suppressesIncrementalRendering = [settings cordovaBoolSettingForKey: @" SuppressesIncrementalRendering" defaultValue: NO ];
179187 configuration.allowsAirPlayForMediaPlayback = [settings cordovaBoolSettingForKey: @" MediaPlaybackAllowsAirPlay" defaultValue: YES ];
You can’t perform that action at this time.
0 commit comments