Listed on the Swift Package Index.
This package will provide you easy access to useful information on the provisioning profile used in your app, such as the profile's name and the date it will expire. Read my blog post for this library for a bit more of a discussion around this.
You can use this information to display in the development versions of your apps to make it easy to check when the profile will expire (and hence, when the app will stop working without being reinstalled again).
You could show an alert when the app starts up if the profile is going to expire soon to remind you (or allow you test users to remind you) to redistribute the app with a new profile. You could even schedule a local notification so that the reminder is still visible if the app isn't in regular use.
There's also a shell script included in the package that can be added as a Run Script build phase in your app so that when building or archiving you can get a warning or error if the provisioning profile is going to expire soon.
Adding to your project
Follow Apple's guidance to add the package to your project.
In your source code
import ProvisioningProfile let profileName = ProvisioningProfile.profile()?.name let profileExpiry = ProvisioningProfile.profile()?.expiryDate let profileExpiryFormatted = ProvisioningProfile.profile().formattedExpiryDate
ProvisioningProfile class has the following customisation points:
- The static property
dateFormattercan be used to set a custom
DateFormatterfor use in generating the
formattedExpiryDateproperty, if the default formatting is not suitable.
- The static property
loggercan be used to provide a delegate that receives information about errors or warnings that have occurred during loading and parsing of the provisioning profile. See the
Loggerprotocol for more information.
See the test apps in the
Examples folder for runnable example usage.
In your build phases
You can add the
check_provisioning_expiry.sh shell script as a Run Script build phase to provide a warning or error if the profile
will expire soon.
Copy the script file out of the package/repo and add it to your own project's files. See the build phases of the test apps in
Examples for an example of how to make use of the script.
If you wish to make any contributions to this project, feel free to make a fork and then submit a pull request back with your proposed changes/additions.
Make sure any changes or additions are covered with unit tests and the test apps are updated as appropriate.
Bear in mind that breaking changes should be avoided where possible!
The project is setup with SwiftLint to check code quality a little. It's configured
.swiftlint.yml file in the root of the project.
Run a scan with the following command in the root of the project:
API documentation can be generated with Jazzy. Whilst this isn't published it's
useful for pointing out parts of the API that aren't documented correctly (check the
undocumented.json file for
any warnings after the documentation is generated), so you can be sure the API documentation available within
Xcode will be correct and useful to users.
Generate the documentation using the following command in the root of the project: