No release in over 3 years
Low commit activity in last 3 years
Use AppCenter API to get the latest version and build number for an App Center app
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

 Project Readme

latest_appcenter_build_number plugin

fastlane Plugin Badge Gem Version

Getting Started

This project is a fastlane plugin. To get started with fastlane-plugin-latest_appcenter_build_number, add it to your project by running:

fastlane add_plugin latest_appcenter_build_number

About latest_appcenter_build_number

Use AppCenter API to get the latest version and build number for an App Center app

Example

You can fetch the latest version for a given app with the following command in your Fastfile:

version_number = latest_appcenter_build_number

this will use the environment variable APPCENTER_API_TOKEN to fetch the list of apps for a given owner account, and then prompt you for which one to use. This can also be specified as a parameter, e.g.:

version_number = latest_appcenter_build_number(api_token: "my-APPCENTER-api-token")

The parameters owner_name and app_name, or environment variables APPCENTER_OWNER_NAME, and APPCENTER_APP_NAME, can also be set:

version_number = latest_appcenter_build_number(
  api_token: "my-APPCENTER-api-token", # note that this will need to be generated from here: https://appcenter.ms/settings/apitokens
  owner_name: "owner-name",
  app_name: "My-Awesome-App"
)

You can then use version_number for whatever purpose you required, including updating the shortVersion or buildNumber of your Xcode project.

Replacing latest_hockey_build_number

If you're using this as a direct replacement for the old latest_hockey_build_number having migrated your apps to AppCenter, you should change instances of this:

latest_hockey_build_number(api_token: "my-HOCKEY-api-token", bundle_id: "com.example.my-awesome-app")

to this:

latest_appcenter_build_number(
  api_token: "my-APPCENTER-api-token", # note that this will need to be generated from here: https://appcenter.ms/settings/apitokens
  owner_name: "owner-name",
  app_name: "My-Awesome-App"
)

To find out your app_name correctly, head to https://appcenter.ms/apps?os=All. Your app_name will most likely be what's listed under the 'Name' column but with hyphens instead of whitespace.

To find out your owner_name correctly, head to https://appcenter.ms/settings/profile. Your owner_name will most likely be what's listed under the 'username' field.

Run tests for this plugin

To run both the tests, and code style validation, run

rake

To automatically fix many of the styling issues, use

rubocop -a

Issues and Feedback

For any other issues and feedback about this plugin, please submit it to this repository.

Troubleshooting

If you have trouble using plugins, check out the Plugins Troubleshooting guide.

Using fastlane Plugins

For more information about how the fastlane plugin system works, check out the Plugins documentation.

About fastlane

fastlane is the easiest way to automate beta deployments and releases for your iOS and Android apps. To learn more, check out fastlane.tools.