XApp
基于WebViewJavascriptBridge而设计并封装好的一种非常简单易用的Hybrid App的解决方案。指令式的交互方式。
Install / Use
/learn @nelsonkuang/XAppREADME
xApp
A Dead Simple Hybrid App Solution base on WebViewJavascriptBridge
xApp是基于WebViewJavascriptBridge而设计并封装好的一种非常简单易用的Hybrid App的解决方案。指令式的交互方式。
使用方式
- APP与网页版共存的情况,参照
sendToApp的电商平台APP,如下:
<a data-href="/goods/450630" data-id="450630" class="goodslink" href="javascript:void(0);">立刻参与</a>
if(xApp.isInApp()) { // 在APP Webview中打开
$(document).on('click', '.goodslink', function() {
var gid = $(this).attr('data-id');
sendToApp(1, gid); // '1' 为商品详情页跳转指令, gid 为商品ID, 打开ID为 gid 的商品详情页
});
} else { // 非APP下
$(document).on('click', '.goodslink', function() {
var href = $(this).attr('data-href');
window.location.href = href; // 直接打开网页链接
});
}
- Webview中h5页面加载时需要使用APP端传过来的用户GID
xApp.ready(function(data) {
var gId = data.gId;
// ...
});
Related Skills
node-connect
339.1kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
83.8kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
339.1kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
83.8kCommit, push, and open a PR
