4

Is there a way that I can programmatically get human readable open-source library names, version and license text that CocoaPods is linking/referencing for an XCode project? I need to display this information inside the app to the user.

2cupsOfTech
  • 5,953
  • 4
  • 34
  • 57

2 Answers2

4

CocoaPods generates an acknowledgements plist file you can read programatically. It will also generate a settings bundle so you can add this directly to your settings without writing code.

See http://blog.cocoapods.org/Acknowledgements/ for information about the settings bundle and https://github.com/vtourraine/VTAcknowledgementsViewController for an example Pod that makes use of the plist to display the information in a table view.

kylef
  • 1,066
  • 1
  • 8
  • 11
0

Today a grat tool to display CocoaPods Acknowledments and also Carthage is this one: https://github.com/mono0926/LicensePlist

Just found today and tried it. Seems promising.

You can install it with pods ( Now supported )

pod 'LicensePlist'

And add a build script in XCode:

if [ $CONFIGURATION = "Debug" ]; then
${PODS_ROOT}/LicensePlist/license-plist --output-path $PRODUCT_NAME/Settings.bundle --github-token YOUR_GITHUB_TOKEN
fi

And it takes care to put in your Settings.bundle all license .plist files of the open source library that you are using.

There is also a good presentation on slideshare: https://www.slideshare.net/mono0926/licenseplist-a-license-list-generator-of-all-your-dependencies-for-ios-applications

This show the info in the your section inside the iOS Settings App.

I also put a shortcut inside my app to direct link the user to this section with that code:

Objective-C:

[[UIApplication sharedApplication]
         openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]];

Taken from this: URL Scheme "Open Settings" ios (there are also swift counterparts)

shadowsheep
  • 14,048
  • 3
  • 67
  • 77