I am using fastlane to create and submit an application to testflight. Everything worked until I added Notification Content Extension and Notification Service Extension. Now apple pay and push notifications stopped working when building via fastlane.
**
My config file:**
lane :beta do
api_key = get_api_key()
build_no = ENV["CIRCLE_BUILD_NUM"]
changelog = File.read("./release_notes.txt")
prepare()
provision = get_provisioning_profile(
fail_on_name_taken: false,
skip_install: false,
api_key: api_key,
filename: 'AppStore_' + ENV["BUNDLE_ID"] + '.mobileprovision',
force: true
)
provision_name = lane_context[SharedValues::SIGH_NAME]
update_code_signing_settings(profile_name: provision_name, use_automatic_signing: false)
build_application()
enable_automatic_code_signing(path: "./app.xcodeproj")
upload_to_testflight(
api_key: api_key,
skip_waiting_for_build_processing: true,
changelog: changelog
)
after_all do |lane|
# This block is called, only if the executed lane was successful
notification(message: "Release iOS beta finished")
end
error do |lane, exception|
notification(message: "Release iOS beta error")
end
end
lane :build_application do
sync_code_signing(type: "appstore") # see code signing guide for more information
build_app(
scheme: "app",
export_method: "app-store",
clean: true,
configuration: "app",
skip_codesigning: true,
export_team_id: ENV["TEAM_ID"],
export_xcargs: "-allowProvisioningUpdates",
skip_package_ipa: false,
# entitlements: "./app/app.entitlements",
export_options: {
provisioningProfiles: {
ENV["BUNDLE_ID"] + ".extension1" => "match AppStore " + ENV["BUNDLE_ID"] + ".extension1",
ENV["BUNDLE_ID"] + ".extension2" => "match AppStore " + ENV["BUNDLE_ID"] + ".extension2",
ENV["BUNDLE_ID"] => "match AppStore " + ENV["BUNDLE_ID"]
},
}
)
end
lane :code_signing do
update_code_signing_settings(
use_automatic_signing: false,
path: "./app.xcodeproj",
targets: ["extension1"],
team_id: "0000",
profile_name: ENV["BUNDLE_ID"] + ".extension1"
)
update_code_signing_settings(
use_automatic_signing: false,
path: "./app.xcodeproj",
targets: ["extension2"],
team_id: "0000",
profile_name: ENV["BUNDLE_ID"] + ".extension2"
)
end
After adding two extensions (Notification Content Extension and Notification Service Extension), the standard build via Fastlane stopped working, because these two extensions need to be signed additionally.
After signing the extensions, the Fastlane build started working. But push and apple pay stopped working
As it turned out, the extensions were not signed. As a consequence, Apple Pay and Pushes don’t work (example of Pushes error: ITMS-90078: Missing Push Notification Entitlement – Your app appears to register with the Apple Push Notification service, but the app signature’s entitlements do not include the ‘aps-environment’ entitlement).
We generated the entitlement file using Fastlane, put it in the root of the iOS project directory, where the file should be. We tried to build the app through Fastlane. As a result, Apple Pay and Pushes did not subscribe.
We also tried to slip a link to the custom entitlement manually in Fastlane, but Apple Pay and Pushes didn’t fix it.
mike is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.