GMSNavigationServices
@interface GMSNavigationServices : NSObject
Services enabling control of mobile access to the Google Maps Navigation SDK for iOS.
-
For versions >= 5.5.0, indicates whether the terms and conditions have been acknowledged by the user.
For earlier versions, indicates whether the terms and conditions have been accepted by the user.
If false, the services disable access to navigation interfaces.
Declaration
Swift
class func areTermsAndConditionsAccepted() -> Bool
Objective-C
+ (BOOL)areTermsAndConditionsAccepted;
-
- Shows a modal dialog box if the app user has not yet accepted the Navigation SDK terms and
- conditions. The callback is sent on the main queue with the user’s response. *
- If the user has already accepted the terms and conditions, no dialog appears, and the callback
- contains
termsAccepted
=YES.
* - - parameter: options The
GMSNavigationTermsAndConditionsOptions
object which modifies the appearance - of the terms and conditions dialog. See
GMSNavigationTermsAndConditionsOptions
for more - information.
- - parameter: callback Block sent on the main queue with the user’s response.
Declaration
Swift
class func showTermsAndConditionsDialogIfNeeded(with options: GMSNavigationTermsAndConditionsOptions, callback: @escaping GMSTermsResponseCallback)
Objective-C
+ (void) showTermsAndConditionsDialogIfNeededWithOptions: (nonnull GMSNavigationTermsAndConditionsOptions *)options callback: (nonnull GMSTermsResponseCallback) callback;
-
Deprecated
Use the GMSNavigationTermsAndConditionsOptions API instead.
Deprecated. Use
GMSNavigationTermsAndConditionsOptions
API with+showTermsAndConditionsDialogIfNeededWithOptions:callback:
instead.Indicates if
-showTermsAndConditionsDialogIfNeededWithCompanyName:callback:
should display the driver awareness disclaimer only. The default isNO
and the disclaimer is shown in addition to the default terms and services provided with the Navigation SDK. Set toYES
to indicate that only the driver awareness disclaimer should be shown.If the project must show the Terms and Conditions dialog, setting this variable to
YES
has no effect. Additionally, the getter method always returnsNO
.This property must be set or read from the main thread.
Declaration
Swift
class var shouldOnlyShowDriverAwarenesssDisclaimer: Bool { get set }
Objective-C
@property (class, nonatomic) BOOL shouldOnlyShowDriverAwarenesssDisclaimer;
-
Deprecated
Use showTermsAndConditionsDialogWithOptions:callback: instead.
Deprecated. Use
+showTermsAndConditionsDialogIfNeededWithOptions:callback:
instead.Shows a modal dialog box if the app user has not yet accepted the Navigation SDK terms and conditions. The callback is sent on the main queue with the user’s response.
If the user has already accepted the terms and conditions, no dialog appears, and the callback contains
termsAccepted
=YES
SetcompanyName
parameter to your company. The company name appears in the terms and conditions text. The text explains to app users that location data may be shared with this company to improve operations.Call this method from the main thread. Multiple calls without waiting for a response have no effect.
Declaration
Swift
class func showTermsAndConditionsDialogIfNeeded(withTitle title: String?, companyName: String, uiParams UIParams: GMSNavigationTermsDialogUIParams?, callback: @escaping GMSTermsResponseCallback)
Objective-C
+ (void) showTermsAndConditionsDialogIfNeededWithTitle:(nullable NSString *)title companyName: (nonnull NSString *)companyName UIParams: (nullable GMSNavigationTermsDialogUIParams *)UIParams callback: (nonnull GMSTermsResponseCallback) callback;
Parameters
title
Title of the dialog box. If
title
is nil, the dialog uses the default title. Note: For custom titles, the caller of this method needs to localize this parameter. The default title is localized by the services automatically.companyName
Name of the company releasing the app and in the agreement with Google to share location data.
UIParams
Parameters defining the look and feel of the dialog box. If nil, the dialog box uses the default look and feel.
callback
Block sent on the main queue with the user’s response.
-
Deprecated
Use showTermsAndConditionsDialogWithOptions:callback: instead.
Deprecated. Use
+showTermsAndConditionsDialogIfNeededWithOptions:callback:
instead.Shows the terms and conditions dialog using the default look and feel.
See +showTermsAndConditionsDialogIfNeededWithTitle:companyName:UIParams:callback: for details, including a description of the parameters @title,
companyName
andcallback
.Declaration
Swift
class func showTermsAndConditionsDialogIfNeeded(withTitle title: String?, companyName: String, callback: @escaping GMSTermsResponseCallback)
Objective-C
+ (void) showTermsAndConditionsDialogIfNeededWithTitle:(nullable NSString *)title companyName: (nonnull NSString *)companyName callback: (nonnull GMSTermsResponseCallback) callback;
-
Deprecated
Use showTermsAndConditionsDialogWithOptions:callback: instead.
Deprecated. Use
+showTermsAndConditionsDialogIfNeededWithOptions:callback:
instead.Shows the terms and conditions dialog using the default title and look and feel.
See +showTermsAndConditionsDialogIfNeededWithTitle:companyName:UIParams:callback: for details, including a description of the parameters
companyName
andcallback
.Declaration
Swift
class func showTermsAndConditionsDialogIfNeeded(withCompanyName companyName: String, callback: @escaping GMSTermsResponseCallback)
Objective-C
+ (void) showTermsAndConditionsDialogIfNeededWithCompanyName: (nonnull NSString *)companyName callback: (nonnull GMSTermsResponseCallback) callback;
-
- Resets the terms and conditions to the unaccepted state. After calling this method,
+areTermsAndConditionsAccepted
will return NO, and #if SDK_BUILD_CONFIG(EnableNavSDKSkipToSOptions)+showTermsAndConditionsDialogIfNeededWithOptions:callback:
and #endif+showTermsAndConditionsDialogIfNeededWithCompanyName:callback:
will show the terms and- conditions dialog. The
navigationEnabled
property of any existingGMSMapView
instances will be - reset to NO.
Declaration
Swift
class func resetTermsAndConditionsAccepted()
Objective-C
+ (void)resetTermsAndConditionsAccepted;
-
Enables reporting of abnormal SDK terminations such as the app crashes while the SDK is still running. This allows Google to improve SDK stability when applicable. The default is
YES
and value must be updated before the services instance is initialized.This property must be set from the main thread.
Declaration
Swift
class func setAbnormalTerminationReportingEnabled(_ abnormalTerminationReportingEnabled: Bool)
Objective-C
+ (void)setAbnormalTerminationReportingEnabled: (BOOL)abnormalTerminationReportingEnabled;
-
Creates a new navigation session which is not associated with a map view.
This allocates and returns a new navigation session. Waypoints and options may be set on the session, and listeners may be added to it.
If the terms and conditions have not yet been accepted, this method will return nil. That is the only reason nil will be returned from this method.
You can associate this session with a map after creating it by using the
GMSMapView
method-enableNavigationWithSession:.
Sessions are heavyweight objects that consume memory, data, and battery, so they should be allocated only if a persistent navigation session is a major feature of the application. For the same reason, if your app creates a navigation UI after it establishes a navigation session, make sure to start the navigation UI with the existing navigation session rather than creating a new one.The lifetime of the navigation session is governed by normal Objective-C semantics. Therefore, the caller of this routine should save a reference to the session.
Declaration
Swift
class func createNavigationSession() -> GMSNavigationSession?
Objective-C
+ (nullable GMSNavigationSession *)createNavigationSession;
-
Returns the open source software license information for Google Navigation SDK for iOS. This information must be available within your application.
Declaration
Swift
class func openSourceLicenseInfo() -> String
Objective-C
+ (nonnull NSString *)openSourceLicenseInfo;
-
Returns the version for this release of the Navigation SDK for iOS.
Declaration
Swift
class func navSDKVersion() -> String
Objective-C
+ (nonnull NSString *)navSDKVersion;