【问题标题】:We-Chat SDK integration iOS微信SDK集成iOS
【发布时间】:2015-04-16 06:22:40
【问题描述】:

我已经搜索了很多,但我没有得到任何演示。 我该如何将它集成到我的应用中?

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

【问题讨论】:

  • 他们提供了演示应用程序。从这里获取它dev.wechat.com/wechatapi/download
  • 我使用了那个演示,他们没有提供任何 API 集成演示来获取用户信息。
  • 您可以描述您遇到的问题。也许我可以帮助您。
  • @SeanChense,我想在点击“微信登录”按钮时获取用户信息。我没有得到任何可以看到微信 api 集成的演示。如果您知道,请提供一些演示。
  • Here is a Swift guide 将微信集成到应用程序中。

标签: ios iphone ios7 wechat


【解决方案1】:

您好,我从您提供的链接http://dev.wechat.com/wechatapi 下载英文版SDK。结果发现缺少一些方法。在最新的1.5中文版中(所有的cmets都是中文的)有类似的方法

+(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如果你有兴趣

【讨论】:

猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-01-01
  • 1970-01-01
  • 2013-06-06
  • 2013-08-18
  • 2011-08-26
  • 2018-06-07
相关资源
最近更新 更多