use of com.taobao.weex.annotation.JSMethod in project WeexErosFramework by bmfe.
the class ToolModule method getCid.
/**
* 获取个推的Cid
*/
@JSMethod
public void getCid(JSCallback callback) {
WeexEventBean weexEventBean = new WeexEventBean();
weexEventBean.setKey(WXConstant.WXEventCenter.EVENT_GETCID);
weexEventBean.setContext(mWXSDKInstance.getContext());
weexEventBean.setJscallback(callback);
ManagerFactory.getManagerService(DispatchEventManager.class).getBus().post(weexEventBean);
}
use of com.taobao.weex.annotation.JSMethod in project WeexErosFramework by bmfe.
the class ToolModule method scan.
@JSMethod(uiThread = true)
public void scan(JSCallback callback) {
WeexEventBean eventBean = new WeexEventBean();
eventBean.setContext(mWXSDKInstance.getContext());
eventBean.setKey(WXConstant.WXEventCenter.EVENT_CAMERA);
eventBean.setJscallback(callback);
ManagerFactory.getManagerService(DispatchEventManager.class).getBus().post(eventBean);
}
use of com.taobao.weex.annotation.JSMethod in project WeexErosFramework by bmfe.
the class WeChatLoginModule method wechat.
@JSMethod
public void wechat(String parameterString, JSCallback callback) {
WeexEventBean weexEventBean = new WeexEventBean();
weexEventBean.setKey(WXConstant.WXEventCenter.EVENT_WECHATLOGIN);
weexEventBean.setContext(mWXSDKInstance.getContext());
weexEventBean.setJscallback(callback);
weexEventBean.setJsParams(parameterString);
ManagerFactory.getManagerService(DispatchEventManager.class).getBus().post(weexEventBean);
}
use of com.taobao.weex.annotation.JSMethod in project WeexErosFramework by bmfe.
the class WebSocketModule method send.
@JSMethod
public void send(String data) {
Log.e(TAG, "send>>>>>>" + data + this);
if (!reportErrorIfNoAdapter()) {
LightlyWebSocketAdapter bmWebSocketAdapter = (LightlyWebSocketAdapter) webSocketAdapter;
bmWebSocketAdapter.send(data, mWXSDKInstance.getInstanceId());
}
}
use of com.taobao.weex.annotation.JSMethod in project WeexErosFramework by bmfe.
the class WebSocketModule method close.
@JSMethod
public void close(String code, String reason) {
if (!reportErrorIfNoAdapter()) {
Log.e(TAG, "close>>>>>>" + reason);
int codeNumber = WebSocketCloseCodes.CLOSE_NORMAL.getCode();
if (code != null) {
try {
codeNumber = Integer.parseInt(code);
} catch (NumberFormatException e) {
// ignore
}
}
LightlyWebSocketAdapter bmWebSocketAdapter = (LightlyWebSocketAdapter) webSocketAdapter;
bmWebSocketAdapter.close(codeNumber, reason, mWXSDKInstance.getInstanceId());
}
}
Aggregations