<main>
<article class="userContent">
<p><br></p><h2 data-id="general">General</h2><div class="blockquote"><div class="blockquote-content"><p class="blockquote-line">This article applies to all TeamViewer Assist AR users.</p></div></div><p>With TeamViewer Software Development Kit (SDK) you can utilize full Assist AR functionality and provide the best AR remote support experience to your customers by embedding AR remote assistance capabilities within your own mobile apps.</p><p>The SDK enables you to have secure and GDPR compliant connections to your customer's devices.</p><p><br></p><h3></h3><h2 data-id="prerequisites">Prerequisites</h2><ul><li>iOS 12.0 and higher or Android 5.0 and higher</li><li>An existing TeamViewer Account</li></ul><p>If you don't have a TeamViewer account, follow the steps below to create one:</p><ol><li>Go to <a href="https://login.teamviewer.com/" rel="nofollow noreferrer ugc">https://login.teamviewer.com/</a> and click <strong>Sign Up</strong>.</li><li>Complete the steps to create an account and validate your email address.</li></ol><p><br></p><h3 data-id="-1"></h3><h2 data-id="generate-an-api-key">Generate an API key</h2><p>1) Go to <a href="https://login.teamviewer.com/" rel="nofollow noreferrer ugc">https://login.teamviewer.com/</a> and sign in using your TeamViewer account.</p><p>2) On the bottom of the page, click <strong>Apps</strong>.</p><div class="embedExternal embedImage display-large float-none">
<div class="embedExternal-content">
<a class="embedImage-link" href="https://us.v-cdn.net/6032394/uploads/7W7FK5WTPEY8/image001.png" rel="nofollow noreferrer noopener ugc" target="_blank">
<img class="embedImage-img" src="https://us.v-cdn.net/6032394/uploads/7W7FK5WTPEY8/image001.png" alt="image001.png" height="88" width="562" loading="lazy" data-display-size="large" data-float="none"></img></a>
</div>
</div>
<p><br></p><p>3) Click the <strong>Create App</strong> button.</p><div class="embedExternal embedImage display-large float-none">
<div class="embedExternal-content">
<a class="embedImage-link" href="https://us.v-cdn.net/6032394/uploads/IK6GZL5Q187S/image002.jpg" rel="nofollow noreferrer noopener ugc" target="_blank">
<img class="embedImage-img" src="https://us.v-cdn.net/6032394/uploads/IK6GZL5Q187S/image002.jpg" alt="image002.jpg" height="600" width="937" loading="lazy" data-display-size="large" data-float="none"></img></a>
</div>
</div>
<p><br></p><p>4) Activate <strong>Mobile SDK Token</strong>, enter a name, and (optional) add a short description.</p><p>5) Activate <strong>iOS</strong>.</p><div class="embedExternal embedImage display-medium float-none">
<div class="embedExternal-content">
<a class="embedImage-link" href="https://us.v-cdn.net/6032394/uploads/0ZQFZ4JUQIQL/image.png" rel="nofollow noreferrer noopener ugc" target="_blank">
<img class="embedImage-img" src="https://us.v-cdn.net/6032394/uploads/0ZQFZ4JUQIQL/image.png" alt="image.png" height="234" width="295" loading="lazy" data-display-size="medium" data-float="none"></img></a>
</div>
</div>
<p><br></p><p>6) Click <strong>Create</strong>.</p><p>Your token is displayed when opening the created app:</p><div class="embedExternal embedImage display-large float-none">
<div class="embedExternal-content">
<a class="embedImage-link" href="https://us.v-cdn.net/6032394/uploads/4QLO7PSGXOXZ/mco-createtoken-3-edited.png" rel="nofollow noreferrer noopener ugc" target="_blank">
<img class="embedImage-img" src="https://us.v-cdn.net/6032394/uploads/4QLO7PSGXOXZ/mco-createtoken-3-edited.png" alt="MCO_CreateToken_3_edited.png" height="483" width="1113" loading="lazy" data-display-size="large" data-float="none"></img></a>
</div>
</div>
<p><br></p><p>Copy this token into your clipboard and paste it to a secure place.</p><p>⚠ <strong>IMPORTANT</strong>: <strong>Do not share</strong> this token with anyone!</p><p><br></p><h3 data-id="-2"></h3><h2 data-id="get-the-teamviewer-mobile-sdk">Get the TeamViewer Mobile SDK</h2><p>There are two possibilities to install the TeamViewer Mobile SDK:</p><p><br></p><h3 data-id="a.-install-the-teamviewer-mobile-sdk-via-cocoapods">A. Install the TeamViewer Mobile SDK via CocoaPods</h3><p>The easiest way to get the TeamViewer SDK is via CocoaPods. To add the SDK to your project, add this to your Pod file:</p><pre class="code codeBlock" spellcheck="false" tabindex="0">platform :ios, '12.0'
target YOUR_TARGET do
use_frameworks!
pod 'TeamViewerSDK'
end
</pre><h3 data-id="-3"></h3><h3 data-id="b.-install-manually">B. Install manually</h3><p>1) The SDK is available for customers with an Assist AR Professional license and is distributed by the TeamViewer Support team.</p><p>2) Download the .zip file, decompress and copy all the included xcframework folders inside of your project folder.</p><p>📌<strong>Note:</strong> The SDK is distributed as universal XCFramework containing both architectures, iOS arm64 and Simulator x86. We currently do not support Apple Silicon or Mac Catalyst architectures.</p><p>3) Link the TVLocalizations and TeamViewerSDK frameworks to your project.</p><p>4) Make sure that the option <strong>Embed & Sign</strong> is selected.</p><p>5) You might also need to link against ARKit and CallKit, depending on your implementation.</p><p>6) <strong>Only if you plan to support CallKit:</strong> Link against CallKit.</p><div class="embedExternal embedImage display-large float-none">
<div class="embedExternal-content">
<a class="embedImage-link" href="https://us.v-cdn.net/6032394/uploads/IZ1K1FL4GEDS/ios-mobilesdk-frameworks-libraries-embeddedcontent.png" rel="nofollow noreferrer noopener ugc" target="_blank">
<img class="embedImage-img" src="https://us.v-cdn.net/6032394/uploads/IZ1K1FL4GEDS/ios-mobilesdk-frameworks-libraries-embeddedcontent.png" alt="iOS_MobileSDK_Frameworks_Libraries_EmbeddedContent.png" height="260" width="936" loading="lazy" data-display-size="large" data-float="none"></img></a>
</div>
</div>
<p><br></p><h3 data-id="-4"></h3><h2 data-id="setting-up-your-xcode-project">Setting up your Xcode Project</h2><p>The TeamViewer SDK uses the camera and microphone during a remote support session.</p><p>1) Add the following keys to the Info.Plist file:</p><ul><li>NSMicrophoneUsageDescription</li><li>NSCameraUsageDescription</li></ul><div class="embedExternal embedImage display-large float-none">
<div class="embedExternal-content">
<a class="embedImage-link" href="https://us.v-cdn.net/6032394/uploads/CYK7NF6VAELP/ios-mobilesdk-keys-infoplist.png" rel="nofollow noreferrer noopener ugc" target="_blank">
<img class="embedImage-img" src="https://us.v-cdn.net/6032394/uploads/CYK7NF6VAELP/ios-mobilesdk-keys-infoplist.png" alt="iOS_MobileSDK_keys_InfoPlist.png" height="223" width="1430" loading="lazy" data-display-size="large" data-float="none"></img></a>
</div>
</div>
<p>If you do not add those keys, iOS will terminate the application the moment the SDK tries to access the microphone or camera.</p><p><br></p><h3 data-id="-5"></h3><h2 data-id="using-the-teamviewer-sdk">Using the TeamViewer SDK</h2><p><span class="safeEmoji nativeEmoji">⚠️</span> <strong>IMPORTANT</strong>: The SDK is a single instance class. You cannot directly create one. You should access the shared instance.</p><p>1) Initialize the SDK instance with your API Key obtained in the section <strong>Prerequisites</strong>.</p><div class="embedExternal embedImage display-large float-none">
<div class="embedExternal-content">
<a class="embedImage-link" href="https://us.v-cdn.net/6032394/uploads/D8U010DDGPAG/ios-mobilesdk-command-line-setupsdk.png" rel="nofollow noreferrer noopener ugc" target="_blank">
<img class="embedImage-img" src="https://us.v-cdn.net/6032394/uploads/D8U010DDGPAG/ios-mobilesdk-command-line-setupsdk.png" alt="iOS_MobileSDK_command_line_setupSDK.png" height="232" width="708" loading="lazy" data-display-size="large" data-float="none"></img></a>
</div>
</div>
<p>2) Set a delegate conforming to the protocol TeamViewerSDKDelegate.</p><p>This ensures you are able to react to events happening during the lifetime of your TeamViewer connection.</p><p>3) Connect to a session code</p><p>The shared SDK provides a method for establishing a connection to a session code. This session code can be of two types:</p><ul><li>Remote Support or </li><li>Assist AR</li></ul><p>4) Create session codes in your TeamViewer client or via the TeamViewer REST API.</p><div class="embedExternal embedImage display-large float-none">
<div class="embedExternal-content">
<a class="embedImage-link" href="https://us.v-cdn.net/6032394/uploads/3EMDPXO4TQFM/ios-mobilesdk-command-line-createsessioncode.png" rel="nofollow noreferrer noopener ugc" target="_blank">
<img class="embedImage-img" src="https://us.v-cdn.net/6032394/uploads/3EMDPXO4TQFM/ios-mobilesdk-command-line-createsessioncode.png" alt="iOS_MobileSDK_command_line_createSessionCode.png" height="70" width="724" loading="lazy" data-display-size="large" data-float="none"></img></a>
</div>
</div>
<p>The method <strong><code class="code codeInline" spellcheck="false" tabindex="0">connectToSessionCode</code></strong> returns a TeamViewer session.</p><p><span class="safeEmoji nativeEmoji">⚠️</span> <strong>IMPORTANT: </strong>You are responsible for keeping this variable alive, and also responsible for freeing up this variable. Failing to do so might result in the session UI being kept alive even after the remote session has ended. </p><p><span class="safeEmoji nativeEmoji">⚠️</span> <strong>IMPORTANT: </strong>Once the SDK connects to a session code, it enters a waiting state, you get notified about the state change via the delegate method <strong><code class="code codeInline" spellcheck="false" tabindex="0">handleSessionCodeOnline</code></strong>.</p><p>At this point, you should not allow the user to connect to a different session code. It is only allowed to allow the user to leave the current connection.</p><p>On the supporter side, the session code will appear as being online, allowing the client to establish a connection to that session code.</p><p><br></p><h3 data-id="reacting-to-incoming-connections">Reacting to incoming connections</h3><p>The SDK provides delegate methods for reacting to incoming connection events.</p><p>Once the connection is initiated on the TeamViewer side, the SDK gets notified about this connection attempt via the delegate method <code class="code codeInline" spellcheck="false" tabindex="0">handleConnectionRequestWithAuthenticationData</code>.</p><p>On the authentication data parameter there is the name of the supporter, the type of incoming connection (ScreenShare or Assist AR) and a callback function to allow or reject the incoming connection.</p><p>If the incoming connection is accepted, the corresponding TeamViewer connection is established.</p><ul><li>For the ScreenShare connection, a prompt for microphone and screen sharing is shown to the user.</li></ul><p>The UI of your application is grabbed using the replay kit and there is bi-directional VoIP communication between the user and the supporter.</p><ul><li>For the Assist AR connection, the system permissions for camera and microphone access are shown. If the user allows this, the AR session is started. There is bi-directional VoIP communication between the user and the supporter.</li><li>The delegate method <strong><code class="code codeInline" spellcheck="false" tabindex="0">handleConnectionRequestAbort</code></strong><strong> </strong>should be implemented in order to be notified when the remote user cancels the connection request. You are responsible to clear any prompts that are shown to the user, or to cancel any CallKit incoming call notifications.</li></ul><p><br></p><h3 data-id="reacting-to-optional-sdk-events">Reacting to optional SDK events</h3><ul><li> <strong><code class="code codeInline" spellcheck="false" tabindex="0">handleSupporterConnected</code></strong>: This method gets called when the supporter has ended the session, it also gets called when the user has locally ended the session.</li><li><strong><code class="code codeInline" spellcheck="false" tabindex="0">handleSupporterDisconnected:</code></strong> This method gets called when the supporter has ended the session, it also gets called when the user has locally ended the session. </li></ul><p><span class="safeEmoji nativeEmoji">💡</span> <strong>Hint</strong>: You should clean the references to the session as the session is considered no longer valid at this point.</p><ul><li><strong><code class="code codeInline" spellcheck="false" tabindex="0">handleError:</code></strong> This method gets called if the session code or the API token used for establishing a connection are not valid. </li></ul><p>💡 <strong>Hint: </strong>You should clean the resources used for the current session as the session itself is considered invalid.</p><p><br></p><h3 data-id="reacting-to-optional-session-events">Reacting to optional session events</h3><ul><li><strong><code class="code codeInline" spellcheck="false" tabindex="0">handleSessionError:</code></strong> This gets called when an error has occurred during the session. For example, a feature was requested but the compatibility between client and server was not met.</li></ul><p>💡 <strong>Hint: </strong>This error is only informative. You can write it to a log file.</p><p><br></p><h3 data-id="note-about-callkit-support">Note about CallKit support</h3><p><strong>If your application supports CallKit:</strong></p><ul><li>Provide the TeamViewer SDK with information about the unique identifier of your call.</li><li>TeamViewer asks the system if there is a running call and does not try to set up a VoIP connection if this is the case.</li><li>Tell TeamViewer that the current call is yours so we can take over the audio pipeline and start the VoIP transmission:<ol><li>Call the <strong><code class="code codeInline" spellcheck="false" tabindex="0">setupCallUUID</code></strong><strong> </strong>method.</li><li>Tell the SDK that your call has ended by calling the <strong><code class="code codeInline" spellcheck="false" tabindex="0">clearCallUUID</code></strong><strong> </strong>method<strong>.</strong></li></ol></li></ul><p><br></p><h3 data-id="enabling-background-modes">Enabling background modes</h3><p>Ensure that you have at least one of these background modes enabled in your Info.plist file: </p><ul><li>Audio,</li><li>AirPlay or </li><li>Voice over IP background mode. </li></ul><div class="embedExternal embedImage display-large float-none">
<div class="embedExternal-content">
<a class="embedImage-link" href="https://us.v-cdn.net/6032394/uploads/2D3S8ANRCBQF/ios-mobilesdk-background-modes.png" rel="nofollow noreferrer noopener ugc" target="_blank">
<img class="embedImage-img" src="https://us.v-cdn.net/6032394/uploads/2D3S8ANRCBQF/ios-mobilesdk-background-modes.png" alt="iOS_MobileSDK_background_modes.png" height="310" width="936" loading="lazy" data-display-size="large" data-float="none"></img></a>
</div>
</div>
<p>⚠️ <strong>IMPORTANT</strong>: Failing to do so will cause the app to get suspended only a few seconds after being put in the background during an active TeamViewer session.</p><p><br></p><h3 data-id="audio-setup">Audio setup</h3><p>The mobile SDK works with the default AVAudioSession configuration values.</p><ul><li>If you want to override these values to support Bluetooth, Airplay mix, use loudspeakers, etc., make sure to change this before a session is established. In case your application mutes other apps, the recommended point in time to configure the audio session is right before accepting the connection.</li><li>If your application audio mixes with other apps, you can configure the audio options at the application launch.</li></ul><div class="embedExternal embedImage display-large float-none">
<div class="embedExternal-content">
<a class="embedImage-link" href="https://us.v-cdn.net/6032394/uploads/VQ1JFNMJE1V4/ios-mobilesdk-command-line-setupavaudiosession.png" rel="nofollow noreferrer noopener ugc" target="_blank">
<img class="embedImage-img" src="https://us.v-cdn.net/6032394/uploads/VQ1JFNMJE1V4/ios-mobilesdk-command-line-setupavaudiosession.png" alt="iOS_MobileSDK_command_line_SetupAVAudioSession.png" height="280" width="936" loading="lazy" data-display-size="large" data-float="none"></img></a>
</div>
</div>
<p><br></p><h3 data-id="disable-voip">Disable VoIP</h3><p>In case you want to use another means for establishing voice communication, you can disable the VoIP feature entirely by setting the options on the shared SDK instance prior to establishing a connection.</p><div class="embedExternal embedImage display-large float-none">
<div class="embedExternal-content">
<a class="embedImage-link" href="https://us.v-cdn.net/6032394/uploads/4L25R85O89WV/ios-mobilesdk-command-line-disablevoip.png" rel="nofollow noreferrer noopener ugc" target="_blank">
<img class="embedImage-img" src="https://us.v-cdn.net/6032394/uploads/4L25R85O89WV/ios-mobilesdk-command-line-disablevoip.png" alt="iOS_MobileSDK_command_line_DisableVoIP.png" height="254" width="641" loading="lazy" data-display-size="large" data-float="none"></img></a>
</div>
</div>
<p>For more information refer to the <strong><code class="code codeInline" spellcheck="false" tabindex="0">TVSDKOptions</code></strong> documentation.</p><p><br></p><h3 data-id="-6"></h3><h2 data-id="class-documentation">Class documentation</h2><p>All public headers are documented. For detailed information about each class, please refer to the QuickHelp content generated by Xcode ('⌥ '+ click on constant or variable name).</p>
</article>
</main>