GNSBeaconStrategy 클래스
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
NSObject를 상속합니다.
+ (instancetype) strategy |
|
|
|
모든 속성에 기본값을 사용하는 기본 전략을 반환합니다.
맞춤 전략을 반환합니다. paramsBlock
에서 모든 선택적 속성을 설정할 수 있습니다.
근처에 있는 iBeacon도 검색합니다.
기본값은 YES
입니다. iBeacon을 검색하면 iOS에서 위치 정보 액세스 권한 대화상자가 트리거되므로 iBeacon을 스캔하지 않으려면 NO
로 설정해야 합니다.
- (BOOL) allowInBackground |
|
readnonatomicassign |
앱이 백그라운드에 있을 때 비콘을 스캔해 봅니다.
기본값은 NO
입니다.
- (BOOL) lowPowerPreferred |
|
readnonatomicassign |
저전력 모드는 Eddystone 비콘을 스캔할 때만 사용할 수 있으며, iBeacon이 포함된 경우에는 무시됩니다.
지연 시간이 짧은 검색을 선호한다면 높은 배터리 비용으로 저전력 모드를 사용 중지하세요.
기본값은 YES
입니다.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 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`."]]