差别
这里会显示出您选择的修订版和当前版本之间的差别。
两侧同时换到之前的修订记录 前一修订版 | 后一修订版 两侧同时换到之后的修订记录 | ||
cs:300visitoraccess:iosagentsdk [2017/11/20 03:03] fanxn |
cs:300visitoraccess:iosagentsdk [2017/11/20 04:00] fanxn |
||
---|---|---|---|
行 19: | 行 19: | ||
* [[#添加消息监听|消息监听]] | * [[#添加消息监听|消息监听]] | ||
- | === SDK介绍 === | + | ==== SDK介绍 ==== |
1、文件介绍:依赖库包括HyphenateLite.framework和AgentSDK.framework两个framework,二者缺一不可。 | 1、文件介绍:依赖库包括HyphenateLite.framework和AgentSDK.framework两个framework,二者缺一不可。 | ||
- | === 准备工作 === | + | ==== 准备工作 ==== |
1、工程中导入 HyphenateLite.framework和AgentSDK.framework 【勾选 Copy items if needed 和 Create groups】。\\ | 1、工程中导入 HyphenateLite.framework和AgentSDK.framework 【勾选 Copy items if needed 和 Create groups】。\\ | ||
2、选中当前的TARGET,向General -> Embedded Binaries 中添加以上两个依赖库.Linked Frameworks and Libraries 中会自动增加。\\ | 2、选中当前的TARGET,向General -> Embedded Binaries 中添加以上两个依赖库.Linked Frameworks and Libraries 中会自动增加。\\ | ||
行 35: | 行 35: | ||
#endif | #endif | ||
</code> | </code> | ||
- | === 上传AppStore注意事项 === | + | ==== 上传AppStore注意事项 ==== |
- | 为了方便广大开发者开发测试,Demo中提供的二进制文件支持x86_64 armv7 arm64等平台,上传AppStore需要剔除不需要的CPU架构支持,只剩余armv7、arm64 | + | 为了方便广大开发者开发测试,framework中提供的二进制文件支持x86_64 armv7 arm64等平台,上传AppStore需要剔除不需要的CPU架构支持,只剩余armv7、arm64 |
平台即可,命令如下: | 平台即可,命令如下: | ||
- | lipo .../AgentSDK -remove x86_64 -output .../AgentSDK //剔除x86_64 | + | <code> |
- | 剔除后可用lipo -info .../AgentSDK 查看是否成功剥离 | + | 【首先进入AgentSDK.framework所在的目录】 |
- | === 集成离线推送 === | + | //移除二进制文件的x86_64支持 |
+ | lipo AgentSDK.framework/AgentSDK -remove x86_64 -output AgentSDK //剔除x86_64 | ||
+ | //替换framework内部二进制文件【记得备份】 | ||
+ | mv AgentSDK AgentSDK.framework/AgentSDK | ||
+ | //查看剥离后二进制文件支持的CPU架构,如果现实armv7 arm64 ,则完成剥离 | ||
+ | lipo -info AgentSDK.framework/AgentSDK | ||
+ | </code> | ||
+ | <code> | ||
+ | 【首先进入HyphenateLite.framework所在目录】 | ||
+ | // 移除二进制文件的x86_64支持 | ||
+ | lipo HyphenateLite.framework/HyphenateLite -remove x86_64 -output HyphenateLite | ||
+ | //替换framework内部二进制文件【记得备份】 | ||
+ | mv HyphenateLite HyphenateLite.framework/HyphenateLite | ||
+ | //查看剥离后的二进制文件支持的CPU架构,如果显示armv7 arm64,就完成剥离 | ||
+ | lipo -info HyphenateLite.framework/HyphenateLite | ||
+ | </code> | ||
+ | ==== 集成离线推送 ==== | ||
<code> | <code> | ||
- (void)registerRemoteNotification { //注册离线推送 | - (void)registerRemoteNotification { //注册离线推送 | ||
行 59: | 行 75: | ||
} | } | ||
</code> | </code> | ||
+ | ** APNs注册失败,一般是由于使用了通用证书或者是模拟器调试导致,请检查证书并用真机调试。此处是 iOS 系统报的错,如仍不能确定,请从网上查找相关资料。** | ||
=== 初始化 === | === 初始化 === | ||
在didFinishLaunchingWithOptions中调用初始化方法: | 在didFinishLaunchingWithOptions中调用初始化方法: |