EducationSoftwareStrategy.com
StrategyCommunity

Knowledge Base

Product

Community

Knowledge Base

TopicsBrowse ArticlesDeveloper Zone

Product

Download SoftwareProduct DocumentationSecurity Hub

Education

Tutorial VideosSolution GalleryEducation courses

Community

GuidelinesGrandmastersEvents
x_social-icon_white.svglinkedin_social-icon_white.svg
Strategy logoCommunity

© Strategy Inc. All Rights Reserved.

LegalTerms of UsePrivacy Policy
  1. Home
  2. Topics

KB486421: Resolve conflicts in Library Mobile SDK for iOS when integrating with BlackBerry


Menglu Xia

Product Owner, Principal • MicroStrategy


This article provides a solution to prevent Library Mobile from crashing when integrating with BlackBerry.

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.

Symptom

BlackBerry frameworks utilize method swizzling or extensions to modify the

WKWebViewConfiguration
initialization method. Once authorized, BlackBerry frameworks set their own
WKURLSchemeHandler
for "http" and "https" to the
WKWebViewConfiguration
instance after initialization.
If a
WKURLSchemeHandler
is set to
WKWebViewConfiguration
for a specific URL scheme that already has one, the application crashes. See Apple’s documentation for setURLSchemeHandler(_:forURLScheme:) for more information.
 

Solution

To prevent this, SDK developers must add code to the authorization method before authorizing

gdLibrary
. Here’s an example for
GDSecurityHandler.m:
.
 
Swift
 

//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;


Comment

0 comments

Details

Knowledge Article

Published:

March 4, 2024

Last Updated:

April 8, 2024