我进行了很多搜索,但没有得到任何演示。
我该如何将其集成到我的应用程序中?

我检查了许多来源,例如this answerthis site

最佳答案

嗨,我从您提供的链接http://dev.wechat.com/wechatapi中下载了英文版SDK。原来缺少某些方法。在最新的中文版本1.5中(所有注释均为中文),有类似的方法

+(BOOL) sendAuthReq:(SendAuthReq*) req viewController : (UIViewController*) viewController delegate:(id<WXApiDelegate>) delegate;


和课程:

#pragma mark - SendAuthReq
@interface SendAuthReq : BaseReq
@property (nonatomic, retain) NSString* scope;
@property (nonatomic, retain) NSString* state;
@end

#pragma mark - SendAuthResp
@interface SendAuthResp : BaseResp
@property (nonatomic, retain) NSString* code;
@property (nonatomic, retain) NSString* state;
@property (nonatomic, retain) NSString* lang;
@property (nonatomic, retain) NSString* country;
@end


请求方法示例:

-(void)sendAuthRequest
{
    SendAuthReq* req =[[[SendAuthReq alloc ] init ] autorelease ];
    req.scope = @"snsapi_userinfo" ;
    req.state = @"123" ;
    [WXApi sendReq:req];
}


如果您有兴趣,这是中文版download link

10-08 06:05