关于环信客服的集成与使用

1.环信客服的集成:

APP接入 [环信客服云文档]下载商城Demo,

复制 HelpDesk.framework、Hyphenate.framework两个文件拖入工程,勾选“Copy items if needed”和“Create groups”,并点击“Finish”

 

这里设置为上图一样后自动会出现这项,所以这项就不用再添加了

 

在link binary with Libraries里面这两个SDK的status是Required,

将下载的demo中的HelpDeskUI文件夹拖到工程中(里面有第三方,如果跟原工程的第三方有冲突删掉相应的文件)

 

2.环信客服的使用

1)在工程info.plist文件中,增加隐私权限:

Privacy - Photo Library Usage Description 需要访问您的相册

Privacy - Microphone Usage Description 需要访问您的麦克风

Privacy - Camera Usage Description 需要访问您的摄像机

2)在pch文件或全局.h文件中添加如下代码:

#import<HelpDesk/HelpDesk.h>

#import"HelpDeskUI.h"

初始化

 

        //添加自定义小表情

        [[HDEmotionEscape sharedInstance] setEaseEmotionEscapePattern:@"\\[[^\\[\\]]{1,3}\\]"];

        [[HDEmotionEscape sharedInstance] setEaseEmotionEscapeDictionary:[HDConvertToCommonEmoticonsHelper emotionsDictionary]];

 

上传AppStore以及打包ipa注意事项

为了方便广大开发者开发测试,Demo中提供的framework文件支持x86_64 i386 armv7 arm64平台,上传AppStore(xcode10打包ipa)时需要剔除不需要的CPU架构支持,只剩余armv7、arm64

平台即可,命令如下:

包含实时音视频版本HelpDesk.framework

如果打包程序出错

去除SDK中的i386、x86_86。这里只能一个个去排查。

我当前使用到了aaaa.framework这个SDK,假设aaaa.framework存放的目录是:

/Users/leo/Desktop/testDir/aaaa.framework

1.使用终端进入到SDK内部

cd/Users/leo/Desktop/testDir/aaaa.framework

2.查看当前支持的架构

lipo -info aaaa

可以看到aaaa当前支持的架构:

Architecturesinthe fat file:aaaa are:i386 x86_64 armv7 arm64

删掉i386,x86_84

lipo -remove i386 aaaa -o aaaa

lipo -remove x86_64 aaaa -o aaa

再次执行打包就行了。

详细地址:Xcode11打包失败IPA processing failed - 云+社区 - 腾讯云

上架出错:

ERROR ITMS-90535: "Unexpected CFBundleExecutable Key. The bundle at '**/*.app/EaseUIResource.bundle' does not contain a bundle executable. If this bundle intentionally does not contain an executable, consider removing the CFBundleExecutable key from its Info.plist and using a CFBundlePackageType of BNDL. If this bundle is part of a third-party framework, consider contacting the developer of the framework for an update to address this issue."

解决:注意是某bundle的问题如EaseUIResource.bundle,删除里面 info.plist 里面的 Executable file 键 即可.

 

注明:直接用pod下来的Hyphenate会报错:

dyld: Library not loaded: @rpath/Hyphenate.framework/Hyphenate
  Referenced from: /Users/xxx.app/xxx
  Reason: image not found

把HelpDesk.framework、Hyphenate.framework在Genneral的Embed设为Do Not Embed

在Build Phases里设置Status为Optional运行后不报错,好像只能这样才可以运行,但是,问题来了,发送消息的时候会崩溃(或许集成有问题),所以我改成了上面直接用Demo里的SDK

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章