Strategy ONE (March 2024) introduced bots to Library Mobile. However, when integrating the Library Mobile for iOS SDK with BlackBerry, a specific conflict must be addressed by the SDK developer during the integration process.
BlackBerry frameworks utilize method swizzling or extensions to modify the
WKWebViewConfigurationinitialization method. Once authorized, BlackBerry frameworks set their own
WKURLSchemeHandlerfor "http" and "https" to the
WKWebViewConfigurationinstance after initialization.
WKURLSchemeHandleris set to
WKWebViewConfigurationfor a specific URL scheme that already has one, the application crashes. See Apple’s documentation for setURLSchemeHandler(_:forURLScheme:) for more information.
To prevent this, SDK developers must add code to the authorization method before authorizing
gdLibrary. Here’s an example for
GDSecurityHandler.m:.
//There is a crash due to set url scheme more than once.
//BlackBerry frameworks somehow modify the WKWebViewConfiguration init method.
//After authorized BlackBerry frameworks will set its own WKURLSchemeHandler for “http“ and “https“ to WKWebViewConfiguration instance after init.
//So we need to set the setSupportWKWebView to NO before init WKWebViewConfiguration and set it to YES after setURLSchemeHandler to avoid Blackberry set its own WKURLSchemeHandler.
//Need to import
WKWebViewConfigurationUtils.beforeInitWKWebViewConfiguration = ^{[GDURLLoadingSystem setSupportWKWebView:NO];};
WKWebViewConfigurationUtils.afterSetURLSchemeHandler = ^{[GDURLLoadingSystem setSupportWKWebView:YES];};
//Need to set enableInsight to YES to enable Strategy Library Insight feature.
WKWebViewConfigurationUtils.enableInsight = YES;