如何将WebView嵌入IOS自定义键盘应用程序扩展的InputView中

如何将WebView嵌入IOS自定义键盘应用程序扩展的InputView中,ios,webview,custom-keyboard,Ios,Webview,Custom Keyboard,我尝试创建一个嵌入webview的故事板 然后在ViewController类中,在viewDidLoad方法中: [self.myWebView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"https://www.google.com"]]]; 日志: CustomKeyboard[1865:37706] [Common] BKSAccelerometer unable to create notifyd t

我尝试创建一个嵌入webview的故事板 然后在ViewController类中,在viewDidLoad方法中:

[self.myWebView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"https://www.google.com"]]];
日志:


CustomKeyboard[1865:37706] [Common] BKSAccelerometer unable to create notifyd token for device orientation

CustomKeyboard[1865:37779] [default] error registring notify port: (1000000)

CustomKeyboard[1865:37706] [] __nwlog_err_simulate_crash_libsystem libsystem simulate crash failed "libsystem_network.dylib: networkd_settings_setup_notify_watch :: notify_register_dispatch(com.apple.system.networkd.settings) [status 1000000] failed"

CustomKeyboard[1865:37706] [] networkd_settings_setup_notify_watch notify_register_dispatch(com.apple.system.networkd.settings) [status 1000000] failed, dumping backtrace:
[arm64] libnetcore-856.1.8
0 libsystem_network.dylib 0x0000000188db5534 __nw_create_backtrace_string + 116
1 libsystem_network.dylib 0x0000000188dd17e4 + 332
2 libsystem_network.dylib 0x0000000188dd15b0 + 68
3 libsystem_network.dylib 0x0000000188da91a8 nwlog_is_debug_logging_enabled + 32
4 libsystem_network.dylib 0x0000000188dc8fac + 256
5 libsystem_network.dylib 0x0000000188dc917c + 24
6 libdispatch.dylib 0x0000000188c051c0 + 16
7 libdispatch.dylib 0x0000000188c12860 + 84
8 libsystem_network.dylib 0x0000000188dc7088 + 160
9 libsystem_network.dylib 0x0000000188dc6b1c + 136
10 libsy

CustomKeyboard[1865:37706] [] __nwlog_err_simulate_crash_libsystem libsystem simulate crash failed "libsystem_network.dylib: networkd_settings_init :: notify_register_check(nw_notification_name_settings) status 1000000 token -1 failed"

CustomKeyboard[1865:37706] [] networkd_settings_init notify_register_check(nw_notification_name_settings) status 1000000 token -1 failed, dumping backtrace:
[arm64] libnetcore-856.1.8
0 libsystem_network.dylib 0x0000000188db5534 __nw_create_backtrace_string + 116
1 libsystem_network.dylib 0x0000000188dd1620 + 180
2 libsystem_network.dylib 0x0000000188da91a8 nwlog_is_debug_logging_enabled + 32
3 libsystem_network.dylib 0x0000000188dc8fac + 256
4 libsystem_network.dylib 0x0000000188dc917c + 24
5 libdispatch.dylib 0x0000000188c051c0 + 16
6 libdispatch.dylib 0x0000000188c12860 + 84
7 libsystem_network.dylib 0x0000000188dc7088 + 160
8 libsystem_network.dylib 0x0000000188dc6b1c + 136
9 libsystem_network.dylib 0x0000000188dc68c4 nw_path_create_evaluator_for_endpoint + 972


CustomKeyboard[1865:37912] dnssd_clientstub ConnectToServer: connect()-> No of tries: 1

CustomKeyboard[1865:37912] dnssd_clientstub ConnectToServer: connect()-> No of tries: 2

CustomKeyboard[1865:37912] dnssd_clientstub ConnectToServer: connect()-> No of tries: 3

CustomKeyboard[1865:37912] dnssd_clientstub ConnectToServer: connect() failed path:/var/run/mDNSResponder Socket:5 Err:-1 Errno:1 Operation not permitted

CustomKeyboard[1865:37912] [] nw_resolver_create_dns_service_on_queue DNSServiceCreateConnection failed: ServiceNotRunning(-65563)

CustomKeyboard[1865:37945] [] __nw_connection_get_connected_socket_block_invoke 2 Connection has no connected handler

CustomKeyboard[1865:37929] PAC stream failed with

CustomKeyboard[1865:37929] [] nw_proxy_resolver_create_parsed_array PAC evaluation error: kCFErrorDomainCFNetwork: -72000

CustomKeyboard[1865:37929] dnssd_clientstub ConnectToServer: connect()-> No of tries: 1

CustomKeyboard[1865:37929] dnssd_clientstub ConnectToServer: connect()-> No of tries: 2

CustomKeyboard[1865:37929] dnssd_clientstub ConnectToServer: connect()-> No of tries: 3

CustomKeyboard[1865:37929] dnssd_clientstub ConnectToServer: connect() failed path:/var/run/mDNSResponder Socket:5 Err:-1 Errno:1 Operation not permitted

CustomKeyboard[1865:37929] [] nw_resolver_create_dns_service_on_queue DNSServiceCreateConnection failed: ServiceNotRunning(-65563)


自定义键盘[1865:37706][Common]BKSACelectrometer无法为设备方向创建通知令牌

CustomKeyboard[1865:37779][default]注册通知端口时出错:(1000000)

CustomKeyboard[1865:37706][]\uuuuuu nwlog\u err\u simulate\u crash\uLibSystem libsystem仿真崩溃失败“libsystem\u networkd.dylib:networkd\u settings\u setup\u notify\u watch::notify\u register\u dispatch(com.apple.system.networkd.settings)[状态1000000]失败”

