iOS
iOS Native SDK
The Cobrowse SDK for iOS is available for installation via several dependency managers, or as frameworks to integrate directly into your project:
SPM
Pods
Carthage
Manual
https://github.com/cobrowseio/cobrowse-sdk-ios-binary.git
Add the
CobrowseIO
package dependency to your app target.pod 'CobrowseIO', '~>2'
Don't forget to run
pod repo update
then pod install
after you've edited your Podfile.Make sure you are on the latest stable version of Pods. Run
pod --version
to check!Note: Depending on your project, you may also need
use_frameworks!
in your Podfile.binary "https://raw.githubusercontent.com/cobrowseio/cobrowse-sdk-ios-binary/master/cobrowse-sdk-ios-binary.json" ~> 2.0
Remember to run
carthage update
after modifying your Cartfile.More information about Carthage at https://github.com/Carthage/Carthage#if-youre-building-for-ios-tvos-or-watchos.
Link the
CobrowseIO.framework
to your main app target that can be found at ./Carthage/Build/iOS
.Frameworks are available for manual integration into your Xcode projects from:
https://github.com/cobrowseio/cobrowse-sdk-ios-binary/releases
Add the following lines to your code which will register this device with the Cobrowse servers so you can connect to it. You could choose to do this on app startup, or when your users visits a support page in your application, or any other time.
Swift
Objective-C
import CobrowseIO
...
CobrowseIO.instance().license = "put your license key here"
CobrowseIO.instance().start()
@import CobrowseIO;
...
CobrowseIO.instance.license = @"put your license key here";
[CobrowseIO.instance start];
If you would like your devices to register as soon as your app starts, we recommend doing this in your app delegate
application:didFinishLaunchingWithOptions:
method. For example:Swift
Objective-C
import CobrowseIO
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool
{
CobrowseIO.instance().license = "put your license key here"
CobrowseIO.instance().start()
return true
}
@import CobrowseIO;
- (BOOL)application:(UIApplication*) application didFinishLaunchingWithOptions:(NSDictionary*) launchOptions
{
CobrowseIO.instance.license = @"put your license key here";
[CobrowseIO.instance start];
return YES;
}
Please register an account and generate your free License Key at https://cobrowse.io/dashboard/settings.
This will associate sessions from your mobile app with your Cobrowse account.
Once you have your app running in the iOS Simulator or on a physical device, navigate to https://cobrowse.io/dashboard to see your device listed. You can click the "Connect" button to initiate a Cobrowse session!
- iOS 11.0 or later
Try our alternative rendering method below:
Last modified 2mo ago