cordova ios network connection

When using cordova to create an app, the network connection is normal on android, but CFNetwork Handshake fail (-9807) appears when connecting wss on ios. I found many reasons online, and added the following code to AppDeleget.m:

@implementation NSURLRequest(DataController)
+ (BOOL)allowsAnyHTTPSCertificateForHost:(NSString *)host
{
    return YES;
}
@end
 But it still can't connect to the websocket server after running, manually call connect many times, and find that after entering some interfaces and loading some other http resources
It is actually connected manually, so I guess that the first time you enter, you should not be able to connect to wss immediately. The modification will be counted as the first access to the http resource, and then connect to wss.
test was successful.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326758298&siteId=291194637