GNSBeaconस्ट्रेटजी क्लास
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
बीकन को स्कैन करने की रणनीति.
NSObject को इनहेरिट करता है.
|
(instancetype) | + strategy |
| डिफ़ॉल्ट रणनीति दिखाता है, जो सभी प्रॉपर्टी के लिए डिफ़ॉल्ट वैल्यू का इस्तेमाल करती है. ज़्यादा...
|
|
(instancetype) | + strategyWithParamsBlock: |
| पसंद के मुताबिक बनाई गई रणनीति दिखाता है. paramsBlock में किसी भी वैकल्पिक प्रॉपर्टी को सेट किया जा सकता है. ज़्यादा...
|
|
+ (instancetype) strategy |
|
|
|
डिफ़ॉल्ट रणनीति दिखाता है, जो सभी प्रॉपर्टी के लिए डिफ़ॉल्ट वैल्यू का इस्तेमाल करती है.
पसंद के मुताबिक बनाई गई रणनीति दिखाता है. paramsBlock
में किसी भी वैकल्पिक प्रॉपर्टी को सेट किया जा सकता है.
आस-पास के iBeacon पर भी स्कैन करें.
डिफ़ॉल्ट वैल्यू YES
है. iBeacon को स्कैन करने पर iOS से, जगह की जानकारी की अनुमति वाला डायलॉग ट्रिगर होता है. इसलिए, अगर आप iBeacons को स्कैन नहीं करना चाहते, तो आपको इसे NO
पर सेट करना चाहिए.
- (BOOL) allowInBackground |
|
readnonatomicassign |
जब ऐप्लिकेशन बैकग्राउंड में चल रहा हो, तब बीकन स्कैन करने की कोशिश करें.
डिफ़ॉल्ट वैल्यू NO
है.
- (BOOL) lowPowerPreferred |
|
readnonatomicassign |
सिर्फ़ Eddystone बीकन के लिए स्कैन करते समय कम पावर मोड उपलब्ध होता है; iBeacon शामिल किए जाने पर इसे अनदेखा कर दिया जाता है.
अगर आपको इंतज़ार का समय कम करना है, तो ज़्यादा बैटरी खर्च करके, कम पावर वाले मोड को बंद करें.
डिफ़ॉल्ट वैल्यू YES
है.
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2025-08-13 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 2025-08-13 (UTC) को अपडेट किया गया."],[[["\u003cp\u003eThe \u003ccode\u003eGNSBeaconStrategy\u003c/code\u003e class defines the strategy used to scan for nearby beacons, including iBeacons and Eddystone beacons.\u003c/p\u003e\n"],["\u003cp\u003eIt provides methods for creating default and custom strategies, allowing control over scan behavior like background scanning and power usage.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eincludeIBeacons\u003c/code\u003e property determines whether to scan for iBeacons alongside Eddystone beacons, requiring location permissions if enabled.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eallowInBackground\u003c/code\u003e enables scanning while the app is in the background, while \u003ccode\u003elowPowerPreferred\u003c/code\u003e prioritizes lower battery consumption when scanning for Eddystone beacons only.\u003c/p\u003e\n"]]],[],null,["# GNSBeaconStrategy Class\n\n[Class Methods](#pub-static-methods) \\| [Properties](#properties) \nGNSBeaconStrategy Class Reference \n\nOverview\n--------\n\nThe strategy to use to scan for beacons.\n\nInherits NSObject.\n\n|----------------|---------------------------------------------------------------------------------------------------------------------------------------|\n| Class Method Summary -------------------- ||\n| (instancetype) | + [strategy](/nearby/messages/ios/reference/interface_g_n_s_beacon_strategy#adb20ee9c949a83bb6b40f298afc8d18c) |\n| | Returns the default strategy, which uses the default values for all properties. [More...](#adb20ee9c949a83bb6b40f298afc8d18c) |\n| ||\n| (instancetype) | + [strategyWithParamsBlock:](/nearby/messages/ios/reference/interface_g_n_s_beacon_strategy#ae4369cbfc0033043904d608a941ffab9) |\n| | Returns a custom strategy. You can set any of the optional properties in `paramsBlock`. [More...](#ae4369cbfc0033043904d608a941ffab9) |\n| ||\n\n|------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Property Summary ---------------- ||\n| BOOL | [includeIBeacons](/nearby/messages/ios/reference/interface_g_n_s_beacon_strategy#a760bff5c7b04f6aca45f5eb1b00f64d6) |\n| | Scan also for nearby iBeacons. [More...](#a760bff5c7b04f6aca45f5eb1b00f64d6) |\n| ||\n| BOOL | [allowInBackground](/nearby/messages/ios/reference/interface_g_n_s_beacon_strategy#a78563e40e80e958da3381600240063d7) |\n| | Try to scan for beacons when the app is in the background. [More...](#a78563e40e80e958da3381600240063d7) |\n| ||\n| BOOL | [lowPowerPreferred](/nearby/messages/ios/reference/interface_g_n_s_beacon_strategy#a24d256ff2f7cf627b539534bb0a1241d) |\n| | Low power mode is available when scanning for Eddystone beacons only; it is ignored when iBeacons are included. [More...](#a24d256ff2f7cf627b539534bb0a1241d) |\n| ||\n\nMethod Detail\n-------------\n\n|---------------------------|---|---|---|\n| + (instancetype) strategy | | | |\n\nReturns the default strategy, which uses the default values for all properties. \n\n|-------------------------------------------|---|-----------------------------------------------------------------------------------------------------------------|---------------|---|\n| + (instancetype) strategyWithParamsBlock: | | (void(\\^)([GNSBeaconStrategyParams](/nearby/messages/ios/reference/interface_g_n_s_beacon_strategy_params) \\*)) | *paramsBlock* | |\n\nReturns a custom strategy. You can set any of the optional properties in `paramsBlock`.\n\nProperty Detail\n---------------\n\n|-----------------------------------------------------------|---------------------|\n| |--------------------------| | - (BOOL) includeIBeacons | | readnonatomicassign |\n\nScan also for nearby iBeacons.\n\nThe default is `YES`. Scanning for iBeacons triggers a location permission dialog from iOS, so you should set this to `NO` if you don't want to scan for iBeacons. \n\n|---------------------------------------------------------------|---------------------|\n| |----------------------------| | - (BOOL) allowInBackground | | readnonatomicassign |\n\nTry to scan for beacons when the app is in the background.\n\nThe default is `NO`. \n\n|---------------------------------------------------------------|---------------------|\n| |----------------------------| | - (BOOL) lowPowerPreferred | | readnonatomicassign |\n\nLow power mode is available when scanning for Eddystone beacons only; it is ignored when iBeacons are included.\n\nTurn off low power mode if you prefer lower latency scanning, at a higher battery cost.\n\nThe default is `YES`."]]