- Documentation
- In-app Chat
- Sample app
Sample app
- Download
Here we provide you with a sample application to experience ZEGOCLOUD's In-app Chat, and also describe how to run the sample code.
Prerequisites
- Xcode 7.0 or later.
- An iOS device or iOS Simulator that is running on iOS 11.0 or later and supports audio and video. We recommend you use a real device.
- The iOS device is connected to the internet.
- Contact the ZEGOCLOUD Technical support to get the AppID and ServerSecret for SDK integration.
- Get the Token that SDK required for login authentication. For details, see Authentication.
Sample code structure
The following structure shows the subdirectory structure of the In-app Chat sample code:
├── CommonTools
│ ├── GHConsole
│ ├── HUD
│ ├── KeyboardToolBar
│ ├── TokenGenerator
│ └── ZEGOPopMenuView
├── Podfile
├── Podfile.lock
├── Pods
│ ├── Headers
│ ├── Local\ Podspecs
│ ├── MJRefresh
│ ├── Manifest.lock
│ ├── Pods.xcodeproj
│ └── Target\ Support\ Files
├── ZIMExampleDemo
│ ├── AppDelegate.h
│ ├── AppDelegate.mm
│ ├── Assets.xcassets
│ ├── Base.lproj
│ ├── ConversationList
│ ├── Group
│ ├── GroupList
│ ├── Info.plist
│ ├── Login
│ ├── Peer
│ ├── Room
│ ├── ZIMExampleDemo.entitlements
│ ├── ZIMManager
│ └── main.m
├── ZIMExampleDemo.xcodeproj
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ └── xcuserdata
├── ZIMExampleDemo.xcworkspace
│ ├── contents.xcworkspacedata
│ ├── xcshareddata
│ └── xcuserdata
└── libs
└── ZIM.xcframework
Run the sample code
Open AppStore to download the Xcode.
In Xcode, select the File > Open, open the
ZIMExampleDemo.xcworkspace
file in the extracted sample code package.
- Go to SDK downloads to download the latest version of SDK. Copy the unzipped SDK package to the
ZIMExampleLegacy/libs/IOS
directory.
In Xcode, select the Preferences, click the Accounts tab, click the + button, then select Apple ID, and click Continue.
Enter your Apple ID and Password to log in.
Modify the
Bundle Identifier
and certificate.In Xcode, Select the
ZIMExampleDemo
project.Select the target project, click the Signing & Capabilities tab, change the
Bundle Identifier
configuration and select your own developer certificate in the Team.
Modify the
KeyCenter.m
file under theZIMManager
folder with the AppID and ServerSecret that you get in the Prerequisites steps.+ (unsigned int)appID { return 1333333333; // Please enter your AppID. } + (NSString *)Secret{ return @"Secret"; // Please enter your ServerSecret. }
Connect the iOS device to your computer, and select the iOS device in Xcode.
Click the Build button to run the sample code and experience the In-app Chat service.