相关疑难解决方法(0)

如何将WeChat API添加到Swift项目中?

我正在尝试将微信共享功能添加到我的项目中.但是,SDK文件,文档,开发指南示例项目都在Objective-C中.我正在Swift中编写我的项目.

我试过的

我将以下SDK文件添加到我的项目中

libWeChatSDK.a
WechatAuthSDK.h
WXApi.h
WXApiObject.h
Run Code Online (Sandbox Code Playgroud)

我尝试按照这个答案的建议使用桥接头.

MyProject的桥接,Header.h

#import "WXApi.h"
Run Code Online (Sandbox Code Playgroud)

错误

但是,我仍然无法在我的代码中使用WeChat API.我收到以下错误:

WXApiObject.h

- (void) setThumbImage:(UIImage *)image;    // Expected a type
Run Code Online (Sandbox Code Playgroud)

WXApi.h

+(BOOL) sendAuthReq:(SendAuthReq*) req viewController : (UIViewController*) viewController delegate:(id<WXApiDelegate>) delegate;
// Expected a type
Run Code Online (Sandbox Code Playgroud)

<unknown>:0: error: failed to import bridging header '[my path]/MyProject-Bridging-Header.h' 
Run Code Online (Sandbox Code Playgroud)

有没有人成功地将WeChat API与Swift项目一起使用?我很乐意看到一个简短的步骤列表或一些示例代码.我不介意是否有任何补充链接到中国资源.

ios wechat swift

7
推荐指数
1
解决办法
5828
查看次数

weChat SDK构建错误

我正在尝试让weChat SDK与我的应用程序一起使用.我按照下面的链接下载arm64文件,但没有运气.我仍然得到以下3个错误:

arm64上的WeChat SDK

Undefined symbols for architecture arm64:
  "operator new[](unsigned long)", referenced from:
      +[WeChatApiUtil EncodeBase64:] in libWeChatSDK.a(WeChatApiUtil.o)
      +[WeChatApiUtil NsDataEncodeBase64:] in libWeChatSDK.a(WeChatApiUtil.o)
      +[WeChatApiUtil DecodeWithBase64:] in libWeChatSDK.a(WeChatApiUtil.o)
      +[WeChatApiUtil DecodeBase64:] in libWeChatSDK.a(WeChatApiUtil.o)
  "operator delete[](void*)", referenced from:
      +[WeChatApiUtil EncodeBase64:] in libWeChatSDK.a(WeChatApiUtil.o)
      +[WeChatApiUtil NsDataEncodeBase64:] in libWeChatSDK.a(WeChatApiUtil.o)
      +[WeChatApiUtil DecodeWithBase64:] in libWeChatSDK.a(WeChatApiUtil.o)
      +[WeChatApiUtil DecodeBase64:] in libWeChatSDK.a(WeChatApiUtil.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Run Code Online (Sandbox Code Playgroud)

请帮忙...

ios wechat

3
推荐指数
1
解决办法
993
查看次数

标签 统计

ios ×2

wechat ×2

swift ×1