Search in sources :

Example 1 with IWXAPI

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);
}
Also used : IWXAPI(com.tencent.mm.sdk.openapi.IWXAPI)

Example 2 with IWXAPI

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();
}
Also used : IWXAPI(com.tencent.mm.sdk.openapi.IWXAPI) WXWebpageObject(com.tencent.mm.sdk.modelmsg.WXWebpageObject) WXMediaMessage(com.tencent.mm.sdk.modelmsg.WXMediaMessage) SendMessageToWX(com.tencent.mm.sdk.modelmsg.SendMessageToWX)

Aggregations

IWXAPI (com.tencent.mm.sdk.openapi.IWXAPI)2 SendMessageToWX (com.tencent.mm.sdk.modelmsg.SendMessageToWX)1 WXMediaMessage (com.tencent.mm.sdk.modelmsg.WXMediaMessage)1 WXWebpageObject (com.tencent.mm.sdk.modelmsg.WXWebpageObject)1