Adapt UIWebView changes to AuthenticationViewController, fixes #3057

This commit is contained in:
ismailgulek
2020-05-13 15:43:32 +03:00
parent f709d80ea8
commit fd04cb6b86
2 changed files with 10 additions and 13 deletions
@@ -18,7 +18,7 @@
#import "AppDelegate.h"
// Generic method to make a bridge between JS and the UIWebView
// Generic method to make a bridge between JS and the WKWebView
NSString *FallBackViewControllerJavascriptSendObjectMessage = @"window.sendObjectMessage = function(parameters) { \
var iframe = document.createElement('iframe'); \
iframe.setAttribute('src', 'js:' + JSON.stringify(parameters)); \
@@ -154,7 +154,7 @@ NSString *FallBackViewControllerJavascriptOnLogin = @"window.matrixLogin.onLogin
// `didReceiveScriptMessage` delegate to manage the JS<->Native bridge
if ([urlString hasPrefix:@"js:"])
{
// Listen only to scheme of the JS-UIWebView bridge
// Listen only to scheme of the JS-WKWebView bridge
NSString *jsonString = [[[urlString componentsSeparatedByString:@"js:"] lastObject] stringByReplacingPercentEscapesUsingEncoding:NSASCIIStringEncoding];
NSData *jsonData = [jsonString dataUsingEncoding:NSUTF8StringEncoding];