You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2019/10/16 13:37:42 UTC
[GitHub] [cordova-plugin-inappbrowser] AubreyHewes commented on issue #505:
inappbrowser is getting closed when i keep the ios app on background
AubreyHewes commented on issue #505: inappbrowser is getting closed when i keep the ios app on background
URL: https://github.com/apache/cordova-plugin-inappbrowser/issues/505#issuecomment-542704915
@prasanthmpr The issue is not really the InAppBrowser plugin but the combination with the Salesforce Mobile SDK; Where one of its windows seems to be taking over the IAB window on app resume (`makeKeyAndVisible`). This makes the IAB unusable from then on as is already open but not visible.
I have the following workaround in the app's `AppDelegate+SalesforceHybridSDK.m`. This basically hooks the `SalesforceSDKManager.postAppForegroundAction` which is called after resume. This in turn calls an override on the `CDVUIInAppBrowser` instance to _maybe_ `makeKeyAndVisible` the IAB window.
Note; workaround could also be applied to the wkwebview, though was not used in our case.
Note; workaround depends on IAB internals; if changed may no longer work.
````objective-c
//... removed fluff
@interface CDVUIInAppBrowser (SFSDKCDVUIInAppBrowserResume)
- (void)postSFSDKAppForegroundAction;
@end
@implementation CDVUIInAppBrowser (SFSDKCDVUIInAppBrowserResume)
- (void)postSFSDKAppForegroundAction {
if (self.inAppBrowserViewController != nil) {
[tmpWindow makeKeyAndVisible];
}
}
@end
//...
@implementation AppDelegate (SalesforceHybridSDK)
//...
- (AppDelegate *)sfsdk_swizzled_init
{
//...
[SalesforceSDKManager sharedManager].postAppForegroundAction = ^{
[[CDVUIInAppBrowser getInstance] postSFSDKAppForegroundAction];
};
//...
}
//...
@end
````
@janpio the problem is not really this plugin, though could make a repro repo if wanted..
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org