为什么即使苹果正确验证通用链接也不起作用?

时间:2017-03-05 16:26:34

标签: ios xcode apple-app-site-associate

验证我的苹果应用网站关联文件时,我会通过主域和子域

aasa

当然还有启用和添加的权利

associated domains

每当我想在设备上测试时,我都会重新安装应用程序,以获取设备上安装的新版本文件...我在从XCode安装之前删除旧应用程序。

{
    "applinks": 
    {
        "apps": [],
        "details": [
            {
                "appID": "TeamID.AppID",
                "paths": [ "*" ]
            }
        ]
    },
    "activitycontinuation": 
    {
        "apps": ["TeamID.AppID"]
    }
}

但问题只是,当我点击我在线托管的html链接时,它会在Safari中打开而不是在应用程序中!!

PS:这是因为我没有网站的https吗?它仅适用于http ...

iOS控制台输出,使用swcd关键字过滤,并使用mySiteName替换网站名称

Mar  5 20:05:56 DevaEldeen swcd(CoreUtils)[184] <Notice>: Get info for service 'applinks', app ID '<<NULL>>', domain 'www.je...'
Mar  5 20:05:56 DevaEldeen swcd(CoreUtils)[184] <Notice>: Get info for service 'activitycontinuation', app ID '<<NULL>>', domain 'www.je...'
Mar  5 20:06:00 DevaEldeen swcd(CoreUtils)[184] <Notice>: Get info for service 'applinks', app ID '<<NULL>>', domain 'm.je...'
Mar  5 20:06:00 DevaEldeen swcd(CoreUtils)[184] <Notice>: Immediate retry for domain 'm.je...'
Mar  5 20:06:00 DevaEldeen swcd(CoreUtils)[184] <Notice>: Started request for domain 'm.mySiteName.com', URL 'https://m.mySiteName.com/.well-known/apple-app-site-association'
Mar  5 20:06:00 DevaEldeen swcd(CFNetwork)[184] <Notice>: TIC TCP Conn Start [99:0x17e57310]
Mar  5 20:06:00 DevaEldeen swcd(libsystem_network.dylib)[184] <Info>: nw_endpoint_handler_start [99 m.mySiteName.com:443 initial path (null)]
Mar  5 20:06:00 DevaEldeen swcd(libsystem_network.dylib)[184] <Info>: nw_connection_endpoint_report [99 m.mySiteName.com:443 initial path (null)] reported event path:start
Mar  5 20:06:00 DevaEldeen swcd(libsystem_network.dylib)[184] <Info>: nw_connection_endpoint_report [99 m.mySiteName.com:443 waiting path (satisfied)] reported event path:satisfied
Mar  5 20:06:00 DevaEldeen swcd(libsystem_network.dylib)[184] <Info>: nw_connection_endpoint_report [99 m.mySiteName.com:443 waiting path (satisfied)] skipping state update
Mar  5 20:06:00 DevaEldeen swcd(libsystem_network.dylib)[184] <Info>: nw_connection_endpoint_report [99 m.mySiteName.com:443 in_progress resolver (satisfied)] reported event resolver:start_dns
Mar  5 20:06:00 DevaEldeen mDNSResponder[85] <Info>:  15: DNSServiceCreateConnection START PID[184](swcd)
Mar  5 20:06:00 DevaEldeen mDNSResponder[85] <Info>:  15: DNSServiceGetAddrInfo(4000D000, 0, 3, m.mySiteName.com.) START PID[184](swcd)
Mar  5 20:06:00 DevaEldeen mDNSResponder[85] <Info>:  15: DNSServiceCreateConnection STOP PID[184](swcd)
Mar  5 20:06:00 DevaEldeen mDNSResponder[85] <Info>:  15: DNSServiceGetAddrInfo(m.mySiteName.com.) STOP PID[184](swcd)
Mar  5 20:06:00 DevaEldeen swcd(libsystem_network.dylib)[184] <Info>: nw_endpoint_resolver_update [99 m.mySiteName.com:443 in_progress resolver (satisfied)] Adding endpoint handler for 104.25.215.11:443
Mar  5 20:06:00 DevaEldeen swcd(libsystem_network.dylib)[184] <Info>: nw_endpoint_resolver_update [99 m.mySiteName.com:443 in_progress resolver (satisfied)] Adding endpoint handler for 104.25.214.11:443
Mar  5 20:06:00 DevaEldeen swcd(libsystem_network.dylib)[184] <Info>: nw_connection_endpoint_report [99 m.mySiteName.com:443 in_progress resolver (satisfied)] reported event resolver:receive_dns
Mar  5 20:06:00 DevaEldeen swcd(libsystem_network.dylib)[184] <Info>: nw_endpoint_resolver_start_next_child [99 m.mySiteName.com:443 in_progress resolver (satisfied)] starting child endpoint 104.25.215.11:443
Mar  5 20:06:00 DevaEldeen swcd(libsystem_network.dylib)[184] <Info>: nw_endpoint_resolver_start_next_child [99 m.mySiteName.com:443 in_progress resolver (satisfied)] starting next child endpoint in 316ms
Mar  5 20:06:00 DevaEldeen swcd(libsystem_network.dylib)[184] <Info>: nw_endpoint_handler_start [99.1 104.25.215.11:443 initial path (null)]
Mar  5 20:06:00 DevaEldeen swcd(libsystem_network.dylib)[184] <Info>: nw_connection_endpoint_report [99.1 104.25.215.11:443 initial path (null)] reported event path:start
Mar  5 20:06:00 DevaEldeen swcd(libsystem_network.dylib)[184] <Info>: nw_connection_endpoint_report [99.1 104.25.215.11:443 waiting path (satisfied)] reported event path:satisfied
Mar  5 20:06:00 DevaEldeen swcd(libsystem_network.dylib)[184] <Info>: nw_connection_endpoint_report [99.1 104.25.215.11:443 in_progress socket-flow (satisfied)] reported event flow:start_connect
Mar  5 20:06:00 DevaEldeen swcd(libsystem_network.dylib)[184] <Info>: nw_endpoint_flow_protocol_connected [99.1 104.25.215.11:443 in_progress socket-flow (satisfied)] Output protocol connected
Mar  5 20:06:00 DevaEldeen swcd(libsystem_network.dylib)[184] <Info>: nw_endpoint_flow_connected_path_change [99.1 104.25.215.11:443 ready socket-flow (satisfied)] Connected path is satisfied
Mar  5 20:06:00 DevaEldeen swcd(libsystem_network.dylib)[184] <Info>: nw_connection_endpoint_report [99.1 104.25.215.11:443 ready socket-flow (satisfied)] reported event flow:finish_connect
Mar  5 20:06:00 DevaEldeen swcd(libsystem_network.dylib)[184] <Info>: nw_connection_endpoint_report [99 m.mySiteName.com:443 ready resolver (satisfied)] reported event flow:finish_connect
Mar  5 20:06:00 DevaEldeen swcd(libsystem_network.dylib)[184] <Info>: nw_connection_endpoint_report [99.1 104.25.215.11:443 ready socket-flow (satisfied)] reported event flow:changed_viability
Mar  5 20:06:00 DevaEldeen swcd(libsystem_network.dylib)[184] <Info>: nw_connection_endpoint_report [99 m.mySiteName.com:443 ready resolver (satisfied)] reported event flow:changed_viability
Mar  5 20:06:00 DevaEldeen swcd(CFNetwork)[184] <Notice>: TIC TCP Conn Event [99:0x17e57310]: 1 Err(0)
Mar  5 20:06:00 DevaEldeen swcd(CFNetwork)[184] <Notice>: TIC TCP Conn Connected [99:0x17e57310]: Err(0)
Mar  5 20:06:00 DevaEldeen swcd(CFNetwork)[184] <Notice>: TIC Enabling TLS [99:0x17e57310]
Mar  5 20:06:00 DevaEldeen swcd(libsystem_network.dylib)[184] <Info>: nw_endpoint_start_tls_while_connected [99.1 104.25.215.11:443 ready socket-flow (satisfied)]
Mar  5 20:06:00 DevaEldeen swcd(libsystem_network.dylib)[184] <Info>: nw_connection_endpoint_report [99.1 104.25.215.11:443 in_progress socket-flow (satisfied)] reported event flow:start_secondary_connect
Mar  5 20:06:00 DevaEldeen swcd(libsystem_network.dylib)[184] <Info>: nw_connection_endpoint_report [99 m.mySiteName.com:443 in_progress resolver (satisfied)] reported event flow:start_secondary_connect
Mar  5 20:06:00 DevaEldeen swcd(libsystem_network.dylib)[184] <Info>: nw_connection_endpoint_report [99 m.mySiteName.com:443 in_progress resolver (satisfied)] reported event flow:start_connect
Mar  5 20:06:00 DevaEldeen swcd(libsystem_network.dylib)[184] <Info>: nw_endpoint_flow_protocol_connected [99.1 104.25.215.11:443 in_progress socket-flow (satisfied)] Transport protocol connected
Mar  5 20:06:00 DevaEldeen swcd(libsystem_network.dylib)[184] <Info>: nw_connection_endpoint_report [99.1 104.25.215.11:443 in_progress socket-flow (satisfied)] reported event flow:finish_transport
Mar  5 20:06:00 DevaEldeen swcd(libsystem_network.dylib)[184] <Info>: nw_connection_endpoint_report [99 m.mySiteName.com:443 in_progress resolver (satisfied)] reported event flow:finish_transport
Mar  5 20:06:00 DevaEldeen swcd(CFNetwork)[184] <Notice>: TIC TLS Event [99:0x17e57310]: 2, Pending(0)
Mar  5 20:06:00 DevaEldeen swcd(CFNetwork)[184] <Notice>: TIC TLS Event [99:0x17e57310]: 11, Pending(0)
Mar  5 20:06:00 DevaEldeen swcd(CFNetwork)[184] <Notice>: TIC TLS Event [99:0x17e57310]: 22, Pending(0)
Mar  5 20:06:00 DevaEldeen swcd(CFNetwork)[184] <Notice>: TIC TLS Event [99:0x17e57310]: 12, Pending(0)
Mar  5 20:06:00 DevaEldeen swcd(CFNetwork)[184] <Notice>: TIC TLS Event [99:0x17e57310]: 14, Pending(0)
Mar  5 20:06:01 DevaEldeen swcd(CoreUtils)[184] <Info>: Accepting URL 'https://m.mySiteName.com/.well-known/apple-app-site-association' trust
Mar  5 20:06:01 DevaEldeen swcd(CFNetwork)[184] <Notice>: TIC TLS Trust Result [99:0x17e57310]: 0
Mar  5 20:06:01 DevaEldeen swcd(CFNetwork)[184] <Notice>: TIC TLS Event [99:0x17e57310]: 20, Pending(0)
Mar  5 20:06:01 DevaEldeen swcd(libsystem_network.dylib)[184] <Info>: nw_endpoint_flow_protocol_connected [99.1 104.25.215.11:443 in_progress socket-flow (satisfied)] Output protocol connected
Mar  5 20:06:01 DevaEldeen swcd(libsystem_network.dylib)[184] <Info>: nw_endpoint_flow_connected_path_change [99.1 104.25.215.11:443 ready socket-flow (satisfied)] Connected path is satisfied
Mar  5 20:06:01 DevaEldeen swcd(libsystem_network.dylib)[184] <Info>: nw_connection_endpoint_report [99.1 104.25.215.11:443 ready socket-flow (satisfied)] reported event flow:finish_connect
Mar  5 20:06:01 DevaEldeen swcd(libsystem_network.dylib)[184] <Info>: nw_connection_endpoint_report [99 m.mySiteName.com:443 ready resolver (satisfied)] reported event flow:finish_connect
Mar  5 20:06:01 DevaEldeen swcd(CFNetwork)[184] <Notice>: TIC TCP Conn Event [99:0x17e57310]: 8 Err(0)
Mar  5 20:06:01 DevaEldeen swcd(CFNetwork)[184] <Notice>: TIC TLS Handshake Complete [99:0x17e57310]
Mar  5 20:06:01 DevaEldeen swcd(CoreUtils)[184] <Info>: Retrying non-well-known request for domain 'm.mySiteName.com', status -6768/0xFFFFE590 kSecurityRequiredErr
Mar  5 20:06:01 DevaEldeen swcd(CoreUtils)[184] <Notice>: Started request for domain 'm.mySiteName.com', URL 'https://m.mySiteName.com/apple-app-site-association'
Mar  5 20:06:01 DevaEldeen swcd(CoreUtils)[184] <Info>: Canceled URL 'https://m.mySiteName.com/.well-known/apple-app-site-association'
Mar  5 20:06:01 DevaEldeen swcd(CoreUtils)[184] <Notice>: ### Denying redirect 'https://m.mySiteName.com/apple-app-site-association' -> 'http://m.mySiteName.com/apple-app-site-association'
Mar  5 20:06:01 DevaEldeen swcd(CoreUtils)[184] <Notice>: Completing request for 'https://m.mySiteName.com/apple-app-site-association', status -6768/0xFFFFE590 kSecurityRequiredErr
Mar  5 20:06:01 DevaEldeen swcd(CoreUtils)[184] <Info>: Canceled URL 'https://m.mySiteName.com/apple-app-site-association'
Mar  5 20:06:01 DevaEldeen swcd(CoreUtils)[184] <Notice>: Closing URL session
Mar  5 20:06:01 DevaEldeen swcd(CoreUtils)[184] <Info>: Skipping scheduling retry of 'm.mySiteName.com' at retry limit (8 of 8)
Mar  5 20:06:01 DevaEldeen swcd(CoreUtils)[184] <Notice>: Retry needed for 'mySiteName.com' failure in 3h 12m 40s
Mar  5 20:06:01 DevaEldeen swcd(CoreUtils)[184] <Notice>: Scheduling recheck in 3h 12m 49s
Mar  5 20:06:01 DevaEldeen swcd(CFNetwork)[184] <Notice>: TIC TCP Conn Cancel [99:0x17e57310]
Mar  5 20:06:01 DevaEldeen swcd(CFNetwork)[184] <Notice>: TIC TCP Conn Destroyed [99:0x17e57310]
Mar  5 20:06:01 DevaEldeen swcd(libsystem_network.dylib)[184] <Info>: nw_endpoint_handler_cancel [99 m.mySiteName.com:443 ready resolver (satisfied)]
Mar  5 20:06:01 DevaEldeen swcd(libsystem_network.dylib)[184] <Info>: nw_endpoint_handler_cancel [99.1 104.25.215.11:443 ready socket-flow (satisfied)]
Mar  5 20:06:01 DevaEldeen swcd(libsystem_network.dylib)[184] <Notice>: __nw_socket_service_writes_block_invoke sendmsg(fd 4, 31 bytes): socket has been closed
Mar  5 20:06:01 DevaEldeen swcd(libsystem_network.dylib)[184] <Info>: nw_endpoint_flow_protocol_disconnected [99.1 104.25.215.11:443 cancelled socket-flow (null)] Output protocol disconnected
Mar  5 20:06:01 DevaEldeen swcd(libsystem_network.dylib)[184] <Info>: nw_endpoint_handler_cancel [99.2 104.25.214.11:443 initial path (null)]

1 个答案:

答案 0 :(得分:2)

在这种情况下,真正的答案是apple-app-site-association文件需要通过HTTPS访问。来自App Search Programming Guide

  

请注意

     

如果您的应用在iOS 9或更高版本中运行,并且您使用HTTPS来提供apple-app-site-association文件,则可以创建使用application / json MIME类型的纯文本文件,而您无需签字。如果您在iOS 8中支持Handoff和Shared Web Credentials,则仍需要按共享Web凭据参考中的描述对该文件进行签名。

对于iOS 8,您需要签署JSON文件,因此在这种情况下,可以通过HTTP提供,因为它是通过签名验证的。对于更新的iOS版本,它不需要签名,这很好,但是我们需要HTTPS来保护它。

原始无关答案:

如果你已经在Safari中,我相信它会留在Safari中。你应该尝试像Notes这样的另一个应用程序中的链接。此外,您的手机可能配置为始终访问该链接的网络。在这种情况下,您可以再次长按Notes中的URL,然后系统会提示您是要打开应用程序还是转到Web。