Skip to content

Commit

Permalink
Merge pull request #21 from googlemaps/arsalaza/fix-sample-app-contin…
Browse files Browse the repository at this point in the history
…uation

fix: address a couple of issues on the Android side
  • Loading branch information
ArturoSalazarB16 authored Feb 14, 2024
2 parents 7d238d1 + 859a2a5 commit d7b79ed
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion SampleApp/src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ const App: React.FC = (): ReactElement => {
const checkPermissions = async () => {
const result = await request(
Platform.OS == 'android'
? PERMISSIONS.ANDROID.ACCESS_COARSE_LOCATION
? PERMISSIONS.ANDROID.ACCESS_FINE_LOCATION
: PERMISSIONS.IOS.LOCATION_ALWAYS,
);

Expand Down
9 changes: 9 additions & 0 deletions components/navigation/navigationView/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,14 @@ export default class NavigationView extends React.Component<NavigationViewProps>
}
};

logDebugInfo = (message: string) => {
if (
this.props.navigationViewCallbacks != null &&
this.props.navigationViewCallbacks.logDebugInfo != null) {
this.props.navigationViewCallbacks.logDebugInfo(message);
}
};

/**
* Callback invoked when tapping on marker's info window.
* @platform Android only
Expand Down Expand Up @@ -345,6 +353,7 @@ export default class NavigationView extends React.Component<NavigationViewProps>
NavModuleEvt.addListener('onPolylineClick', this.onPolylineClick);
NavModuleEvt.addListener('onPolygonClick', this.onPolygonClick);
NavModuleEvt.addListener('onCircleClick', this.onCircleClick);
NavModuleEvt.addListener('logDebugInfo', this.logDebugInfo);
};

/**
Expand Down
7 changes: 7 additions & 0 deletions components/navigation/navigationView/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,13 @@ export interface NavigationViewCallbacks {
* @param errorCode - indicates the reason why navigation failed to initialize.
*/
onNavigationInitError?(errorCode: NavigationInitErrorCode): void;

/**
* Allows developers to listen for relevant debug logs.
*
* @param message relevant log message
*/
logDebugInfo?(message: string): void;
}

/**
Expand Down

0 comments on commit d7b79ed

Please sign in to comment.