GoogleNavigation Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
GMSNavigationSession
@interface GMSNavigationSession : NSObject
This class provides a set of related objects that can be used to programmatically control
a navigation session.
-
Whether or not navigation on this session is started.
A session cannot be started unless terms and conditions have previously
been accepted.
Starting a session is a prerequisite for activating guidance on the
session’s navigator, or for starting location updates from the session’s
road-snapped location provider.
A started session receives location from CoreLocation as determined
by the application’s location authorization. Your app can temporarily stop the Navigation SDK
from requesting location updates. For instance, it might do this in order to reduce battery usage
in a period when location updates are known to be unnecessary.
Declaration
Swift
var isStarted: Bool { get set }
Objective-C
@property (nonatomic, getter=isStarted) BOOL started;
-
The travel mode for this session.
-
An instance of GMSLocationSimulator
which can be used to simulate locations for this session,
or nil if terms and conditions have not been accepted.
-
The instance of GMSNavigator
managing this navigation session, or nil if terms and conditions
have not been accepted.
Declaration
Objective-C
@property (nonatomic, readonly, nullable) GMSNavigator *navigator;
-
The road-snapped location provider for this session, or nil if terms and conditions have not
been accepted.
-
Declaration
Objective-C
- (nonnull instancetype)init;
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-27 UTC.
[null,null,["Last updated 2025-08-27 UTC."],[[["\u003cp\u003e\u003ccode\u003eGMSNavigationSession\u003c/code\u003e provides programmatic control over navigation sessions, requiring prior acceptance of terms and conditions.\u003c/p\u003e\n"],["\u003cp\u003eStarting a session enables guidance activation via its navigator and location updates from its road-snapped location provider.\u003c/p\u003e\n"],["\u003cp\u003eIncludes properties for travel mode, a location simulator for testing, a navigator for guidance, and a road-snapped location provider.\u003c/p\u003e\n"],["\u003cp\u003eInstances are obtained through \u003ccode\u003eGMSNavigationServices\u003c/code\u003e, not direct initialization.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003estarted\u003c/code\u003e property manages whether navigation is actively running and receiving location updates.\u003c/p\u003e\n"]]],["The `GMSNavigationSession` class controls a navigation session. Key functionalities include starting/stopping navigation via `started` property, setting the `travelMode`, and managing location updates. It provides a `locationSimulator` for simulated locations. The `navigator` manages the session, and `roadSnappedLocationProvider` supplies road-snapped location data. A session cannot start without accepted terms, and location updates depend on app location authorization. Instances are obtained from `GMSNavigationServices`.\n"],null,["# GoogleNavigation Framework Reference\n\nGMSNavigationSession\n====================\n\n @interface GMSNavigationSession : NSObject\n\nThis class provides a set of related objects that can be used to programmatically control\na navigation session.\n- `\n ``\n ``\n `\n\n ### [started](#/c:objc(cs)GMSNavigationSession(py)started)\n\n `\n ` \n Whether or not navigation on this session is started.\n\n A session cannot be started unless terms and conditions have previously\n been accepted.\n\n Starting a session is a prerequisite for activating guidance on the\n session's navigator, or for starting location updates from the session's\n road-snapped location provider.\n\n A started session receives location from CoreLocation as determined\n by the application's location authorization. Your app can temporarily stop the Navigation SDK\n from requesting location updates. For instance, it might do this in order to reduce battery usage\n in a period when location updates are known to be unnecessary. \n\n #### Declaration\n\n Swift \n\n var isStarted: Bool { get set }\n\n Objective-C \n\n @property (nonatomic, getter=isStarted) BOOL started;\n\n- `\n ``\n ``\n `\n\n ### [travelMode](#/c:objc(cs)GMSNavigationSession(py)travelMode)\n\n `\n ` \n The travel mode for this session. \n\n #### Declaration\n\n Swift \n\n var travelMode: ../Enums/GMSNavigationTravelMode.html { get set }\n\n Objective-C \n\n @property (nonatomic) ../Enums/GMSNavigationTravelMode.html travelMode;\n\n- `\n ``\n ``\n `\n\n ### [locationSimulator](#/c:objc(cs)GMSNavigationSession(py)locationSimulator)\n\n `\n ` \n An instance of [GMSLocationSimulator](../Classes/GMSLocationSimulator.html) which can be used to simulate locations for this session,\n or nil if terms and conditions have not been accepted. \n\n #### Declaration\n\n Swift \n\n var locationSimulator: ../Classes/GMSLocationSimulator.html? { get }\n\n Objective-C \n\n @property (nonatomic, readonly, nullable) ../Classes/GMSLocationSimulator.html *locationSimulator;\n\n- `\n ``\n ``\n `\n\n ### [navigator](#/c:objc(cs)GMSNavigationSession(py)navigator)\n\n `\n ` \n The instance of [GMSNavigator](../Classes/GMSNavigator.html) managing this navigation session, or nil if terms and conditions\n have not been accepted. \n\n #### Declaration\n\n Swift \n\n var navigator: ../Classes/GMSNavigator.html? { get }\n\n Objective-C \n\n @property (nonatomic, readonly, nullable) ../Classes/GMSNavigator.html *navigator;\n\n- `\n ``\n ``\n `\n\n ### [roadSnappedLocationProvider](#/c:objc(cs)GMSNavigationSession(py)roadSnappedLocationProvider)\n\n `\n ` \n The road-snapped location provider for this session, or nil if terms and conditions have not\n been accepted. \n\n #### Declaration\n\n Swift \n\n var roadSnappedLocationProvider: ../Classes/GMSRoadSnappedLocationProvider.html? { get }\n\n Objective-C \n\n @property (nonatomic, readonly, nullable) ../Classes/GMSRoadSnappedLocationProvider.html *roadSnappedLocationProvider;\n\n- `\n ``\n ``\n `\n\n ### [-init](#/c:objc(cs)GMSNavigationSession(im)init)\n\n `\n ` \n Unavailable \n Instances of this class should be obtained by calling the method on [GMSNavigationServices](../Classes/GMSNavigationServices.html). \n\n #### Declaration\n\n Objective-C \n\n - (nonnull instancetype)init;"]]