if(![self.garSessionisGeospatialModeSupported:GARGeospatialModeEnabled]){[selfsetErrorStatus:@"GARGeospatialModeEnabled is not supported on this device."];return;}GARSessionConfiguration*configuration=[[GARSessionConfigurationalloc]init];configuration.geospatialMode=GARGeospatialModeEnabled;[self.garSessionsetConfiguration:configurationerror:&error];if(error){[selfsetErrorStatus:[NSStringstringWithFormat:@"Failed to configure GARSession: %d",(int)error.code]];return;}
[null,null,["最后更新时间 (UTC):2025-07-26。"],[[["\u003cp\u003eLearn how to configure your iOS app to use the ARCore Geospatial API for building location-based AR experiences.\u003c/p\u003e\n"],["\u003cp\u003eBefore you begin, ensure you have the necessary prerequisites, including fundamental AR concepts and ARCore session configuration knowledge.\u003c/p\u003e\n"],["\u003cp\u003eEnable the ARCore API in your Google Cloud project and add the required ARCore Geospatial libraries to your iOS app's Podfile.\u003c/p\u003e\n"],["\u003cp\u003eConfigure your ARCore session to enable Geospatial capabilities, ensuring device compatibility and requesting necessary location permissions.\u003c/p\u003e\n"],["\u003cp\u003eCheck Geospatial availability at the device's current location to understand the expected accuracy and limitations of the API.\u003c/p\u003e\n"]]],["To utilize the Geospatial API, first enable the ARCore API in your Google Cloud project and add the necessary ARCore libraries to your app's `Podfile` (specifying iOS 11.0 or later). Ensure device compatibility and enable Geospatial capabilities in the ARCore session configuration. Request location permissions from the user. Verify VPS availability at the device's location. Then you can use the API to obtain the device's geospatial transform and check VPS availability.\n"],null,["# Enable the Geospatial API for your iOS app\n\nConfigure your app's settings so that it can use the [Geospatial API](/ar/develop/geospatial).\n\nPrerequisites\n-------------\n\nMake sure that you understand [fundamental AR concepts](/ar/develop/fundamentals)\nand how to [configure an ARCore session](/ar/develop/ios/session-config) before proceeding.\n\nIf you want to run a sample app that demonstrates the functionality described\nhere, see the\n[ARCore Geospatial quickstart for iOS](/ar/develop/ios/geospatial/quickstart).\n\nSee the\n[Introduction to the Geospatial API](/ar/develop/geospatial) for more\ninformation about the Geospatial API.\n\nIf you're new to developing with ARCore, see [Getting started](/ar/develop/getting-started)\nfor information about software and hardware requirements, prerequisities and\nother information specific to the platforms you are using.\n\nEnable the ARCore API\n---------------------\n\nBefore using the Visual Positioning System (VPS) in your app, you must first\nenable the [**ARCore API**](/ar/develop/authorization?platform=ios)\nin a new or existing Google Cloud project. This service is responsible for\nhosting, storing, and resolving Geospatial anchors.\n\nKeyless authorization is preferred, but API Key authorization is also supported.\n\nAdd required libraries to your app\n----------------------------------\n\nAfter authorizing your app to call the ARCore API, you must add libraries to\nenable Geospatial features in your app.\nUpdate the `Podfile` for your app to include the ARCore SDK and supported iOS versioning. To do this:\n\n\u003cbr /\u003e\n\n1. Add the following `platform` and `pod` to your\n project's `Podfile`:\n\n platform :ios, '11.0'\n pod 'ARCore/Geospatial', '~\u003e 1.50.0'\n\n You may also specify `platform :ios, '10.0'`, if you want to support iOS 10,\n but note that the Geospatial API will only function at runtime on iOS \\\u003e= 11.\n | **Note:** To ensure that your project includes the correct ARCore version, **specify\n | all three of the `ARCore` version digits** in your `pod`. For example, use `1.31.0` instead of `1.31`.\n2. Open a Terminal window and run `pod install` from the folder where\n your Xcode project exists. \n\n This generates an `.xcworkspace` file that you use to build and\n run the app.\n\nBe sure your development environment satisfies the ARCore SDK requirements, as\ndescribed in the [Quickstart](/ar/develop/ios/geospatial/quickstart).\n\nEnable Geospatial capabilities in the session configuration\n-----------------------------------------------------------\n\nCheck device compatibility\n--------------------------\n\nNot all devices that support ARCore also support the Geospatial API, as\ndescribed in the [quickstart](/ar/develop/ios/geospatial/quickstart#device-support).\n\nUse\n[`GARSession.isGeospatialModeSupported:`](/ar/reference/ios/interface_g_a_r_session#ae0bdf3c3c987a5c3df8914c6fcd3c5a6)\nto check the device, as in the following: \n\n if (![self.garSession isGeospatialModeSupported:GARGeospatialModeEnabled]) {\n [self setErrorStatus:@\"GARGeospatialModeEnabled is not supported on this device.\"];\n return;\n }\n\n GARSessionConfiguration *configuration = [[GARSessionConfiguration alloc] init];\n configuration.geospatialMode = GARGeospatialModeEnabled;\n [self.garSession setConfiguration:configuration error:&error];\n if (error) {\n [self setErrorStatus:[NSString stringWithFormat:@\"Failed to configure GARSession: %d\",\n (int)error.code]];\n return;\n }\n\nAsk user for location permissions at runtime\n--------------------------------------------\n\nYour app must request the following location permissions at runtime, before\nconfiguring the session:\n\n- [`kCLAuthorizationStatusAuthorizedWhenInUse`](https://developer.apple.com/documentation/corelocation/clauthorizationstatus/kclauthorizationstatusauthorizedwheninuse)\n- [`CLAccuracyAuthorizationFullAccuracy`](https://developer.apple.com/documentation/corelocation/claccuracyauthorization/claccuracyauthorizationfullaccuracy?language=objc) (Applies when iOS \\\u003e= 14)\n\nCheck Geospatial availability at the device's current location\n--------------------------------------------------------------\n\nBecause the Geospatial API uses a combination of [VPS](/ar/develop/geospatial#global_localization_with_vps) and GPS to determine a Geospatial transform, the API can be used as long as the device is able to determine its location. In areas with low GPS accuracy, such as indoor spaces and dense urban environments, the API will rely on VPS coverage to generate high accuracy transforms. Under typical conditions, VPS can be expected to provide positional accuracy of approximately 5 meters, and rotational accuracy of 5 degrees. Use [`GARSession.checkVPSAvailabilityAtCoordinate:completionHandler:`](/ar/reference/ios/category_g_a_r_session_07_geospatial_08#ab4c2672d3a5f1869663ddb72d1c83189) to determine if a given location has VPS coverage.\n\nThe Geospatial API can also be used in areas that do not have VPS coverage. In outdoor environments with few or no overhead obstructions, GPS may be sufficient to generate a transform with high accuracy.\n\nWhat's next\n-----------\n\n- [Obtain the device camera's Geospatial transform](/ar/develop/ios/geospatial/obtain-device-pose) to determine the exact location of the user's device in the real world.\n- [Check VPS availability](/ar/develop/ios/geospatial/check-vps-availability) at a device's given location."]]