本文整理汇总了Java中com.tencent.mm.sdk.openapi.IWXAPI.isWXAppInstalled方法的典型用法代码示例。如果您正苦于以下问题:Java IWXAPI.isWXAppInstalled方法的具体用法?Java IWXAPI.isWXAppInstalled怎么用?Java IWXAPI.isWXAppInstalled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.tencent.mm.sdk.openapi.IWXAPI
的用法示例。
在下文中一共展示了IWXAPI.isWXAppInstalled方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: login
import com.tencent.mm.sdk.openapi.IWXAPI; //导入方法依赖的package包/类
@Override
public void login(final Activity activity, Bundle pararms, final LoginCallback callback) {
DebugLog.d(TAG, "login()");
this.callback = callback;
IWXAPI wxapi = MyApp.getApp().getWXAPI();
if (!wxapi.isWXAppInstalled()) {
//提醒用户没有安装微信
String uninstalled = activity.getResources().getString(R.string.WeixinLogin_uninstalled);
CustomToast.makeText(activity,uninstalled, 2000).show();
return;
}
SendAuth.Req req = new SendAuth.Req();
req.scope = "snsapi_userinfo";
req.state = "wechat_sdk_demo";
wxapi.sendReq(req);
}
示例2: share
import com.tencent.mm.sdk.openapi.IWXAPI; //导入方法依赖的package包/类
@Override
public void share() {
if (App.getWechatAppId() == null) {
if (mListener != null) {
mListener.onError(this);
}
}
IWXAPI api = WXAPIFactory.createWXAPI(mContext, App.getWechatAppId(), false);
if (!api.isWXAppInstalled()) {
if (mListener != null) {
mListener.onError(this);
}
return;
}
WXWebpageObject web = new WXWebpageObject();
web.webpageUrl = mUrl;
WXMediaMessage msg = new WXMediaMessage(web);
msg.title = mTitle;
msg.description = mText;
msg.thumbData = AppUtil.toByteArray(AppUtil.getAppIcon(mContext));
SendMessageToWX.Req req = new SendMessageToWX.Req();
req.transaction = TRANSACTION + System.currentTimeMillis();
req.message = msg;
req.scene = getScene();
api.sendReq(req);
}
示例3: isInstalled
import com.tencent.mm.sdk.openapi.IWXAPI; //导入方法依赖的package包/类
public static boolean isInstalled(Context context, int type) {
if (context == null)
return false;
IWXAPI api = WXAPIFactory.createWXAPI(context, BuildConfig.WECHAT_APP_ID, false);
api.registerApp(BuildConfig.WECHAT_APP_ID);
return api.isWXAppInstalled();
}
示例4: init
import com.tencent.mm.sdk.openapi.IWXAPI; //导入方法依赖的package包/类
private IWXAPI init() {
IWXAPI iwxapi = WXAPIFactory.createWXAPI(activity, appId, false);
if (iwxapi.isWXAppInstalled() && iwxapi.isWXAppSupportAPI() && iwxapi.registerApp(appId)) {
return iwxapi;
}
return null;
}
示例5: onStart
import com.tencent.mm.sdk.openapi.IWXAPI; //导入方法依赖的package包/类
@Override
protected void onStart() {
if (App.getWechatAppId() == null) {
dispatchException();
return;
}
IWXAPI api = WXAPIFactory.createWXAPI(mContext, mAppId);
if (api == null) {
dispatchException();
return;
}
if (!api.isWXAppInstalled()) {
dispatchException();
return;
}
if (api.getWXAppSupportAPI() < Build.PAY_SUPPORTED_SDK_INT) {
dispatchException();
return;
}
api.registerApp(mAppId);
PayReq req = new PayReq();
req.appId = mAppId;
req.partnerId = mPartnerId;
req.prepayId = mPrepayId;
req.nonceStr = mNonceStr;
req.timeStamp = mTimeStamp;
req.packageValue = mPackageValue;
req.sign = mSign;
if (mExtData != null) {
req.extData = mExtData;
}
api.sendReq(req);
WXPayBroadcast broadcast = new WXPayBroadcast(mContext);
broadcast.setOnReceiveListener(new WXPayBroadcastReceiverListener());
if (mContext instanceof IStoppableManager) {
((IStoppableManager) mContext).bind(this);
}
broadcast.start();
}
示例6: a
import com.tencent.mm.sdk.openapi.IWXAPI; //导入方法依赖的package包/类
private void a()
{
IWXAPI iwxapi = WXAPIFactory.createWXAPI(this, "wx28e2610e92fbe111");
iwxapi.registerApp("wx28e2610e92fbe111");
if (iwxapi.isWXAppInstalled())
{
iwxapi.openWXApp();
}
}
示例7: onShareToWX
import com.tencent.mm.sdk.openapi.IWXAPI; //导入方法依赖的package包/类
public void onShareToWX(View v){
FmeiClient client = FmeiClient.getInstance(null);
IWXAPI api = WXAPIFactory.createWXAPI(getActivity(), com.emop.client.wxapi.Constants.APP_ID,
false);
if(api.isWXAppInstalled() && api.isWXAppSupportAPI()){
String trackId = "0";
if(client.trackUserId != null && client.trackUserId.trim().length() > 0){
trackId = client.trackUserId;
}
String imageURL = String.format(Constants.WEB_SHOP_LINK, trackId, shopId, shortKey);
try{
WXWebpageObject webObj = new WXWebpageObject(imageURL);
WXMediaMessage msg = new WXMediaMessage();
msg.mediaObject = webObj;
msg.title = "推荐你一个好店";
msg.description = title;
msg.thumbData = getThumbData();
SendMessageToWX.Req req = new SendMessageToWX.Req();
req.transaction = buildTransaction("img");
req.message = msg;
api.sendReq(req);
Log.i(Constants.TAG_EMOP, "sendReq");
} catch(Exception e) {
e.printStackTrace();
}
}else {
showToast("没有安装微信应用,不能分享到朋友圈.");
}
}
示例8: shareToWXFriends
import com.tencent.mm.sdk.openapi.IWXAPI; //导入方法依赖的package包/类
/**
* 分享到微信朋友圈
* @param context
* @param title
* @param url
*/
public static void shareToWXFriends(Activity context,String title,String url){
IWXAPI api = WXAPIFactory.createWXAPI(context,APP_ID,true);
api.registerApp(APP_ID);
// 检查是否安装微信
if(!api.isWXAppInstalled()) {
UIHelper.ToastMessage(context, "抱歉,您尚未安装微信客户端,无法进行微信分享!");
return;
}
// 检查是否支持
if(api.getWXAppSupportAPI() < MIN_SUPPORTED_VERSION) {
UIHelper.ToastMessage(context, "抱歉,您的微信版本不支持分享到朋友圈!");
return;
}
WXWebpageObject webpage = new WXWebpageObject();
webpage.webpageUrl = url;
WXMediaMessage msg = new WXMediaMessage(webpage);
msg.title = title;
msg.description = "分享地址:" + url;
// 缩略图的二进制数据
Bitmap thumb = BitmapFactory.decodeResource(context.getResources(), R.drawable.icon);
msg.thumbData = bmpToByteArray(thumb, true);
SendMessageToWX.Req req = new SendMessageToWX.Req();
// 分享的时间
req.transaction = String.valueOf(System.currentTimeMillis());
req.message = msg;
req.scene = SendMessageToWX.Req.WXSceneTimeline;
api.sendReq(req);
}
示例9: isWeiXinInstalled
import com.tencent.mm.sdk.openapi.IWXAPI; //导入方法依赖的package包/类
@Deprecated
public static boolean isWeiXinInstalled(Context context) {
IWXAPI api = WXAPIFactory.createWXAPI(context, ShareManager.CONFIG.getWxId(), true);
return api.isWXAppInstalled();
}
示例10: isWXAppInstalledAndSupported
import com.tencent.mm.sdk.openapi.IWXAPI; //导入方法依赖的package包/类
/**
*
*
* @Title: isWXAppInstalledAndSupported
* @Description: TODO 判断微信是否安装
* @author 李苜菲
* @return
* @return boolean
* @throws @date
* 2015年8月30日下午2:38:31
*/
public static boolean isWXAppInstalledAndSupported(Context context, IWXAPI api) {
System.out.println("检查微信是否安装 api:" + api + "isWXAppInstalled:" + api.isWXAppInstalled() + "isWXAppSupportAPI:"
+ api.isWXAppSupportAPI());
boolean sIsWXAppInstalledAndSupported = api.isWXAppInstalled() && api.isWXAppSupportAPI();
return sIsWXAppInstalledAndSupported;
}
示例11: checkWechatInvalidPay
import com.tencent.mm.sdk.openapi.IWXAPI; //导入方法依赖的package包/类
/**
* 检测微信支付是否安装
* @param context
* @param app_id
* @return
*/
public static boolean checkWechatInvalidPay(final Context context, String app_id) {
IWXAPI iwxapi = WXAPIFactory.createWXAPI(context, app_id);
return iwxapi.isWXAppInstalled();
}