สำคัญ: ตั้งแต่วันที่
1 พฤษภาคม 2024 เป็นต้นไป Apple จะ
กำหนดให้ใช้ไฟล์ Manifest ด้านความเป็นส่วนตัวและลายเซ็นสำหรับแอปพลิเคชัน iOS ที่ใช้ SDK ที่ใช้กันโดยทั่วไป ซึ่งรวมถึง GoogleSignIn-iOS อัปเกรดเป็น GoogleSignIn-iOS v7.1.0 ขึ้นไปก่อนวันที่ 1 พฤษภาคม 2024 ทำตาม
คู่มือการอัปเกรด
ตรวจสอบเมตริกคำขอ App Check
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
หลังจากเพิ่มไลบรารี App Check ลงในแอปแล้ว แต่ก่อนที่จะเปิดใช้การบังคับใช้ App Check คุณควรตรวจสอบว่าการดำเนินการดังกล่าวจะไม่รบกวนผู้ใช้ที่ถูกต้องตามกฎหมายที่มีอยู่
เครื่องมือสำคัญที่คุณใช้ในการตัดสินใจนี้ได้คือเมตริกคำขอของ App Check
คุณสามารถตรวจสอบเมตริก App Check ได้ใน
Google API Console หรือคอนโซล Firebase
ตรวจสอบเมตริกใน Google API Console
หากต้องการดูเมตริกสำหรับไคลเอ็นต์ OAuth ของ iOS ให้ไปที่มุมมองแก้ไขของไคลเอ็นต์ในหน้าข้อมูลเข้าสู่ระบบ คุณจะเห็นเมตริกทางด้านขวาของหน้าในส่วนข้อมูลประจำตัว Google สำหรับ iOS เมตริกเหล่านี้
จะแสดงเมตริกคำขอ App Check เมตริกประกอบด้วยข้อมูลต่อไปนี้
-
จำนวนคำขอที่ยืนยันแล้ว - คำขอที่มีโทเค็น App Check ที่ถูกต้อง หลังจากที่คุณ
เปิดใช้การบังคับใช้ App Check แล้ว จะมีเพียงคำขอในหมวดหมู่นี้เท่านั้นที่จะสำเร็จ
-
จำนวนคำขอที่ยังไม่ยืนยัน: คำขอของไคลเอ็นต์ที่น่าจะล้าสมัย - คำขอที่ไม่มีโทเค็น App Check คำขอเหล่านี้อาจมาจากแอปเวอร์ชันเก่าที่ไม่มีการติดตั้งใช้งาน App Check
-
จำนวนคำขอที่ยังไม่ยืนยัน: คำขอที่ไม่ทราบต้นทาง - คำขอที่ไม่มีโทเค็น App Check
ซึ่งดูเหมือนว่าจะไม่ได้มาจากแอปของคุณ
-
จำนวนคำขอที่ยังไม่ยืนยัน: คำขอที่ไม่ถูกต้อง - คำขอที่มีโทเค็น App Check ไม่ถูกต้อง
ซึ่งอาจเป็นเพราะมีไคลเอ็นต์ที่ไม่น่าไว้วางใจพยายามแอบอ้างแอปของคุณ หรือเพราะ
สภาพแวดล้อมที่จำลอง
ตรวจสอบเมตริกในคอนโซล Firebase
คุณดูเมตริกสำหรับโปรเจ็กต์โดยรวมหรือ
สำหรับไคลเอ็นต์ OAuth แต่ละรายการได้โดยทำดังนี้
หากต้องการดูเมตริกคำขอ App Check สำหรับโปรเจ็กต์ ให้เปิดส่วน App Check ของคอนโซล Firebase แล้วขยายส่วน Google Identity สำหรับ iOS เช่น

