Azure / azure-maps-ios-sdk-distribution

Azure Maps iOS SDK binary distribution for Swift Package Manager
MIT License
1 stars 9 forks source link

Support for CocoaPods #1

Open freightmike opened 2 years ago

freightmike commented 2 years ago

How can I pull this framework from CocoaPods?

ambientlight commented 2 years ago

this preview release is not yet available via CocoaPods

freightmike commented 2 years ago

I'm currently developing a Flutter Plugin which wraps the Android and iOS SDKs for Azure Maps. Flutter does not support using Swift Package Manager in plugins. https://github.com/flutter/flutter/issues/33850

CocoaPods is the standard in cross-platform frameworks like Flutter and React Native.

My plugin functions, and is getting more robust. I just need the ability to deploy it (acquire the iOS SDK with a dependency manager).


I've tried using the vendored_frameworks entry in my podspec to bundle the xcframeworks for MapLibre, AzureMaps and MSAL with my Pod. This ends in a failure for CocoaPods to install my pod into an external application. Pods cannot contain both static and dynamic libraries.

joshbax commented 2 years ago

@freightmike You can make MSAL dynamic by adding this to your podfile:

pre_install do |installer|
    installer.pod_targets.each do |pod|
      if pod.name == 'MSAL'
        puts "#{pod.name} is now a dynamic library"
        def pod.static_framework?;
          false
        end
        def pod.build_type;
          Pod::BuildType.dynamic_framework
        end
      end
    end
  end

This is how I was able to get the Azure Maps SDK working with Cocoapods.

I also had to modify AzureMapsControl.podspec to use an http source to a zip file instead of the git repo. Hope that helps.