4

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. If your app uses the Apple Push Notification service, make sure your App ID is enabled for Push Notification in the Provisioning Portal, and resubmit after signing your app with a Distribution provisioning profile that includes the "aps-environment" entitlement. Xcode 8 does not automatically copy the aps-environment entitlement from provisioning profiles at build time. This behavior is intentional. To use this entitlement, either enable Push Notifications in the project editor's Capabilities pane, or manually add the entitlement to your entitlements file. For more information, see https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/HandlingRemoteNotifications.html#//apple_ref/doc/uid/TP40008194-CH6-SW1.

When I upload a build to test flight I get the following mail from Apple.

And this has been happening since I Integrated the google sdk and implemented google sign in in my app.

I haven't enabled push notifications in my app and nor is there any problem with the certificates. Even in the capabilities tab push notifications are turned off

I don't seem to understand what the problem is. I don't want to enable push notifications as I am not using it in my app.

Any help will be appreciated. Thank you.

Following is my AppDelegate for reference

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate, GIDSignInDelegate, GIDSignInUIDelegate {
    var window: UIWindow?


    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
        let console = ConsoleDestination()
        log.addDestination(console)
        Mixpanel.initialize(token: AppConfig.mixPanelProjectToken)
        var configureError: NSError?
        GGLContext.sharedInstance().configureWithError(&configureError)

        if MixpanelTweaks.assign(MixpanelTweaks.showView) {
            navigateToView()

        }

        if  let infoPlist = Bundle.main.infoDictionary,
            let config = infoPlist["TwitterKeys"] as? Dictionary<String, AnyObject> {
            let consumer = config["consumerSecret"] as? NSString
            let consumerSecret = config["ConsumerKey"] as? NSString
            Twitter.sharedInstance().start(withConsumerKey:consumerSecret as! String, consumerSecret:consumer as! String)
        }


        // Override point for customization after application launch.
        return FBSDKApplicationDelegate.sharedInstance().application(application, didFinishLaunchingWithOptions: launchOptions)
    }

    func navigateToView(){
        let storyboard = UIStoryboard(name: "Main", bundle: nil)
        let initialViewController = storyboard.instantiateViewController(withIdentifier: "InitialViewNavigationController")
        self.window?.rootViewController = initialViewController
        self.window?.makeKeyAndVisible()
    }
    func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool {
        let handled = FBSDKApplicationDelegate.sharedInstance().application(app, open: url, sourceApplication: options[UIApplicationOpenURLOptionsKey.sourceApplication] as! String, annotation: options[UIApplicationOpenURLOptionsKey.annotation])

        GIDSignIn.sharedInstance().handle(url,
                                          sourceApplication:options[UIApplicationOpenURLOptionsKey.sourceApplication] as? String,
                                          annotation: [:])

        Twitter.sharedInstance().application(app, open: url, options: options)
        return handled
    }
    func sign(_ signIn: GIDSignIn!, didDisconnectWith user: GIDGoogleUser!, withError error: Error!) {

    }

    func sign(_ signIn: GIDSignIn!, didSignInFor user: GIDGoogleUser!, withError error: Error!) {
    }

    func signIn(signIn: GIDSignIn!, didSignInForUser user: GIDGoogleUser!,
                withError error: NSError!) {
    }

    func applicationWillResignActive(_ application: UIApplication) {

        FBSDKAppEvents.activateApp()
    }


    func applicationDidEnterBackground(_ application: UIApplication) {


    }

    func applicationWillEnterForeground(_ application: UIApplication) {

    }

    func applicationDidBecomeActive(_ application: UIApplication) {

    }

    func applicationWillTerminate(_ application: UIApplication) {
        GIDSignIn.sharedInstance().signOut()

    }   
}
A.S
  • 798
  • 1
  • 10
  • 32

2 Answers2

0

I had the same problem. But my app was kind of a modular build which had the push notification code but was explicitly disabled using a key in my code. Whenever I need to use the push notification functionality. I only needed to enable that key and included the push notification entitlement from the 'Capabilities' tab.

Since the code was present there I was getting a warning,

"Missing Push Notification entitlements- Your app includes an API for Apple's Push Notification service, but the aps-environment entitlement is missing from the app's signature."

. So I enabled it from Capabilities, but not enabled it from code and also not included into my App ID at Developer Portal/Member Center.

It worked I didn't got any warning and my app is successfully running on the App Store.

Although this warning from Apple has started coming from Xcode 8. You can also find another similar warning and solutions of "Push Notification Entitlements missing" from below link:

Xcode 8 "the aps-environment entitlement is missing from the app's signature" on submit

Shubham Ojha
  • 461
  • 5
  • 17
0

It's a nothing-burger. I got that after adding Sentry as a dependency. But my own native code has no calls to remote notifications. I get the same warning, but I just explain it to the review team in the release notes and the builds are approved as expected.

Mike Critchley
  • 1,643
  • 15
  • 20