azure-sdk-for-ios icon indicating copy to clipboard operation
azure-sdk-for-ios copied to clipboard

[FEATURE REQ] Swift Package Manager (SPM) support for AzureCommunicationCalling

Open Svantulden opened this issue 2 years ago • 9 comments

Is your feature request related to a problem? Please describe. We are using Swift Package Manager for our dependency management and would like to use AzureCommunicationCalling like this as well. This would help us avoid CocoaPods bloat and make it simple to add the library to our project. Swift Package Manager is also the new leading standard in including libraries on iOS.

I incorrectly assumed that SPM is already supported for this library, due to it being mentioned on this page.

Describe the solution you'd like Adding the AzureCommunicationCalling library to an iOS project via Swift Package Manager.

Information Checklist Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report

  • [x] Description Added
  • [x] Expected solution specified

Svantulden avatar Oct 16 '23 08:10 Svantulden

Hi @Svantulden we are already tracking SPM support for Calling here: https://github.com/Azure/azure-sdk-for-ios/issues/828

@raosanat is there a reason the link provided claims SPM support? https://azure.github.io/azure-sdk/releases/latest/ios.html

tjprescott avatar Oct 16 '23 16:10 tjprescott

Thanks for linking that issue @tjprescott, I had searched the issues for 'SPM' and 'Swift Package', but not 'SwiftPM'.

It seems like the library won't support SPM for some time, due to the issues with linking Objective-C (binary) & Swift dependencies for the package. So it's dependent on transitioning the Calling library to Swift or new insights/features in the Swift package system.

To prevent having to use CocoaPods for the library, we also tried using the direct approach as a workaround and include the release as .xcframework in our project (from the link that is in the binary CocoaPods podspec) and linking the Common library via SPM.

However this has two issues:

  • The XCFramework provided doesn't seem to have Module Stability so I'm getting a Failed to build module 'AzureCommunicationCalling'; this SDK is not supported by the compiler (the SDK is built with 'Apple Swift version 5.7.2 (swiftlang-5.7.2.135.5 clang-1400.0.29.51)', while this compiler is 'Apple Swift version 5.9 (swiftlang-5.9.0.128.108 clang-1500.0.40.1)'). Please select a toolchain which matches the SDK. error
  • Probably the same issue will occur here as in getting SPM support implemented, where the Objective-C headers for the SwiftPM Common library won't be found

Do you have any ideas for a short(er) term solution?

Svantulden avatar Oct 19 '23 12:10 Svantulden

Hi @Svantulden,

Unfortunately using calling as .xcframework and installing common using SPM is not going to work AzureCommunicationCalling because it is an Objective-C framework and Swift Package Manager deliberately do not support Swift ObjC interface headers by design(see more here) which means is not possible to work together because AzureCommunicationCommon would not emit objc files required for calling to interop with AzureCommunicationCalling if installed using Swift Package Manager.

So common would have to be installed using another dependency manager either Pods or another approach. That is a bit of a hack but since AzureCommunicationCommon is open source but it doesn't distribute a .xcframework, to make it work would be possible to build an xcframework from source and import both AzureCommunicationCalling and AzureCommunicationCommon as .xcframework.

lucianopa-msft avatar Oct 19 '23 21:10 lucianopa-msft

@lucianopa-msft

Is there a repository for AzureCommunicationCalling that I can install the dependency via SPM? I confirm that there are repos for AzureCommunicationCommon and AzureCommunicationChat but not AzureCommunicationCalling.

Thanks in advance.

pa-akiya-ozawa avatar Jun 05 '24 07:06 pa-akiya-ozawa

Hi @pa-akiya-ozawa, Unfortunately there isn't, as mentioned before we still don't have support for SPM on AzureCommunicationCalling since we are still an ObjC binary framework.

lucianopa-msft avatar Jun 05 '24 21:06 lucianopa-msft

@lucianopa-msft Hello, Good Day, are we supporting AzureCommunicationCalling for SPM, or is it still in development?

Pratikkapadia7 avatar Jun 23 '25 06:06 Pratikkapadia7

