Test application on how to add reve chat sdk in iOS platform
Necessary or minimum requirements:
Xcode 7 or above iOS 8 or above
Through cocoapods. Write bellow line in your podfile.
pod 'ReveChatSDK'
To integrate iOS SDK with your iOS mobile app, please follow the below mentioned steps:
The iOS SDK uses the camera and photo library in iOS.
If your app does not already request permissions for these features, you should update your info.plist file with a usage description for NSPhotoLibraryUsageDescription and NSCameraUsageDescription.
<key>NSPhotoLibraryUsageDescription</key>
<string><description to use photo library></string>
<key>NSCameraUsageDescription</key>
<string><description to use camera></string>
<key>NSAppTransportSecurity</key> <dict>
<key>NSAllowsArbitraryLoads</key>
<true/></dict>
<key>NSMicrophoneUsageDescription</key>
<string><Add your description here></string>
<key>NSCameraUsageDescription</key>
<string><Add your description here></string>
Objective-c
#import < ReveChatSDK/ReveChatSDK.h>
Swift
import ReveChatSDK
Objective-c
[[ReveChatManager sharedManager]
setupAccountWith:<your account id>];
Swift
let reveChatManager = ReveChatManager()
reveChatManager.setupAccount(with: <your account id as string> )
Objective-c
[[ReveChatManager sharedManager]
initiateReveChatWith:<visitor name>
visitorEmail:<visitor email>
visitorMobile:<visitor mobile>
onNavigationViewController:<your navigation
controller>];
Swift
/* initiate the class with name, email , mobile and parent controller of the sdk as parameters*/
reveChatManager.initiateReveChat(with: <visitor name>,
visitorEmail: <visitor email>,
visitorMobile: <visitor mobile>,
onNavigationViewController: <UINavigationController on which you want it to load>)
*To initiate video call.The audio parameter should be false
If you wish not to show prechat form if visitor logged in then pass like bellow:
Objective-c
[[ReveChatManager sharedManager]
initiateReveChatWith:<visitor name>
visitorEmail:<visitor email>
visitorMobile:<visitor mobile>
loginState: LOGGED_IN
onNavigationViewController:<UINavigationController on which you want it to load>];
Swift
let reveChatManager = ReveChatManager()
reveChatManager.initiateReveChat(with: <visitor name>,
visitorEmail:<visitor email>,
visitorMobile: <visitor mobile>,
loginState: LOGGED_IN,
onNavigationViewController: <UINavigationController on which you want it to load>)
If you wish to show prechat form if visitor logged in then pass like bellow:
Objective-c
[[ReveChatManager sharedManager]
initiateReveChatWith:<visitor name>
visitorEmail:<visitor email>
visitorMobile:<visitor mobile>
loginState: LOGGED_OUT
onNavigationViewController:<UINavigationController on which you want it to load>];
Swift
let reveChatManager = ReveChatManager()
reveChatManager.initiateReveChat(with: <visitor name>,
visitorEmail:<visitor email>,
visitorMobile: <visitor mobile>,
loginState: LOGGED_OUT,
onNavigationViewController: <UINavigationController on which you want it to load>)
For more details go to this link: https://www.revechat.com/getting-started-ios-sdk/