ARTICLES

How to add CocoaPods acknowledgements plist to iOS settings

This tutorial will explain how to add the automatically generated CocoaPods acknowledgements plist file to your app’s iOS settings page.

CocoaPods automatically creates an acknowledgements markdown and plist file with the license information of all the pods in you project.  You can use the plist file to create an acknowledgements section in the iOS settings for your app.

Note: There is a bug in Xcode 7.2 UI for creating a Child Pane.  Below is a workaround.

  1. In Xcode workspace, Create New File.. Resource..Settings Bundle.
  2. Right click Settings.bundle and select “Add Files to “Settings.bundle”…”
  3. Find the Pods-AppName-acknowledgements.plist file in the /Pods/Target Support Files/Pods-AppName directory
  4. Rename the file to just Pods-acknowledgements
  5. Select Root.plist settingsBundle
  6. Delete the pre populated preference items by selecting them and then pressing Backspace defaultRootPlist
  7. Right click and select “Show Raw Keys/Values” showRawKeysValues
  8. Add a new item to the PreferenceSpecifiers of any type.
    1. Change the value of Type to PSChildPaneSpecifier
    2. Create or set the Title attribute to ACKNOWLEDGEMENTS
    3. Create or set the File attribute to Pods-acknowledgements
    4. Delete the other unused attributes childPane
  9. In the en.lproj folder open Root.strings, delete the default values and add the following:

      "ACKNOWLEDGEMENTS" = "Acknowledgements";
    
  10. From your test device, delete the app and build to test.  You will need to delete the app every time you make a change to the Settings.bundle.

  11. Go to the iOS settings app and browse down to your app name and select it.  It should now have the below child pane. AcknowledgementsChildPage

  12. Create a script to copy the pod generated file over every time you make a build:

    1. In Xcode go to your project’s target.  Select the Build Phases tab.
    2. If the Run Script section doesn’t already exist.  Press the Plus icon and select “New Run Script Phase”.  In the Run Script section insert the following copy command:
      cp "/Path/To/ProjectName/Pods/Target Support Files/Pods-ProjectName/Pods-ProjectName-acknowledgements.plist" "/Path/To/ProjectName/Resources/Settings.bundle/Pods-acknowledgements.plist"
    

 

Apple Documentation at https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/UserDefaults/Preferences/Preferences.html

 

Get insights into your Apple Search Ads performance and optimize your bids and keywords for maximum revenue with Kitemetrics by Kitefaster.

 

Tested with the following versions:

  • Xcode 7.2
  • iOS 9.2.1
  • Swift 2.1.1


Our Products

Kitemetrics
Keyword level attribution for Apple Search Ads. Optimize your bids and increase your revenue. Sign up for free at kitemetrics.com.

White Noise and Deep Sleep Sounds
Calming and relaxing sounds that will help you sleep like a baby tonight.
Download for free from the App Store.
Get it on Google Play.