การอนุญาตให้ใช้สิทธิแอป
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
Google Play เสนอบริการให้สัญญาอนุญาต ซึ่งทำให้คุณบังคับใช้นโยบายการให้สัญญาอนุญาตสำหรับแอปพลิเคชันที่คุณเผยแพร่ใน Google Play ได้ เมื่อใช้การอนุญาตให้ใช้สิทธิของ Google Play แอปพลิเคชันของคุณจะสามารถส่งคำถามไปยัง Google Play ขณะรันไทม์เพื่อขอสถานะการให้สัญญาอนุญาตสำหรับผู้ใช้คนปัจจุบัน จากนั้นจึงให้อนุญาตหรือไม่ให้อนุญาตการใช้งานตามความเหมาะสม
บริการนี้ช่วยให้คุณใช้นโยบายการอนุญาตให้ใช้สิทธิที่ยืดหยุ่นได้ในแต่ละแอปพลิเคชัน โดยแต่ละแอปพลิเคชันสามารถบังคับใช้การอนุญาตให้ใช้สิทธิในลักษณะที่เหมาะสมที่สุด หากจำเป็น แอปพลิเคชันจะใช้ข้อจำกัดที่กำหนดเองตามสถานะการอนุญาตให้ใช้สิทธิที่ได้รับจาก Google Play ได้
เช่น แอปพลิเคชันสามารถตรวจสอบสถานะการอนุญาตให้ใช้สิทธิ แล้วใช้ข้อจำกัดที่กำหนดเองซึ่งอนุญาตให้ผู้ใช้เรียกใช้แอปพลิเคชันดังกล่าวได้โดยไม่ได้รับอนุญาตเป็นระยะเวลาหนึ่งๆ นอกจากนี้ แอปพลิเคชันยังจำกัดการใช้แอปพลิเคชันเฉพาะอุปกรณ์หนึ่งๆ ได้ด้วย นอกเหนือจากข้อจำกัดอื่นๆ
บริการอนุญาตให้ใช้สิทธิเป็นวิธีควบคุมการเข้าถึงแอปพลิเคชันอย่างปลอดภัย เมื่อแอปพลิเคชันตรวจสอบสถานะการอนุญาตให้ใช้สิทธิ เซิร์ฟเวอร์ Google Play จะลงนามในการตอบกลับสถานะการอนุญาตให้ใช้สิทธิโดยใช้คู่คีย์ที่เชื่อมโยงกับแอปพลิเคชันนั้นๆ โดยเฉพาะ แม้ว่าแอปพลิเคชันจะจัดเก็บคีย์สาธารณะไว้ในไฟล์ .apk
ที่คอมไพล์แล้วได้ แต่การยืนยันการตอบกลับสถานะการอนุญาตให้ใช้สิทธิในเซิร์ฟเวอร์ที่คุณเชื่อถือจะปลอดภัยกว่ามาก
แอปพลิเคชันที่คุณเผยแพร่ผ่าน Google Play สามารถใช้บริการการให้สัญญาอนุญาตของ Google Play ได้ โดยที่คุณไม่ต้องมีบัญชีพิเศษหรือการลงทะเบียน นอกจากนี้ เนื่องจากบริการนี้ไม่ได้ใช้ API เฟรมเวิร์กเฉพาะ คุณจึงเพิ่มการอนุญาตให้ใช้สิทธิในแอปพลิเคชันใดก็ได้ที่ใช้ API ระดับ 3 ขึ้นไปเป็นอย่างต่ำ
หมายเหตุ: บริการการอนุญาตให้ใช้สิทธิของ Google Play มีไว้สำหรับแอปพลิเคชันแบบชำระเงินที่ต้องการยืนยันว่าผู้ใช้ปัจจุบันได้ชำระเงินสำหรับแอปพลิเคชันนั้นใน Google Play จริง อย่างไรก็ตาม แอปพลิเคชันใดๆ (รวมถึงแอปที่ไม่มีค่าใช้จ่าย) สามารถใช้บริการอนุญาตให้ใช้สิทธิเพื่อเริ่มการดาวน์โหลดไฟล์เสริมของ APK ได้ ในกรณีนี้ คำขอที่แอปพลิเคชันของคุณส่งไปยังบริการอนุญาตให้ใช้สิทธิไม่ได้เป็นการตรวจสอบว่าผู้ใช้ชำระเงินสำหรับแอปหรือไม่ แต่เป็นการขอ URL ของไฟล์ส่วนขยาย ดูข้อมูลเกี่ยวกับการดาวน์โหลดไฟล์สำหรับขยายของแอปพลิเคชันได้ที่คู่มือไฟล์สำหรับขยายของ APK
หากต้องการดูข้อมูลเพิ่มเติมเกี่ยวกับบริการอนุญาตให้ใช้แอปพลิเคชันของ Google Play และเริ่มผสานรวมบริการดังกล่าวเข้ากับแอปพลิเคชันของคุณ โปรดอ่านเอกสารต่อไปนี้
- การอนุญาตให้ใช้สิทธิ
ภาพรวม
- อธิบายวิธีการทำงานของบริการและลักษณะการใช้งานการออกใบอนุญาตตามปกติ
- การตั้งค่าเพื่อขอรับการอนุญาตให้ใช้สิทธิ
- อธิบายวิธีตั้งค่าบัญชี Google Play, สภาพแวดล้อมการพัฒนา และสภาพแวดล้อมการทดสอบเพื่อเพิ่มการอนุญาตให้ใช้สิทธิในแอป
- การเพิ่มการยืนยันใบอนุญาตฝั่งเซิร์ฟเวอร์ลงในแอป
- แสดงคำแนะนำแบบทีละขั้นตอนในการเพิ่มการยืนยันการอนุญาตให้ใช้สิทธิฝั่งเซิร์ฟเวอร์ลงในแอปพลิเคชัน
- การอนุญาตให้ใช้สิทธิ
ข้อมูลอ้างอิง
- ให้รายละเอียดเกี่ยวกับคลาสของไลบรารีการอนุญาตให้ใช้สิทธิและโค้ดการตอบกลับของบริการ
ตัวอย่างเนื้อหาและโค้ดในหน้าเว็บนี้ขึ้นอยู่กับใบอนุญาตที่อธิบายไว้ในใบอนุญาตการใช้เนื้อหา Java และ OpenJDK เป็นเครื่องหมายการค้าหรือเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-27 UTC
[null,null,["อัปเดตล่าสุด 2025-07-27 UTC"],[],[],null,["# App Licensing\n\nGoogle Play offers a licensing service that lets you enforce licensing policies for\napplications that you publish on Google Play. With Google Play Licensing, your application can\nquery Google Play at run time to obtain the licensing status for the current user, then allow or\ndisallow further use as appropriate.\n\nUsing the service, you can apply a flexible licensing policy on an application-by-application\nbasis---each application can enforce licensing in the way most appropriate for it. If necessary,\nan application can apply custom constraints based on the licensing status obtained from Google Play.\nFor example, an application can check the licensing status and then apply custom constraints\nthat allow the user to run it unlicensed for a specific validity period. An application can also\nrestrict use of the application to a specific device, in addition to any other constraints.\n\nThe licensing service is a secure means of controlling access to your applications. When an\napplication checks the licensing status, the Google Play server signs the licensing status\nresponse using a key pair that is uniquely associated with the application. Although it's possible\nfor your application to store the public key in its compiled `.apk` file, it's much\nsafer to verify the licensing status response on a server that you trust.\n\nAny application that you publish through Google Play can use the Google Play Licensing\nservice. No special account or registration is needed. Additionally, because the service uses no\ndedicated framework APIs, you can add licensing to any application that uses a minimum API level of\n3 or higher.\n\n**Note:** The Google Play Licensing service is primarily intended\nfor paid applications that wish to verify that the current user did in fact pay for the application\non Google Play. However, any application (including free apps) may use the licensing service\nto initiate the download of an APK expansion file. In which case, the request that your application\nsends to the licensing service is not to check whether the user paid for the app, but to request the\nURL of the expansion files. For information about downloading expansion files for your application,\nread the guide to [APK Expansion Files](/google/play/expansion-files).\n\nTo learn more about Google Play's application licensing service and start integrating it into\nyour applications, read the following documents:\n\n**[Licensing\nOverview](/google/play/licensing/overview)**\n: Describes how the service works and what a typical licensing implementation looks\n like.\n\n**[Setting Up for\nLicensing](/google/play/licensing/setting-up)**\n: Explains how to set up your Google Play account, development environment, and\n testing environment in order to add licensing to your app.\n\n**[Adding\nServer-Side License Verification to Your App](/google/play/licensing/server-side-verification)**\n: Provides a step-by-step guide to add server-side licensing verification to your application.\n\n**[Licensing\nReference](/google/play/licensing/licensing-reference)**\n: Provides detailed information about the licensing library's classes and the service response\n codes."]]