Use 6-digit codes
Cobrowse does not require any visible UI presented to the user but there is the option to present a UI that generates a 6-digit code. Learn more.
// ensure Cobrowse is loaded
CobrowseIO.client().then(function() {
// create a code a display it to the user using your own UI
// ONLY GENERATE CODE WHEN NEEDED. DO NOT GENERATE CODE ON PAGE LOAD.
CobrowseIO.createSessionCode().then(function(code) {
console.log('your code is', code);
});
});CobrowseIO.instance().createSession { error, session in
guard error == nil, let code = session?.code()
else { return }
print(code)
}[CobrowseIO.instance createSession:^(NSError * err, CBIOSession * session) {
if (err) NSLog(@"Failed to create code")
else NSLog(@"%@", session.code);
}];Last updated