SPM is still not supported as far as I know, if you are looking alternative to import it in your project without cocoapods, the alternative we have now is to manually drop XCFramework (see reference https://learn.microsoft.com/en-us/azure/communication-services/quickstarts/voice-video-calling/get-started-with-video-calling?pivots=platform-ios#using-xcframework-directly). Note that you may need to also build AzureCommunicationCommon as xcframework as well this is the guide https://gist.github.com/lucianopa-msft/5121c45073200995cdefb5b7ea1a791c (make sure to build from 1.3.0 or 1.2.0 tags).

lucianopa-msft avatar Jun 23 '25 19:06 lucianopa-msft

What Luciano mentioned is correct - we currently do not support SPM. SPM support is something we will deliver in the second half of the calender year 2025.

jamchengms avatar Jun 23 '25 21:06 jamchengms

Thank you @lucianopa-msft @jamchengms

Pratikkapadia7 avatar Jun 25 '25 03:06 Pratikkapadia7

@Pratikkapadia7 @jamchengms @lucianopa-msft @pa-akiya-ozawa @Svantulden Hello everyone, I’ve created an automation script that generates a complete SPM package for AzureCommunicationCalling, AzureCommunicationUICalling, AzureCommunicationUIChat and AzureCommunicationUICommon. Just run the script with your chosen version (e.g., ./generate-spm-package.sh --tag "AzureCommunicationUICalling_1.14.2") and it will produce a ready‑to‑use SPM package locally (copies all XCFrameworks and packs them in the SPM package). Then you can import any sdk that you want, e.g. AzureCommunicationCalling in this case. I tested it in a new project with only SPM as package manager and I'm able to join calls and chat. https://github.com/billp/communication-ui-library-ios-spm. Also you can see here a working demo made by @yannisalexiou : https://github.com/yannisalexiou/AzureCommunicationServicesCalling

billp avatar Jul 18 '25 09:07 billp

Hi @Svantulden, we deeply appreciate your input into this project. Regrettably, this issue has remained unresolved for over 2 years and inactive for 30 days, leading us to the decision to close it. We've implemented this policy to maintain the relevance of our issue queue and facilitate easier navigation for new contributors. If you still believe this topic requires attention, please feel free to create a new issue, referencing this one. Thank you for your understanding and ongoing support.

github-actions[bot] avatar Oct 15 '25 18:10 github-actions[bot]

I do believe this is actively been worked on by the team. @raosanat

tjprescott avatar Oct 15 '25 19:10 tjprescott

@Nancy @.***> can you follow up on this SPM issue?

James


From: Travis Prescott @.> Sent: Wednesday, October 15, 2025 12:38:00 PM To: Azure/azure-sdk-for-ios @.> Cc: Comment @.***> Subject: Re: [Azure/azure-sdk-for-ios] [FEATURE REQ] Swift Package Manager (SPM) support for AzureCommunicationCalling (Issue #1637)

I do believe this is actively been worked on by the team. @raosanathttps://github.com/raosanat

— Reply to this email directly, view it on GitHubhttps://github.com/Azure/azure-sdk-for-ios/issues/1637#issuecomment-3407981809 or unsubscribehttps://github.com/notifications/unsubscribe-auth/AHTXC57AMJNJAHWIJHIUD4D3X2PBRBFHORZGSZ3HMVZKMY3SMVQXIZNMON2WE2TFMN2F65DZOBS2YSLTON2WKQ3PNVWWK3TUUZ2G64DJMNZZFAVEOR4XAZNKOJSXA33TNF2G64TZUV3GC3DVMWUTCMRTGIZDQNRSGWBKI5DZOBS2K2LTON2WLJLWMFWHKZNKGE4TINBWGIYTSMBVVJQXI5DSNFRHK5DFOOMIFJLWMFWHKZNEORZHKZNENZQW2ZN3ORUHEZLBMRPXAYLSORUWG2LQMFXHIX3BMN2GS5TJOR4YFJLWMFWHKZNEORZHKZNENZQW2ZNOO5QXIY3IL5QWG5DJOZUXI6MCUV3GC3DVMWSWS43TOVS2I3TBNVS2W5DIOJSWCZC7OR4XAZMCUV3GC3DVMWTTKNZSGM3DQMVENZQW2ZNIMFRXI33SL5UWJAVFOZQWY5LFVE4DKMJQGI2TQNZUURXGC3LFVFUGC427NRQWEZLMQKSXMYLMOVS2UMRTGY4DENRQHE3DDJDOMFWWLKLIMFZV63DBMJSWZAVFOZQWY5LFVIZDKNZRGE4TAMRSGSSG4YLNMWUWQYLTL5WGCYTFNSBKK5TBNR2WLKRSGU3TCMJZGAZDKNFENZQW2ZNJNBQXGX3MMFRGK3A. You are receiving this email because you commented on the thread.

Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

jamchengms avatar Oct 16 '25 01:10 jamchengms