All Products
Search
Document Center

Mobile Platform as a Service:Page resume

Last Updated:Jan 28, 2026

When a WebView window returns to the top of the stack, the page resume event is triggered. This happens when an app is brought from the background, resumes from the lock screen, or when a user navigates back from a subsequent page.

If you return to the window using popWindow or popTo and pass a data parameter, the page can retrieve these parameters.

If the app's resume event occurs before the window's resume event, the event object also contains a resumeParams property. This property includes the parameters received when the app resumed.

Note
  • In client versions 10.0.15 and later, the container provides the pageResume and appResume events. These events help distinguish the specific cause of a resume event. The resume event combines two scenarios: appResume, which occurs when the client is brought from the background or resumes from the lock screen, and pageResume, which occurs when a window is displayed again after you navigate back from a subsequent page.

  • The native Android resume and pause events cannot distinguish whether the app was sent to the background or a page was switched. For this reason, the pageResume and pagePause events are implemented as callbacks recorded through JSAPI calls. These events apply only to switching between windows within the same session. They do not apply to other methods that switch pages, such as startApp or chooseImage.

How to use the resume interface

document.addEventListener('resume', function(e) {
  console.log("resumed");
}, false);

Code example

The following example shows how to return data:

<h1>Click "Open New Page". Data is sent back to this page on return.</h1>
<a href="#" class="btn J_demo">Open New Page</a>
<script>
function ready(callback) {
  // If jsbridge is already injected, call it directly.
  if (window.AlipayJSBridge) {
    callback && callback();
  } else {
    // If not, listen for the injection event.
    document.addEventListener('AlipayJSBridgeReady', callback, false);
  }
}
ready(function() {
  document.querySelector('a').addEventListener('click', function() {
    AlipayJSBridge.call('pushWindow', {
      url: location.pathname
    });
  });

  document.addEventListener('back', function(e) {
    e.preventDefault();

    AlipayJSBridge.call('popWindow', {
      data: {
        from: location.href,
        info: Date.now()
      }
    });
  });

  document.addEventListener('resume', function(event) {
    alert('Content from the previous page: ' + JSON.stringify(event.data));
  });
});
</script>

API

Output parameters

The event handler receives an event parameter with the following properties:

Name

Type

Description

data

Object

The content passed from popTo or popWindow within the current app instance. Data cannot be passed across different appId s.

resumeParams

Object

Contains the parameters received when the app resume event occurred.