Triggers the native platform back navigation. This navigates back in the native navigation stack.
This method can return the following status_code values:
204 (No Content): Back navigation triggered successfully.500 (Internal Server Error): An unexpected error occurred.501 (Not Implemented): Requires Grab app environment.import { PlatformModule, isSuccess, isError } 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 (isError(response)) {
console.error(`Error ${response.status_code}: ${response.error}`);
} else {
console.error('Unhandled response');
}
SDK module for controlling platform navigation via
JSBridge.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):