微信调用APP接口
来源:互联网 发布:黑蚂蚁网络电视安卓版 编辑:程序博客网 时间:2024/04/30 13:53
(function (w,d) {
if (!window.rBridge) {
window.rBridge = {};
}
var isJSBridge = false;
function connectJSBridge(callback) {
if (w.JSBridge) {
isJSBridge = true;
callback(JSBridge);
} else {
d.addEventListener('JSBridgeReady', function() {
isJSBridge = true;
callback(JSBridge);
}, false);
}
}
rBridge = {
version : '1.0',
isJSBridge:function(){
return isJSBridge;
},
callback:function(e){
},
init:function(){
var _self = this;
connectJSBridge(function(bridge) {
bridge.init(function(message, responseCallback) {
var data = { 'Javascript Responds':'Wee!' };
bridge.callEventCallback(responseCallback,data,message);
});
var apiList ={
loadDetail:function(e){
if(isJSBridge){
JSBridge.callAPI("NativeDetail", e.data);
return true;
} else {
return false;
}
},
loadTalent:function(e){
if(isJSBridge){
JSBridge.callAPI("NativeTalent", e.data);
return true;
} else {
return false;
}
},
login:function(e){
if(isJSBridge){
JSBridge.callAPI("NativeLogin");
return true;
}else{
return false;
}
},
register:function(e){
if(isJSBridge){
JSBridge.callAPI("NativeRegister");
return true;
}else{
return false;
}
},
getToken:function(e){
if(isJSBridge){
return JSBridge.callAPI("NativeGetTokenSync");
}else{
return "";
}
},
/**
* App分享页面
* @param e
* @returns {*}
*/
share:function(e){
if(isJSBridge){
try{
JSBridge.registerHandler("functionInShare", function(data, responseCallback) {
var responseData = e.data;
responseCallback(responseData);
});
}catch(ee){
return false;
}
return true;
}else{
return false;
}
},
Index:function(e){
if(isJSBridge){
return JSBridge.callAPI("NativeIndex");
}else{
return "";
}
}
};
_self.callback(apiList);
});
return true;
}
};
rBridge.init();
if (!window.rBridge) {
window.rBridge = {};
}
var isJSBridge = false;
function connectJSBridge(callback) {
if (w.JSBridge) {
isJSBridge = true;
callback(JSBridge);
} else {
d.addEventListener('JSBridgeReady', function() {
isJSBridge = true;
callback(JSBridge);
}, false);
}
}
rBridge = {
version : '1.0',
isJSBridge:function(){
return isJSBridge;
},
callback:function(e){
},
init:function(){
var _self = this;
connectJSBridge(function(bridge) {
bridge.init(function(message, responseCallback) {
var data = { 'Javascript Responds':'Wee!' };
bridge.callEventCallback(responseCallback,data,message);
});
var apiList ={
loadDetail:function(e){
if(isJSBridge){
JSBridge.callAPI("NativeDetail", e.data);
return true;
} else {
return false;
}
},
loadTalent:function(e){
if(isJSBridge){
JSBridge.callAPI("NativeTalent", e.data);
return true;
} else {
return false;
}
},
login:function(e){
if(isJSBridge){
JSBridge.callAPI("NativeLogin");
return true;
}else{
return false;
}
},
register:function(e){
if(isJSBridge){
JSBridge.callAPI("NativeRegister");
return true;
}else{
return false;
}
},
getToken:function(e){
if(isJSBridge){
return JSBridge.callAPI("NativeGetTokenSync");
}else{
return "";
}
},
/**
* App分享页面
* @param e
* @returns {*}
*/
share:function(e){
if(isJSBridge){
try{
JSBridge.registerHandler("functionInShare", function(data, responseCallback) {
var responseData = e.data;
responseCallback(responseData);
});
}catch(ee){
return false;
}
return true;
}else{
return false;
}
},
Index:function(e){
if(isJSBridge){
return JSBridge.callAPI("NativeIndex");
}else{
return "";
}
}
};
_self.callback(apiList);
});
return true;
}
};
rBridge.init();
})(window,document);
调用:
var bridgeObj;
rscBridge.callback = function(appB) {
bridgeObj= appB;
bridgeObj.share({data: {imgUrl: $("#avatar").val(), link: window.location.href}});
}
0 0
- 微信调用APP接口
- APP调用微信支付接口-服务端二次签名
- web app调用微信、qq、等分享接口
- APP调用微信支付接口-服务端二次签名
- 微信接口调用
- 微信接口调用
- APP微信支付接口
- 微信APP支付接口
- 微信js接口调用
- 调用微信接口方法
- APP调用微信支付接口-服务端二次签名失败原因及解决方法
- APP接入微信支付接口
- 微信APP支付接口文档
- PHP开发APP微信支付接口
- App微信支付 php后台接口
- PHP开发APP微信支付接口
- app微信退款接口Java 后台
- 微信app开发支付接口相关
- 彻底禁用ECSHOP缓存
- 快速掌握一个语言最常用的50%
- 20170301
- CentOS里ifcfg的device指的是什么?
- 红黑二叉树左转、右转
- 微信调用APP接口
- Linux内核修炼之framebuffer分析
- cryEngine5.3打包
- Android M 新的运行时权限开发者需要知道的一切
- RSA算法原理(下)
- Python的一些数值类型
- 蓝牙及蓝牙通讯Bluetooth概述
- 牛腩(6)-未实现该方法或操作
- [leetcode]9. Palindrome Number