หากต้องการดูเมตริกคำขอ App Check สำหรับไคลเอ็นต์ OAuth ที่เฉพาะเจาะจง ให้เปิดหน้าไคลเอ็นต์ OAuth ของคอนโซล Firebase แล้วขยายส่วนที่ตรงกับไคลเอ็นต์
เมตริกคำขอแบ่งออกเป็น 4 หมวดหมู่ ดังนี้
คำขอที่ยืนยันแล้วคือคำขอที่มีโทเค็น App Check ที่ถูกต้อง หลังจาก
เปิดใช้การบังคับใช้ App Check แล้ว เฉพาะคำขอในหมวดหมู่นี้เท่านั้นที่จะ
สำเร็จ
คำขอของไคลเอ็นต์ที่ล้าสมัยคือคำขอที่ไม่มีโทเค็น App Check
คำขอเหล่านี้อาจมาจาก Firebase SDK เวอร์ชันเก่า
ก่อนที่จะมีการรวม App Check ไว้ในแอป
คำขอจากแหล่งที่มาที่ไม่รู้จักคือคำขอที่ไม่มีโทเค็น App Check
และดูเหมือนว่าจะไม่ได้มาจาก Firebase SDK ซึ่งอาจมาจากคำขอที่สร้างด้วยคีย์ API ที่ถูกขโมยหรือคำขอที่ปลอมแปลงโดยไม่มี Firebase SDK
คำขอไม่ถูกต้องคือคำขอที่มีโทเค็น App Check ไม่ถูกต้อง ซึ่งอาจมาจากไคลเอ็นต์ที่ไม่น่าไว้วางใจที่พยายามแอบอ้างแอปของคุณ หรือมาจากสภาพแวดล้อมที่จำลอง
การเผยแพร่หมวดหมู่เหล่านี้สำหรับแอปของคุณควรเป็นข้อมูลประกอบการตัดสินใจเมื่อคุณเลือก
ที่จะเปิดใช้การบังคับใช้ โดยทำตามหลักเกณฑ์ต่อไปนี้
หากคำขอล่าสุดเกือบทั้งหมดมาจากไคลเอ็นต์ที่ยืนยันแล้ว ให้พิจารณา
เปิดใช้การบังคับใช้เพื่อเริ่มปกป้องปลายทางการให้สิทธิ์
หากคำขอที่ส่งล่าสุดส่วนใหญ่มาจากไคลเอ็นต์ที่น่าจะล้าสมัย
แล้ว เพื่อไม่ให้ผู้ใช้ได้รับผลกระทบ ให้รอจนกว่าจะมีผู้ใช้อัปเดต
แอปของคุณมากขึ้นก่อนที่จะเปิดใช้การบังคับใช้ การบังคับใช้ App Check ในแอปที่เผยแพร่แล้ว
จะทำให้แอปเวอร์ชันก่อนหน้าที่ไม่ได้ผสานรวมกับ
App Check SDK ใช้งานไม่ได้
หากแอปยังไม่ได้เปิดตัว คุณควรเปิดใช้การบังคับใช้ App Check
ทันที เนื่องจากไม่มีไคลเอ็นต์ที่ล้าสมัยที่ใช้งานอยู่
ขั้นตอนถัดไป
เมื่อเข้าใจว่า App Check จะส่งผลต่อผู้ใช้อย่างไรและพร้อมที่จะดำเนินการต่อแล้ว คุณจะเปิดใช้การบังคับใช้ App Check ได้
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-08-31 UTC
[null,null,["อัปเดตล่าสุด 2025-08-31 UTC"],[[["\u003cp\u003eBefore enforcing App Check, monitor its request metrics to understand its potential impact on existing users, particularly those using older app versions.\u003c/p\u003e\n"],["\u003cp\u003eApp Check metrics categorize requests into verified, outdated client, unknown origin, and invalid, helping you assess the risk of disrupting legitimate users.\u003c/p\u003e\n"],["\u003cp\u003eIf most requests are verified, consider enabling enforcement; if significant outdated client requests exist, wait for more users to update their app first.\u003c/p\u003e\n"],["\u003cp\u003eFor newly launched apps without existing users, enable App Check enforcement immediately to ensure security from the start.\u003c/p\u003e\n"],["\u003cp\u003eUse the Google API Console or Firebase Console to monitor App Check metrics and make informed decisions about enforcement timing.\u003c/p\u003e\n"]]],[],null,["After you add the App Check library to your app, but before you enable\nApp Check enforcement, you should make sure that doing so won't disrupt your\nexisting legitimate users.\n\nAn important tool you can use to make this decision are App Check\nrequest metrics. You can monitor App Check metrics in the\n[Google API Console](#monitor_metrics_in_the_google_cloud_console) or the [Firebase Console](#monitor_metrics_in_the_firebase_console).\n\nMonitor Metrics in the Google API Console\n\nTo view metrics for your iOS OAuth client, navigate to the edit view of the\nclient in the [Credentials page](https://console.cloud.google.com/apis/credentials). There, you will see metrics to the\nright of the page under the **Google Identity for iOS** section. These metrics\nwill show you your App Check request metrics. The metrics include the\nfollowing information:\n\n- **Number of verified requests** - requests that have a valid App Check token. After you enable App Check enforcement, only requests in this category will succeed.\n- **Number of unverified requests: likely outdated client requests** - requests missing an App Check token; these request may be from an older version of your app that doesn't include an App Check implementation.\n- **Number of unverified requests: unknown origin requests** - requests missing an App Check token that don't look like they are coming from your app.\n- **Number of unverified requests: invalid requests** - requests with an invalid App Check token, which may be from an inauthentic client attempting to impersonate your app, or from emulated environments.\n\nMonitor Metrics in the Firebase Console\n\nYou can view metrics for your projects as a whole, or\nfor individual OAuth clients:\n\n- To view the App Check request metrics for your project, open the\n [App Check](https://console.firebase.google.com/project/_/appcheck) section of the Firebase console and expand the\n **Google Identity for iOS** section. For example:\n\n- To view the App Check request metrics for a specific OAuth client, open the\n [OAuth clients](https://console.firebase.google.com/project/_/appcheck/products/oauth) page of the Firebase console and\n expand the section corresponding to the client.\n\nThe request metrics are broken down into four categories:\n\n- **Verified** requests are those that have a valid App Check token. After\n you enable App Check enforcement, only requests in this category will\n succeed.\n\n- **Outdated client** requests are those that are missing an App Check\n token. These requests might be from an older version of the Firebase SDK\n before App Check was included in the app.\n\n- **Unknown origin** requests are those that are missing an App Check token,\n and don't look like they come from the Firebase SDK. These might be from\n requests made with stolen API keys or forged requests made without the\n Firebase SDK.\n\n- **Invalid** requests are those that have an invalid\n App Check token, which might be from an inauthentic client attempting to\n impersonate your app, or from emulated environments.\n\nThe distribution of these categories for your app should inform when you decide\nto enable enforcement. Here are some guidelines:\n\n- If almost all of the recent requests are from verified clients, consider\n enabling enforcement to start protecting your auth endpoints.\n\n- If a significant portion of the recent requests are from likely-outdated\n clients, to avoid disrupting users, consider waiting for more users to update\n your app before enabling enforcement. Enforcing App Check on a released\n app will break prior app versions that are not integrated with the\n App Check SDK.\n\n- If your app hasn't launched yet, you should enable App Check enforcement\n immediately, since there aren't any outdated clients in use.\n\nNext steps\n\nWhen you understand how App Check will affect your users and you're ready to\nproceed, you can [enable App Check enforcement](/identity/sign-in/ios/appcheck/enable-enforcement)."]]