1. Install the video SDK
To use the Two-Way video, you'll need to install the Glance_iOSVideo SDK, instead of Glance_iOS, which is also available for installation via Cocoapods or Manual integration.
Add Glance_iOSVideo framework into your Podfile:
Run pod_install in your terminal:
Download Glance_iOSVideo from here.
Drag the xcframework to your XCode project and select Copy items if needed.
Make sure it was added to Frameworks and Libraries section in the General tab from your target Settings, don't forget to select the embed option Embed & Sign.
2. Initialize the SDK
Use the same initialization from Screenshare, but this time, importing Glance_iOSVideo:
import Glance_iOSVideo ... GlanceVisitor.initVisitor(GLANCE_GROUP_ID, token: "", name: "", email: "", phone: "")
#import <Glance_iOSVideo/Glance_iOSVideo.h> ... [GlanceVisitor init:GLANCE_GROUP_ID token:@"" name:@"" email:@"" phone:@""];
3. Enable camera permission
Add Privacy - Camera Usage Description to your Info.plist, you'll need this before starting any video calls with your agent:
4. Start Two-Way video
Before you continue, you will need to define a Session Code, which you'll need to send to your agent to enable them to connect to your session.
Then, instead of calling startSession, you need to call startVideoCall, passing the Session Code that you defined earlier:
GlanceVisitor.startVideoCall(GLANCE_SESSION_CODE, delegate: self, camera: "front", termsUrl: "https://ww2.glance.net/")
[GlanceVisitor startVideoCall:GLANCE_SESSION_CODE delegate:self camera:@"front" termsUrl:@"https://ww2.glance.net/"];
|_: String||The session that you'll need to send to your agent|
|delegate: GlanceVideoDefaultUIDelegate||Delegate for customizing UI|
|camera: String||Pass "front" or "back" to set direction of the camera|
|termsUrl: String||URL for your terms|
After that, you'll see the screen below, tap Start Your Video:
Send the session to your Agent and wait until he/she accepts.
5. Testing the Agent
To confirm the integration is working, start the session and note the session key.
Now, to simulate the Agent, go to: https://www.glance.net/agentjoin/AgentJoin.aspx.
If not logged in already, the agent will be asked to login, request credentials from Glance if you still don't have them:
Now, enter the Session Code and tap Join Session:
After that, you'll be able to see your mobile device screen.
Congratulations! Now you have a video call with your Agent.