1

当我尝试将我的手机作为订阅者添加到 OneSignal 时,我不断收到一堆错误。做了一些谷歌搜索后,我发现通过添加以下内容可以解决很多类似的问题:

    <key>NSAppTransportSecurity</key>
    <dict>
        <key>NSExceptionDomains</key>
        <dict>
            <key>yourdomain.com</key>
            <dict>
                <!--Include to allow subdomains-->
                <key>NSIncludesSubdomains</key>
                <true/>
                <!--Include to allow HTTP requests-->
                <key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
                <true/>
                <!--Include to specify minimum TLS version-->
                <key>NSTemporaryExceptionMinimumTLSVersion</key>
                <string>TLSv1.1</string>
            </dict>
        </dict>
    </dict>
    <key>NSAppTransportSecurity</key>
    <dict>
         <key>NSAllowsArbitraryLoads</key><true/>
    </dict>

到 info.plist 文件,但这没有帮助。以下是我得到的错误:

2020-01-20 18:11:42.247177-0500 Vocks[725:200745] 6.15.0 - [Firebase/Analytics][I-ACS023012] Analytics collection enabled
2020-01-20 18:11:42.583343-0500 Vocks[725:200741] [] tcp_output [C2.1.1:2] flags=[R.] seq=733742495, ack=1645995697, win=1026 state=CLOSED rcv_nxt=1645995697, snd_una=733742495
2020-01-20 18:11:42.587095-0500 Vocks[725:200741] Connection 2: received failure notification
2020-01-20 18:11:42.587812-0500 Vocks[725:200741] Connection 2: encountered error(3:-9816)
2020-01-20 18:11:42.588868-0500 Vocks[725:200741] [] nw_connection_copy_connected_local_endpoint [C2] Connection has no connected path
2020-01-20 18:11:42.588911-0500 Vocks[725:200741] [] nw_connection_copy_connected_remote_endpoint [C2] Connection has no connected path
2020-01-20 18:11:42.605280-0500 Vocks[725:200741] Task <C1511226-D971-43C3-B953-A6BBA2EA9C7E>.<1> HTTP load failed, 0/0 bytes (error code: -1200 [3:-9816])
2020-01-20 18:11:42.610239-0500 Vocks[725:200751] Task <C1511226-D971-43C3-B953-A6BBA2EA9C7E>.<1> finished with error [-1200] Error Domain=NSURLErrorDomain Code=-1200 "An SSL error has occurred and a secure connection to the server cannot be made." UserInfo={_kCFStreamErrorCodeKey=-9816, NSLocalizedRecoverySuggestion=Would you like to connect to the server anyway?, NSUnderlyingError=0x281f748a0 {Error Domain=kCFErrorDomainCFNetwork Code=-1200 "(null)" UserInfo={_kCFStreamPropertySSLClientCertificateState=0, _kCFNetworkCFStreamSSLErrorOriginalValue=-9816, _kCFStreamErrorDomainKey=3, _kCFStreamErrorCodeKey=-9816}}, NSLocalizedDescription=An SSL error has occurred and a secure connection to the server cannot be made., NSErrorFailingURLKey=https://onesignal.com/api/v1/players, NSErrorFailingURLStringKey=https://onesignal.com/api/v1/players, _kCFStreamErrorDomainKey=3}
2020-01-20 18:11:42.612812-0500 Vocks[725:200741] [] tcp_output [C1.1.1:2] flags=[R.] seq=2887753815, ack=4287215693, win=1026 state=CLOSED rcv_nxt=4287215693, snd_una=2887753815
2020-01-20 18:11:42.615102-0500 Vocks[725:200741] Connection 1: received failure notification
2020-01-20 18:11:42.616483-0500 Vocks[725:200741] Connection 1: encountered error(3:-9816)
2020-01-20 18:11:42.617395-0500 Vocks[725:200741] [] nw_connection_copy_connected_local_endpoint [C1] Connection has no connected path
2020-01-20 18:11:42.617629-0500 Vocks[725:200741] [] nw_connection_copy_connected_remote_endpoint [C1] Connection has no connected path
2020-01-20 18:11:42.626253-0500 Vocks[725:200741] Task <05DFC145-162F-46B7-BA80-66849A234A6C>.<1> HTTP load failed, 0/0 bytes (error code: -1200 [3:-9816])
2020-01-20 18:11:42.626950-0500 Vocks[725:200745] Task <05DFC145-162F-46B7-BA80-66849A234A6C>.<1> finished with error [-1200] Error Domain=NSURLErrorDomain Code=-1200 "An SSL error has occurred and a secure connection to the server cannot be made." UserInfo={_kCFStreamErrorCodeKey=-9816, NSLocalizedRecoverySuggestion=Would you like to connect to the server anyway?, NSUnderlyingError=0x281f573f0 {Error Domain=kCFErrorDomainCFNetwork Code=-1200 "(null)" UserInfo={_kCFStreamPropertySSLClientCertificateState=0, _kCFNetworkCFStreamSSLErrorOriginalValue=-9816, _kCFStreamErrorDomainKey=3, _kCFStreamErrorCodeKey=-9816}}, NSLocalizedDescription=An SSL error has occurred and a secure connection to the server cannot be made., NSErrorFailingURLKey=https://onesignal.com/api/v1/apps/b200505d-d94c-4609-ae5f-247ec23da5b9/ios_params.js, NSErrorFailingURLStringKey=https://onesignal.com/api/v1/apps/b200505d-d94c-4609-ae5f-247ec23da5b9/ios_params.js, _kCFStreamErrorDomainKey=3}
4

0 回答 0