CustomKeyboard[1865:37706][]网络设置设置通知监视通知注册发送(com.apple.system.networkd.settings)[状态1000000]失败,转储回溯:
[arm64]libnetcore-856.1.8
0 libsystem\u network.dylib 0x0000000188db5534\uuuuuuNW\uCREATE\uBACKTRACE\uSTRING+116
1 libsystem_network.dylib 0x0000000188dd17e4+332
2 libsystem_network.dylib 0x0000000188dd15b0+68
3 libsystem_network.dylib 0x0000000188da91a8 nwlog_已启用调试_日志记录功能+32
4 libsystem_network.dylib 0x0000000188dc8fac+256
5 libsystem_network.dylib 0x0000000188dc917c+24
6 libdispatch.dylib 0x0000000188c051c0+16
7 libdispatch.dylib 0x0000000188c12860+84
8 libsystem_network.dylib 0x0000000188dc7088+160
9 libsystem_network.dylib 0x0000000188dc6b1c+136
10 libsy

CustomKeyboard[1865:37706][]\uuuuu nwlog\u err\u simulate\u crash\u libsystem libsystem libsystem simulate crash failed“libsystem\u network.dylib:networkd\u settings\u init::notify\u register\u check(nw\u notification\u name\u settings)status 1000000 token-1 failed”

自定义键盘[1865:37706][]网络设置\u初始通知\u注册检查(nw\u通知\u名称\u设置)状态1000000令牌-1失败,转储回溯:
[arm64]libnetcore-856.1.8
0 libsystem\u network.dylib 0x0000000188db5534\uuuuuuNW\uCREATE\uBACKTRACE\uSTRING+116
1 libsystem_network.dylib 0x0000000188dd1620+180
2 libsystem_network.dylib 0x0000000188da91a8 nwlog_已启用调试记录功能+32
3 libsystem_network.dylib 0x0000000188dc8fac+256
4 libsystem_network.dylib 0x0000000188dc917c+24
5 libdispatch.dylib 0x0000000188c051c0+16
6 libdispatch.dylib 0x0000000188c12860+84
7 libsystem_network.dylib 0x0000000188dc7088+160
8 libsystem_network.dylib 0x0000000188dc6b1c+136
9 libsystem\u network.dylib 0x0000000188dc68c4 nw\u路径\u为\u端点+972创建\u求值器\u


自定义键盘[1865:37912]dnssd_客户端存根ConnectToServer:connect()->尝试次数:1

自定义键盘[1865:37912]dnssd_客户端存根ConnectToServer:connect()->尝试次数:2次

自定义键盘[1865:37912]dnssd_客户端存根ConnectToServer:connect()->尝试次数:3次

自定义键盘[1865:37912]dnssd_客户端存根连接到服务器:connect()失败路径:/var/run/mdnsrresponder套接字:5 Err:-1 Errno:1不允许操作

CustomKeyboard[1865:37912][]nw_解析器_创建_dns_服务_队列上的DNSServiceCreateConnection失败:ServiceNotRunning(-65563)

CustomKeyboard[1865:37945][]\uuuuu nw\u connection\u get\u connected\u socket\u block\u invoke 2连接没有连接的处理程序

CustomKeyboard[1865:37929]PAC流失败,错误为

自定义键盘[1865:37929][]nw\u代理\u解析程序\u创建\u解析\u数组PAC计算错误:kCFErrorDomainCFNetwork:-72000

自定义键盘[1865:37929]dnssd_客户端存根ConnectToServer:connect()->尝试次数:1

自定义键盘[1865:37929]dnssd_客户端存根ConnectToServer:connect()->尝试次数:2次

自定义键盘[1865:37929]dnssd_客户端存根ConnectToServer:connect()->尝试次数:3次

自定义键盘[1865:37929]dnssd_客户端存根连接到服务器:connect()失败路径:/var/run/mdnsrresponder套接字:5 Err:-1 Errno:1不允许操作

CustomKeyboard[1865:37929][]nw_解析器_创建_dns_服务_队列上的DNSServiceCreateConnection失败:ServiceNotRunning(-65563)


将代码放在viewdide方法中,而不是viewdideload方法中

- (void)viewDidAppear:(BOOL)animated { CGRect screenRect = [[UIScreen mainScreen] bounds]; CGFloat screenWidth = screenRect.size.width; //CGFloat screenHeight = screenRect.size.height; UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, screenWidth, 800)]; NSString *urlString = @"http://mum00blf.in.oracle.com:7777/index/public/login.html"; NSURL *url = [NSURL URLWithString:urlString]; NSURLRequest *urlRequest = [NSURLRequest requestWithURL:url]; [webView loadRequest:urlRequest]; /*dispatch_async(dispatch_get_main_queue(), ^(void){ [self.view addSubview:webView]; });*/ [self.view addSubview:webView]; } -(无效)视图显示:(BOOL)动画{ CGRect screenRect=[[UIScreen mainScreen]边界]; CGFloat screenWidth=screenRect.size.width; //CGFloat screenHeight=screenRect.size.height; UIWebView*webView=[[UIWebView alloc]initWithFrame:CGRectMake(0,0,屏幕宽度,800)]; NSString*urlString=@”http://mum00blf.in.oracle.com:7777/index/public/login.html"; NSURL*url=[NSURL URLWithString:urlString]; NSURLRequest*urlRequest=[nsurlRequestRequestWithURL:url]; [webView loadRequest:urlRequest]; /*dispatch\u async(dispatch\u get\u main\u queue(),^(void){ [self.view addSubview:webView]; });*/ [self.view addSubview:webView];
}我在尝试将联系人视图控制器嵌入自定义键盘时遇到了类似的问题。你的模拟器/测试设备的iOS版本是什么?我正在iOS 10上测试它。你找到解决方案了吗?幸运的话@ShubhamJha?还有这个问题,请尝试以下解决方案