use of com.tencent.mm.sdk.openapi.IWXAPI in project JustAndroid by chinaltz.
the class AppRegister method onReceive.
@Override
public void onReceive(Context context, Intent intent) {
final IWXAPI api = WXAPIFactory.createWXAPI(context, null);
boolean fg = api.registerApp(Constants.APP_ID);
Log.i("GFH", "fg======================" + fg);
}
use of com.tencent.mm.sdk.openapi.IWXAPI in project Notes by lguipeng.
the class AboutActivity method shareToWeChat.
private void shareToWeChat(int scene) {
IWXAPI api = WXAPIFactory.createWXAPI(this, BuildConfig.WECHAT_ID, true);
if (!api.isWXAppInstalled()) {
SnackbarUtils.show(this, R.string.not_install_app);
}
api.registerApp(BuildConfig.WECHAT_ID);
WXWebpageObject object = new WXWebpageObject();
object.webpageUrl = "http://www.wandoujia.com/apps/com.lguipeng.notes";
WXMediaMessage msg = new WXMediaMessage(object);
msg.mediaObject = object;
msg.thumbData = getLogoBitmapArray();
msg.title = getString(R.string.app_desc);
msg.description = getString(R.string.share_text, "", "");
SendMessageToWX.Req request = new SendMessageToWX.Req();
request.message = msg;
request.scene = scene;
api.sendReq(request);
api.unregisterApp();
}
Aggregations