Share via

How can I migrate OpenTokStreamingService in my MAUI iOS platform from Xamarin Forms

Sreenivasan, Sreejith 680 Reputation points
2026-03-04T11:37:30.01+00:00

I am trying to migrate OpenTokStreamingService in my MAUI iOS platform from Xamarin Forms. I have used Xamarin.OpenTok.iOS package on XF but the same package is not able to use in MAUI due to the below issue.

Package Xamarin.OpenTok.iOS 2.18.1 is not compatible with net8.0-ios18.0 (.NETCoreApp,Version=v8.0). Package Xamarin.OpenTok.iOS 2.18.1 supports: xamarinios10 (Xamarin.iOS,Version=v1.0)

While researching I found I need to create .NET 8 iOS Binding Library for the native OpenTok iOS framework. I am little confused about the whole process on that and I am adding my doubts below:

  1. In my MAUI project I have already added a .NET Class Library and a .NET MAUI Class Library projects. Should I add the .NET 8 iOS Binding Library as a 4th project?
  2. I need to add a OpenTok.framework to the .NET 8 iOS Binding Library project. I tried to download it from here, but didn't get it.
  3. What about the remaining process like Build Action, Set properties and Reference it to the MAUI project.

Please give me a end to end idea on this and I am also adding my existing xamarin forms OpentokStreamingService as a text document below.

OpentokStreamingService.txt

Developer technologies | .NET | .NET MAUI
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Nancy Vo (WICLOUD CORPORATION) 880 Reputation points Microsoft External Staff Moderator
    2026-03-05T06:33:14.42+00:00

    Hi @Sreenivasan, Sreejith ,

    Thanks for reaching out.

    From the log you shared, the reason your existing Xamarin.OpenTok.iOS package is incompatible with MAUI is due to target framework differences.

    1. In your MAUI project you have already added a .NET Class Library and a .NET MAUI Class Library projects. Should you add the .NET 8 iOS Binding Library as a 4th project?

    Yes, you should add it as a separate project. The iOS Binding Library needs to be its own project with a specific project type: ios binding library. Your solution structure should look like this:

    YourSolution/
    ├── YourApp.MauiApp (main MAUI project)
    ├── YourApp.ClassLibrary (.NET Class Library)
    ├── YourApp.MauiClassLibrary (.NET MAUI Class Library)
    └── YourApp.iOS.Bindings (iOS Binding Library) ← NEW 4th project
    
    1. Where to get the OpenTok.framework?

    The reason you’re unable to find OpenTok.framework is because the Vonage iOS SDK no longer distributes the SDK as a .framework.

    Starting from version 2.25.1+, the SDK is provided only as an XCFramework (OpenTok.xcframework). The older fat framework format (OpenTok.framework) has been discontinued.

    For .NET 8 / .NET MAUI iOS binding projects, this is expected behavior. Modern .NET for iOS fully supports binding against .xcframework artifacts.

    To proceed:

    • Download the latest iOS SDK from the Vonage Video API iOS SDK page (Release Notes section).
    • Extract the package.
    • Locate OpenTok.xcframework inside the archive.
    • Add OpenTok.xcframework to your .NET 8 iOS Binding Library project.
    • Set its Build Action to NativeReference.
    1. What about the remaining process like Build Action, Set properties and Reference it to the MAUI project.

    Once you have the framework and create the binding project, I recommend follow these steps:

    1. Add OpenTok.xcframework into your .NET 8 iOS Binding Library project. Then select it in Solution Explorer. Set Build Action to NativeReference.

    Set: Smart Link = True and Force Load = True

    These settings ensure the native symbols are correctly linked and not stripped by the iOS linker.

    1. In your binding project, you’ll need:
    • ApiDefinition.cs
    • (Optional) Metadata.xml

    If you previously had a Xamarin binding project, you can reuse most of that API definition code, but you may need to fix:

    • Nullability annotations
    • Deprecated attributes
    • Any APIs that changed in newer SDK versions.
    1. Build the binding project first. If it succeeds, it will generate a managed .NET assembly exposing types like:
    • OTSession
    • OTPublisher
    • OTSubscriber

    At this point, the native SDK is successfully wrapped for .NET 8 iOS.

    1. In your MAUI project:
    • Add a Project Reference to the iOS Binding Library.
    • Make sure both projects target net8.0-ios.

    Your existing OpentokStreamingService can then use the bound types just like before.

    1. Since your OpentokStreamingService directly uses UIView, AVFoundation, and iOS-specific APIs, it should live under Platforms/iOS/.

    Hope this helps. If you found my response helpful or informative, I would greatly appreciate it if you could follow this guidance provide feedback. Thank you.


  2. Q&A Assist
    2026-03-04T11:37:48.6633333+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    Xamarin.OpenTok.iOS targets xamarinios10, which is listed as incompatible with net8.0-ios. To use OpenTok from a .NET 8 MAUI iOS app, an iOS binding library targeting net8.0-ios is required.

    From the available information, only the general migration pattern for iOS binding projects and .NET 8 iOS projects can be described:

    1. Create a .NET for iOS binding library project
      • In Visual Studio, create a new iOS Binding Library project. This gives an SDK‑style project file suitable for .NET for iOS binding libraries.
      • The project file should be SDK‑style and target .NET for iOS (similar to a regular .NET for iOS library):
             <Project Sdk="Microsoft.NET.Sdk">
               <PropertyGroup>
                 <TargetFramework>net8.0-ios</TargetFramework>
                 <Nullable>enable</Nullable>
                 <ImplicitUsings>true</ImplicitUsings>
               </PropertyGroup>
             </Project>
        
      • This binding library is a separate project in the solution, alongside the MAUI app and any other class libraries.
    2. Add the native OpenTok iOS framework as a native reference
      • Add the native .framework or .a file to the binding project as a Native Reference.
      • In the binding project file, the native reference is declared similarly to Xamarin.iOS, but in SDK‑style form, for example:
             <ItemGroup>
               <NativeReference Include="OpenTok.framework">
                 <Kind>Framework</Kind>
                 <ForceLoad>True</ForceLoad>
               </NativeReference>
             </ItemGroup>
        
      • The <NativeReference> item is migrated from the Xamarin.iOS binding project into the .NET for iOS binding project.
    3. Copy binding code from the Xamarin.iOS binding project
      • Copy the API definition files (e.g., ApiDefinition.cs, StructsAndEnums.cs) from the Xamarin.iOS binding project into the new .NET for iOS binding project.
      • Copy any additional C# code required by the binding (helper classes, partial classes, etc.).
    4. Replace unsupported APIs
      • In the binding project, replace any APIs that are not supported in .NET for iOS with their .NET for iOS equivalents.
      • Unsupported APIs must be updated according to the .NET for iOS migration guidance.
    5. Reference the binding library from the MAUI app
      • After the binding library builds successfully, add a project reference from the .NET MAUI app project to the binding library project.
      • The MAUI app can then use the bound OpenTok types as normal .NET types.
    6. General NuGet compatibility considerations
      • Xamarin‑targeted packages using xamarinios/xamarinios10 are not compatible with net8.0-ios.
      • Only packages that list net8.0-ios (or other compatible TFMs) are directly usable in .NET 8. Otherwise, a recompiled package or a binding as described above is required.

    The steps above describe the supported pattern for migrating an iOS binding library from Xamarin.iOS to .NET for iOS and then consuming it from a .NET MAUI app. Details such as obtaining the actual OpenTok.framework and its specific build actions or metadata are not covered in the available material.


    References:

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.