關於環信客服的集成與使用

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

 

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