GMSNavigationServices Class Reference

GMSNavigationServices Class Reference

Overview

Services enabling control of mobile access to the Google Maps Navigation SDK for iOS.

Static Public Member Functions

(BOOL) + areTermsAndConditionsAccepted
 For versions >= 5.5.0, indicates whether the terms and conditions have been acknowledged by the user.
(void) + showTermsAndConditionsDialogIfNeededWithOptions:callback:
 Shows a modal dialog box if the app user has not yet accepted the Navigation SDK terms and conditions.
(void) + showTermsAndConditionsDialogIfNeededWithTitle:companyName:UIParams:callback:
 Deprecated.
(void) + showTermsAndConditionsDialogIfNeededWithTitle:companyName:callback:
 Deprecated.
(void) + showTermsAndConditionsDialogIfNeededWithCompanyName:callback:
 Deprecated.
(void) + resetTermsAndConditionsAccepted
 Resets the terms and conditions to the unaccepted state.
(void) + setAbnormalTerminationReportingEnabled:
 Enables reporting of abnormal SDK terminations such as the app crashes while the SDK is still running.
(nullable GMSNavigationSession *) + createNavigationSession
 Creates a new navigation session which is not associated with a map view.
(NSString *) + openSourceLicenseInfo
 Returns the open source software license information for Google Navigation SDK for iOS.
(NSString *) + navSDKVersion
 Returns the version for this release of the Navigation SDK for iOS.

Properties

BOOL shouldOnlyShowDriverAwarenesssDisclaimer
 Deprecated.

(Note that these are not member functions.)

typedef void(^ GMSTermsResponseCallback )(BOOL termsAccepted)
 Called when the user accepts or rejects the terms and conditions.

Member Function Documentation

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.

+ (void) showTermsAndConditionsDialogIfNeededWithOptions: (GMSNavigationTermsAndConditionsOptions *)  options
callback: (GMSTermsResponseCallback callback 

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.

Parameters:
optionsThe GMSNavigationTermsAndConditionsOptions object which modifies the appearance of the terms and conditions dialog. See @ GMSNavigationTermsAndConditionsOptions for more information.
callbackBlock sent on the main queue with the user's response.
+ (void) showTermsAndConditionsDialogIfNeededWithTitle: (nullable NSString *)  title
companyName: (NSString *)  companyName
UIParams: (nullable GMSNavigationTermsDialogUIParams *)  UIParams
callback: (GMSTermsResponseCallback callback 

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.

Set companyName 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.

Parameters:
titleTitle 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.
Parameters:
companyNameName of the company releasing the app and in the agreement with Google to share location data.
UIParamsParameters defining the look and feel of the dialog box. If nil, the dialog box uses the default look and feel.
callbackBlock sent on the main queue with the user's response.
+ (void) showTermsAndConditionsDialogIfNeededWithTitle: (nullable NSString *)  title
companyName: (NSString *)  companyName
callback: (GMSTermsResponseCallback callback 

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 , companyName and callback.

+ (void) showTermsAndConditionsDialogIfNeededWithCompanyName: (NSString *)  companyName
callback: (GMSTermsResponseCallback callback 

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 and 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 existing GMSMapView instances will be reset to NO.

+ (void) setAbnormalTerminationReportingEnabled: (BOOL)  abnormalTerminationReportingEnabled

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.

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.

+ (NSString *) openSourceLicenseInfo

Returns the open source software license information for Google Navigation SDK for iOS.

This information must be available within your application.

+ (NSString *) navSDKVersion

Returns the version for this release of the Navigation SDK for iOS.


- (typedef void(^ GMSTermsResponseCallback)(BOOL termsAccepted)) [related]

Called when the user accepts or rejects the terms and conditions.

For versions >= 5.5.0, termsAccepted will always be YES.


Property Documentation

- (BOOL) shouldOnlyShowDriverAwarenesssDisclaimer [read, write, assign]

Deprecated.

Use GMSNavigationTermsAndConditionsOptions API with showTermsAndConditionsDialogIfNeededWithOptions:callback: instead.

Indicates if showTermsAndConditionsDialogIfNeededWithCompanyName:callback: should display the driver awareness disclaimer only. The default is NO and the disclaimer is shown in addition to the default terms and services provided with the Navigation SDK. Set to YES 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 returns NO .

This property must be set or read from the main thread.

Note:
This is deprecated. Use the GMSNavigationTermsAndConditionsOptions API instead.