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
 Indicates if the user has accepted the terms and conditions.
(void) + showTermsAndConditionsDialogIfNeededWithTitle:companyName:UIParams:callback:
 Shows a modal dialog box if the app user has not yet accepted the Navigation SDK terms and conditions.
(void) + showTermsAndConditionsDialogIfNeededWithTitle:companyName:callback:
 Shows the terms and conditions dialog using the default look and feel.
(void) + showTermsAndConditionsDialogIfNeededWithCompanyName:callback:
 Shows the terms and conditions dialog using the default title and look and feel.
(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
 Indicates if showTermsAndConditionsDialogIfNeededWithCompanyName:callback: should display the driver awareness disclaimer only.

(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

Indicates if the user has accepted the terms and conditions.

If false, the services disable access to navigation interfaces.

+ (void) showTermsAndConditionsDialogIfNeededWithTitle: (nullable NSString *)  title
companyName: (NSString *)  companyName
UIParams: (nullable GMSNavigationTermsDialogUIParams *)  UIParams
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.

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 

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 

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


Property Documentation

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

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.