आवश्यक अनुमतियां
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
आपके ऐप्लिकेशन को इस्तेमाल किए गए हर एपीआई तरीके के लिए अनुमतियों का एलान करना होगा. ज़रूरी अनुमतियां अलग-अलग हो सकती हैं. यह इस बात पर निर्भर करता है कि आपके ऐप्लिकेशन में एपीआई के कौनसे तरीके और फ़ेंस टाइप इस्तेमाल किए गए हैं. हर तरीके के लिए कौनसी अनुमतियां ज़रूरी हैं, यह जानने के लिए इस दस्तावेज़ को देखें.
स्नैपशॉट एपीआई
नीचे दी गई टेबल में, Snapshot API के हर तरीके के लिए ज़रूरी अनुमतियां दी गई हैं:
तरीका |
Android की ज़रूरी अनुमति |
getDetectedActivity() |
android.permission.ACTIVITY_RECOGNITION
com.google.android.gms.permission.ACTIVITY_RECOGNITION
(Android 9 (एपीआई लेवल 28))
|
getBeaconState() |
android.permission.ACCESS_FINE_LOCATION |
getHeadphoneState() |
कोई नहीं |
getLocation() |
android.permission.ACCESS_FINE_LOCATION |
फ़ेंस एपीआई
नीचे दी गई टेबल में, Fence API के हर फ़ेंस टाइप के लिए ज़रूरी अनुमतियों के बारे में बताया गया है:
Fence API फ़ेंस टाइप |
Android की ज़रूरी अनुमति |
DetectedActivityFence |
android.permission.ACTIVITY_RECOGNITION
com.google.android.gms.permission.ACTIVITY_RECOGNITION
(Android 9 (एपीआई लेवल 28))
|
BeaconFence |
android.permission.ACCESS_FINE_LOCATION |
HeadphoneFence |
कोई नहीं |
LocationFence |
android.permission.ACCESS_FINE_LOCATION |
TimeFence |
कोई नहीं |
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2025-08-31 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 2025-08-31 (UTC) को अपडेट किया गया."],[[["\u003cp\u003eYour app must declare permissions for each Awareness API method used, with specific permissions varying based on the method and fence type.\u003c/p\u003e\n"],["\u003cp\u003eRefer to the provided documentation to identify the necessary permissions for each Awareness API method.\u003c/p\u003e\n"],["\u003cp\u003eThe Snapshot API requires specific permissions for accessing detected activities, beacon state, and location, while headphone state requires no permission.\u003c/p\u003e\n"],["\u003cp\u003eThe Fence API requires specific permissions for activity, beacon, and location fences, while headphone and time fences require no permission.\u003c/p\u003e\n"]]],["Apps must declare permissions for each API method used, varying by method and fence type. The `getDetectedActivity()` Snapshot API method and `DetectedActivityFence` require `android.permission.ACTIVITY_RECOGNITION` and `com.google.android.gms.permission.ACTIVITY_RECOGNITION`. `getBeaconState()`, `getLocation()`, `BeaconFence`, and `LocationFence` require `android.permission.ACCESS_FINE_LOCATION`. `getHeadphoneState()`, `HeadphoneFence`, and `TimeFence` require no specific permissions. Consult the documentation for specific method permission requirements.\n"],null,["# Required permissions\n\nYour app must declare permissions for each API method that's used. The\nrequired permissions vary. It depends on the API methods and fence types\nused by your app. Reference this documentation to learn which permissions are\nrequired for each method.\n\nSnapshot API\n------------\n\nThe following table shows the permissions required for each Snapshot API\nmethod:\n\n| Method | Required Android permission |\n|-------------------------|-------------------------------------------------------------------------------------------------------------------------------|\n| `getDetectedActivity()` | `android.permission.ACTIVITY_RECOGNITION` `com.google.android.gms.permission.ACTIVITY_RECOGNITION` (Android 9 (API level 28)) |\n| `getBeaconState()` | `android.permission.ACCESS_FINE_LOCATION` |\n| `getHeadphoneState()` | none |\n| `getLocation()` | `android.permission.ACCESS_FINE_LOCATION` |\n\nFence API\n---------\n\nThe following table shows the permissions required for each Fence API fence\ntype:\n\n| Fence API fence type | Required Android permission |\n|-------------------------|-------------------------------------------------------------------------------------------------------------------------------|\n| `DetectedActivityFence` | `android.permission.ACTIVITY_RECOGNITION` `com.google.android.gms.permission.ACTIVITY_RECOGNITION` (Android 9 (API level 28)) |\n| `BeaconFence` | `android.permission.ACCESS_FINE_LOCATION` |\n| `HeadphoneFence` | none |\n| `LocationFence` | `android.permission.ACCESS_FINE_LOCATION` |\n| `TimeFence` | none |"]]