應用程式傳輸安全性
應用程式傳輸安全 (ATS) 是一項隱私權功能,可強制執行安全連線。根據預設,新應用程式都會啟用這項功能。
當不符合 ATS 規定的應用程式嘗試使用 HTTP 放送廣告時,系統會顯示以下記錄訊息:
應用程式傳輸安全性已封鎖明文 HTTP (http://) 資源載入,因為該資源不安全。您可以在應用程式的 Info.plist
檔案中設定暫時性例外狀況。
如要停用 ATS 限制,請在應用程式的 Info.plist
中新增下列例外狀況:
NSAllowsArbitraryLoadsForMedia
NSAllowsArbitraryLoadsInWebContent
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoadsForMedia</key>
<true/>
<key>NSAllowsArbitraryLoadsInWebContent</key>
<true/>
</dict>
您必須提供 NSAllowsArbitraryLoadsForMedia
和 NSAllowsArbitraryLoadsInWebContent
鍵,確保廣告不會受到 ATS 影響。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-02-08 (世界標準時間)。
[null,null,["上次更新時間:2025-02-08 (世界標準時間)。"],[[["App Transport Security (ATS) enforces secure connections and is enabled by default for new apps, blocking cleartext HTTP resource loads for enhanced security."],["To avoid ATS restrictions and ensure ad serving functionality, developers need to include `NSAllowsArbitraryLoadsForMedia` and `NSAllowsArbitraryLoadsInWebContent` exceptions within their app's `Info.plist` file."],["These exceptions allow media and web content to bypass ATS restrictions, preventing disruption to ad delivery."]]],["App Transport Security (ATS) enforces secure connections and is enabled by default. Non-compliant apps using HTTP trigger a log message indicating blocked insecure resource loads. To disable ATS restrictions for media and web content, add `NSAllowsArbitraryLoadsForMedia` and `NSAllowsArbitraryLoadsInWebContent` keys set to `true` within the app's `Info.plist` file, under the `NSAppTransportSecurity` dictionary. These exceptions are essential to prevent ads from being affected by ATS.\n"]]