Triggers the native platform back navigation. This navigates back in the native navigation stack.
Confirmation that the back navigation was triggered.
Simple usage
import { PlatformModule, isSuccess, isErrorResponse } from '@grabjs/superapp-sdk';
// Initialize the platform module
const platform = new PlatformModule();
// Trigger back navigation
const response = await platform.back();
// Handle the response
if (isSuccess(response)) {
console.log('Back navigation triggered');
} else if (isErrorResponse(response)) {
console.error(`Error ${response.status_code}: ${response.error}`);
} else {
console.error('Unhandled response');
}
JSBridge module for controlling platform navigation.
Remarks
Provides methods to interact with the native platform navigation stack, such as triggering the back action. This code must run on the Grab SuperApp's WebView to function correctly.
Example
ES Module:
Example
CDN (UMD):