Skip to content

Bitkeep JS 公共 APIs

bitkeep.js 是 Bitget Wallet 对外提供的一项钱包 Bridge API 。安装 BGW 钱包后你可以使用此 API 与钱包交互。

SDK 源码

打开 URL

javascript
//In APP
BitKeepInvoke.openUrl("https://www.google.com");
//Our Of APP
BitKeepInvoke.openUrl2("https://www.google.com");
//In APP
BitKeepInvoke.openUrl("https://www.google.com");
//Our Of APP
BitKeepInvoke.openUrl2("https://www.google.com");

关闭页面

javascript
BitKeepInvoke.close();
BitKeepInvoke.close();

显示/隐藏 Loading

javascript
BitKeepInvoke.showLoading();
BitKeepInvoke.hideLoading();
BitKeepInvoke.showLoading();
BitKeepInvoke.hideLoading();

在右上角显示文本按钮

javascript
BitKeepInvoke.setTextAction("Text", function () {
  //Click Callback
});
BitKeepInvoke.setTextAction("Text", function () {
  //Click Callback
});

在右上角显示图片按钮

javascript
BitKeepInvoke.setIconAction("http://xxx.png", function () {
  //Click Callback
});
BitKeepInvoke.setIconAction("http://xxx.png", function () {
  //Click Callback
});

Toast

javascript
BitKeepInvoke.toast("Hello World");
BitKeepInvoke.toast("Hello World");

Alert

javascript
BitKeepInvoke.alert("Hello", callback);
BitKeepInvoke.alert("Hello", callback);

Confirm

javascript
BitKeepInvoke.confirm("Hello?", callback);
BitKeepInvoke.confirm("Hello?", callback);

分享文本

javascript
BitKeepInvoke.shareText("message", callback);
BitKeepInvoke.shareText("message", callback);

分享图片

javascript
BitKeepInvoke.shareImage("http://xxx.png", callback);
BitKeepInvoke.shareImage("http://xxx.png", callback);

分享截图

javascript
BitKeepInvoke.shareScreenshot(callback);
BitKeepInvoke.shareScreenshot(callback);

分享 URL

javascript
BitKeepInvoke.shareUrl("title", "description", "url", "icon", callback);
BitKeepInvoke.shareUrl("title", "description", "url", "icon", callback);