HAK
HAK

Reputation: 2071

No valid 'aps-environment' entitlement error when distributing app via Firebase fastlane distribution

I have setup Firebase distribution via fastlane in my app and its working fine. Now I am setting up Firebase CloudMessaging. I followed steps documented by google and able to receive notification on my device while running app from Xcode. But when I distribute my app on Firebase via fastlane, I am uable to receive push notification.

This is the message I am getting on the console log when I run my app on the device: iPhone Console Log

Here is the lane I am using in the Fastfile:

desc "Development build"
lane :dev do
increment_version_number(
    bump_type: "patch" # Automatically increment patch version number
)
build_app(scheme: "Dev",
    workspace: "myapp-ios.xcworkspace",
    include_bitcode: false,
    output_directory: "~/builds/myapp-ios/development/",
    output_name: "myapp-dev.ipa",
    export_options:{
        method: "ad-hoc",
        provisioningProfiles: {
            "com.mycompany.myapp.dev" => "match AdHoc com.mycompany.myapp.dev"
        },
        signingStyle: "automatic"
})
firebase_app_distribution(
    app: "xxxxxx",
    testers: "[email protected]",
    release_notes: "DEV Build: Fastlane setup",
    firebase_cli_path: "/usr/local/bin/firebase"
)
end

Also I have enabled push notifications for the configuration in Xcode:

configs

And the notification is also enabled for the app identifier I am using.

Upvotes: 2

Views: 912

Answers (1)

Fahad Ajmal
Fahad Ajmal

Reputation: 1520

I can see that you have multiple configuration setups on your project, the second screenshot only shows that you have entitlement for "Dev Debug". Meanwhile, in your FastLane file, you are creating a build using AdHoc profile which will point towards "Dev Release".

Please add the same notification entitlement for "Dev Release" and also set the same background modes permission as well.

Upvotes: 1

Related Questions