{"id":18438132,"url":"https://github.com/easemob/easemob-demo-ios","last_synced_at":"2025-04-07T20:34:59.759Z","repository":{"id":37101691,"uuid":"296504385","full_name":"easemob/easemob-demo-ios","owner":"easemob","description":null,"archived":false,"fork":false,"pushed_at":"2024-10-31T08:31:24.000Z","size":86743,"stargazers_count":22,"open_issues_count":7,"forks_count":20,"subscribers_count":12,"default_branch":"main","last_synced_at":"2024-10-31T09:27:49.692Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/easemob.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-09-18T03:32:49.000Z","updated_at":"2024-10-31T08:31:28.000Z","dependencies_parsed_at":"2024-04-28T04:40:47.761Z","dependency_job_id":"2d1e639b-6696-49d4-a41a-98c7f1fadcfd","html_url":"https://github.com/easemob/easemob-demo-ios","commit_stats":null,"previous_names":["easemob/easemob-demo-ios","easemob/chat-ios"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/easemob%2Feasemob-demo-ios","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/easemob%2Feasemob-demo-ios/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/easemob%2Feasemob-demo-ios/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/easemob%2Feasemob-demo-ios/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/easemob","download_url":"https://codeload.github.com/easemob/easemob-demo-ios/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223291935,"owners_count":17121040,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T06:18:42.878Z","updated_at":"2024-11-06T06:18:44.843Z","avatar_url":"https://github.com/easemob.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 产品介绍\n\n环信新版本UIKit Demo：打造卓越聊天体验的强大工具\n\n全面功能，产品化体验\n\n环信UIKit Demo为您提供全面的聊天功能，助力您轻松构建功能强大、产品化的聊天体验。从基本的文字消息到高级的群组互动，我们的Demo涵盖了所有市场通用能力，让您能够满足用户的各种聊天需求。\n\n开箱即用，快速集成\n\n我们的Demo经过精心设计，可轻松集成到您的现有应用程序中。清晰的代码结构和详尽的文档让您能够快速上手，无需繁琐的配置和开发工作。\n\n应用服务器示例代码，简化集成\n\n为了进一步简化集成过程，我们提供了完整的应用服务器示例代码，展示了如何将您的应用程序连接到环信IM后端。这将帮助您轻松实现聊天功能的部署和运行。\n\n功能亮点:\n\n流畅的实时消息传递\n语音和视频通话\n文件共享\n群组聊天\n线程讨论\n群组成员管理\n消息提醒\n可定制界面\n预配置的聊天功能\n应用服务器示例代码\n\n立即体验环信新版本UIKit Demo，开始构建您的梦想聊天应用程序吧！\n\n# 产品体验\n\n![](./demo.png)\n\n#  前置环境需求\n\n- Xcode 15.0及以上版本 原因是UIKit中使用了部分检测音频AVAudioApplication api适配iOS17以上系统\n- 最低支持系统：iOS 13.0\n- 请确保您的项目已设置有效的开发者签名\n\n可以使用 CocoaPods 安装 EaseChatUIKit 作为 Xcode 项目的依赖项。\n\n在podfile中添加如下依赖\n\n```ruby\nsource 'https://github.com/CocoaPods/Specs.git'\nplatform :ios, '13.0'\n\ntarget 'YourTarget' do\n  use_frameworks!\n\n  pod 'EaseChatUIKit'\nend\n\npost_install do |installer|\n  installer.pods_project.targets.each do |target|\n    target.build_configurations.each do |config|\n      config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'\n    end\n  end\nend\n```\n\n然后cd到终端下podfile所在文件夹目录执行\n\n```\n    pod install\n```\n\n\u003e⚠️Xcode15编译报错 ```Sandbox: rsync.samba(47334) deny(1) file-write-create...```\n\n\u003e 解决方法: Build Setting里搜索 ```ENABLE_USER_SCRIPT_SANDBOXING```把```User Script Sandboxing```改为```NO```\n\n# 跑通Demo\n\n 1. [注册环信应用](https://doc.easemob.com/product/enable_and_configure_IM.html)\n\n 2. 将Appkey填入`PublicFiles.swift`文件中的`AppKey`中\n\n 3. 需要将[服务端源码](https://github.com/easemob/easemob-im-app-server/tree/dev-demo)部署后填入`PublicFiles.swift`文件中的`ServerHost`中，手机号验证码暂时可以跳过，可以使用手机号后六位当验证码，服务端中的Appkey 要跟客户端的Appkey保持一致。Appserver主要提供了手机号验证码登录接口以及上传用户头像的接口，此接口主要的职能是根据用户的信息注册并生成EaseChatUIKit登录所需的token或者使用已注册的用户信息生成EaseChatUIKit登录所需的token，上传头像是一个普通的通用功能在此不过多赘述。\n\n 4. 点击运行至目标设备上（注意：不支持arm模拟器，需要选择Rosetta模拟器或者真机）\n\n# EaseChatUIKit在Demo中的使用\n\n## 1. 初始化\n\n[详情参见](./EaseChatDemo/EaseChatDemo/AppDelegate.swift) 中 `didFinishLaunchingWithOptions`方法中步骤。\n\n## 2. 登录\n\n[详情参见](./EaseChatDemo/EaseChatDemo/LoginViewController.swift)中`loginRequest`方法后续步骤\n\n## 3. Provider使用及其最佳示例用法\n\n如果您的App中已经有完备的用户体系以及可供展示的用户信息（例如头像昵称等。）可以实现EaseChatProfileProvider协议来提供给UIKit要展示的数据。\n\n3.1 [Provider初始化详情参见](./EaseChatDemo/EaseChatDemo/Main/MainViewController.swift)中`viewDidLoad`方法中\n\n3.2 实现Provider协议对`MainViewController`类的扩展参见下述示例代码\n\n```Swift\n4.10.0及其以上\nextension MainViewController: ChatUserProfileProvider,ChatGroupProfileProvider {\n\n}\n4.10.0以下\nextension MainViewController: EaseProfileProvider,EaseGroupProfileProvider {\n\n}\n```\n\n\n## 4.集成EaseChatUIKit中的类进行二次开发\n\n4.1 如何继承EaseChatUIKit中的可自定义的类\n\n[参见IntegratedFromEaseChatUIKit文件夹](./EaseChatDemo/EaseChatDemo/IntegratedFromEaseChatUIKit)中\n\n4.2 如何将继承EaseChatUIKit中子类注册进EaseChatUIKit中替换父类\n\n[详情参见](./EaseChatDemo/EaseChatDemo/AppDelegate.swift) 中 `didFinishLaunchingWithOptions`方法\n\n# Demo设计\n浏览器中打开如下链接\nhttps://www.figma.com/community/file/1327193019424263350/chat-uikit-for-mobile\n\n\n# 已知问题\n\n1. callkit 群聊呼叫用户会产生一条单聊消息，即便对方不是您的好友，后续会改进，也可以用户自己使用群聊中的定向消息自己做信令。\n2. 会话列表、联系人列表是单独的模块，如果想要监听好友事件需要初始化ContactViewModel后调用registerListener方法监听。\n3. UserProvider以及GroupProvider需要用户自己实现，用于获取用户的展示信息以及群组的简要展示信息，如果不实现默认用id以及默认头像。\n4. 换设备或者多设备登录，漫游的会话列表，环信SDK中没有本地存储的群头像名称等显示信息，需要用户使用Provider提供给UIKit才能正常显示。\n5. 由于Provider的机制是停止滚动或者第一页不满10条数据时触发，所以更新会话列表以及联系人列表UI显示的昵称头像需要滑动后Provider提供给UIKit数据后，UIKit会刷新UI。\n\n6. 不支持arm模拟器，因为音频录制库使用libffmpeg的wav转amr的库。\n\n\n# Q\u0026A\n\n\n如有问题请联系环信技术支持或者发邮件到issue@easemob.com\n\n\n[推送角标后台更新以及推送达到率统计](https://doc.easemob.com/push/push_apns_deliver_statistics.html#_1%E3%80%81%E6%8E%A8%E9%80%81%E6%9C%8D%E5%8A%A1%E6%89%A9%E5%B1%95%E4%BB%8B%E7%BB%8D)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feasemob%2Feasemob-demo-ios","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feasemob%2Feasemob-demo-ios","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feasemob%2Feasemob-demo-ios/lists"}