All Products
Search
Document Center

Mobile Platform as a Service:Remove AP data

Last Updated:Jan 26, 2026

This API deletes data from the unified storage.

Using the removeAPDataStorage API

AlipayJSBridge.call('removeAPDataStorage', {
  type: "common",
  business: "customBusinessKey",
  key: "customKey",
}, function(result) {
  alert(JSON.stringify(result));
});

Code example

<button id="J_saveDataBtn" class="btn">Save data</button>
<button id="J_getDataBtn" class="btn">View data</button>
<button id="J_removeDataBtn" class="btn">Delete data</button>

<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('#J_saveDataBtn').addEventListener('click', function(e) {
    AlipayJSBridge.call('setAPDataStorage', {
      type: "common",
      business: "customBusinessKey",
      key: "customKey",
      value: "customValue"
    }, function(result) {
      alert(JSON.stringify(result));
    });
  }, false);

  document.querySelector('#J_getDataBtn').addEventListener('click', function(e) {
    AlipayJSBridge.call('getAPDataStorage', {
      type: "common",
      business: "customBusinessKey",
      key: "customKey"
    }, function(result) {
      alert(JSON.stringify(result));
    });
  }, false);

  document.querySelector('#J_removeDataBtn').addEventListener('click', function(e) {
    AlipayJSBridge.call('removeAPDataStorage', {
      type: "common",
      business: "customBusinessKey",
      key: "customKey"
    }, function(result) {
      alert(JSON.stringify(result));
    });
  }, false);
}, false);
</script>

API reference

AlipayJSBridge.call('removeAPDataStorage', {
  type, business, key
});

Input parameters

Property

Type

Description

Required

Default value

type

string

The storage dimension. Valid values: user for user-specific storage and common for public storage. The default value is common.

N

"common"

business

string

A custom business identifier. You can define this identifier by convention with the corresponding client access code. The default value is NebulaBiz.

On Android, this business identifier corresponds to the GROUD_ID that is passed when you create an APSharedPreferences object.

No

""

key

string

The key of the custom data.

Yes.

""

Output parameters

The parameter passed to the callback function is result: {success}.

Property

Type

Description

success

bool

Indicates whether the data is deleted successfully.