写在前面:
当前版本的不支持支付,后期会添加支付的方法。
- kTestWeiXinAppId:微信申请下来的AppId
- kTestWeiXinSecret:微信申请下来的AppSecret
- kTestSendState:与第一步位置二内容相同即可
#####使用方式:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
[[Vendor_WeiXin sharedHandler] initWeiXin];
return YES;
}
#pragma mark - WeiXin
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url
{
return [WXApi handleOpenURL:url delegate:self];
}
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
{
BOOL isSuc = [WXApi handleOpenURL:url delegate:self];
NSLog(@"url %@ isSuc %d",url,isSuc == YES ? 1 : 0);
//有登录需求的加上下面这句
[[Vendor_WeiXin sharedHandler] accessWXAuthProgress:url];
return isSuc;
}
分享途径
typedef enum {
kShareTool_WeiXinFriends = 0, // 微信好友
kShareTool_WeiXinCircleFriends, // 微信朋友圈
kShareTool_WeiXinCollection, // 微信收藏
} ShareToolType;
分享类型
typedef enum {
kShareMedia_WeiXinText = 0, //文字
kShareMedia_WeiXinImage, //图片
kShareMedia_WeiXinMusic, //音频
kShareMedia_WeiXinVideo, //视频
kShareMedia_WeiXinLink, //链接
} ShareMediaType;
获取使用微信登录的用户在微信里的信息
@protocol Vendor_WeiXinDelegate <NSObject>
-(void)getWeiXinLoginUserInfo:(WX_UserInfoModel *)userinfo;
@end