marmelroy / PhoneNumberKit

A Swift framework for parsing, formatting and validating international phone numbers. Inspired by Google's libphonenumber.
MIT License
5.14k stars 818 forks source link

How to consume latest versions in a podspec file? #638

Closed ghost closed 1 year ago

ghost commented 1 year ago

Hi - I'm the maintainer of https://github.com/bottlepay/flutter_libphonenumber which wraps this package on iOS to expose phone number parsing in iOS for Flutter apps.

To make it convenient and consistent, the podspec file defines what eversion of PhoneNumberKit is used. But now that it's required to use git, i need to require users to add it to their pod file which is not ideal.

https://github.com/bottlepay/flutter_libphonenumber/blob/main/packages/flutter_libphonenumber_ios/ios/flutter_libphonenumber_ios.podspec

is there any way to lock the version in the podspec? The last version I see uploaded to cocoapods is 3.3.4.

bguidolim commented 1 year ago

Unfortunately, I am not able to update the version on official Cocoapods repo. I don't have access to this.

I've contacted the author and the Cocoapods team, with no success.

I don't know what else I can do to fix it.

ghost commented 1 year ago

Got it!

I resolved it by

s.dependency "PhoneNumberKit/PhoneNumberKitCore", "3.5.9"

and then consumers of the plugin just have to add the pod to their Podfile:

pod "PhoneNumberKit", :git => "https://github.com/marmelroy/PhoneNumberKit"

and the versioning works like expected.

acoutts commented 1 year ago

I see it was updated - does this mean you have access to cocoapods again? I found my above approach doesn't work because as soon as you push a new git tag and the latest master commit doesn't match the version i'm requesting, cocoapods says it can't find the pod.

https://github.com/acoutts/flutter_libphonenumber/pull/51

bguidolim commented 1 year ago

@acoutts Yes, I finally got access to the Cocoapods trunk for PhoneNumberKit. Any new updates will be accordingly pushed to Cocoapods.