NSURLConnection finished with error - code -1002

后端 未结 3 1972
无人及你
无人及你 2021-02-07 01:27

Friends i have simple audio player (MPMoviePlayerController) which can play audio stream. On iOS 11 i have very interessing trouble, thousand time i have error and my stream was

3条回答
  •  再見小時候
    2021-02-07 02:03

    First thing you must use secure server (server with valid certificate). I'm not sure either it is necessary or not because i never tried to hit server with invalid certificate. You can try this code (not sure it will work for you or not) put this code in Appdelegate.m

    @implementation NSURLRequest(DataController)
    + (BOOL)allowsAnyHTTPSCertificateForHost:(NSString *)host
    {
        return YES;
    }
    @end
    

提交回复
热议问题