13

I submitted my application using Apache Cordova to Apple Store and I got a warning from apple that "Missing Push Notification Entitlement".

But it seems that I've never used "Push Notification" in my application. How can I remove it from my application? Is it default in Apache Cordova?

Richard Slater
  • 6,313
  • 4
  • 53
  • 81
Trong Lam Phan
  • 2,292
  • 3
  • 24
  • 51

5 Answers5

19

HOW TO DO THIS FOR CORDOVA APPS 'PROPERLY':

I also had this problem. The solution proposed by @michaelb worked but I was frustrated enough seeing that the whole thing was wrapped in conditional compilation (ie #ifndef DISABLE_PUSH_NOTIFICATIONS) that I decided to learn how to add a 'Preprocessor Macro', which basically tells XCode to compile you app with this bit of code left out.

This is how the you can define the DISABLE_PUSH_NOTIFICATIONS precompilation symbol graphically via the UI (note that this the way its done in XCode 6.1):

enter image description here

Hope this helps other people out there in same situation.

Steven de Salas
  • 20,944
  • 9
  • 74
  • 82
5

In AppDelegate.m remove didRegisterForRemoteNotificationsWithDeviceToken and didFailToRegisterForRemoteNotificationsWithError. Working on PhoneGap 3.5

JW.
  • 50,691
  • 36
  • 115
  • 143
Klemenko
  • 704
  • 1
  • 10
  • 21
5

Following the advise above and in other places, this is what I did in Cordova 5.0.0

As result the warning disappeared and I haven't noticed any problem with the App.

  1. Open platforms/ios/InfoganGardenAdmin/Classes/AppDelegate.m
  2. Comment out line 116 to 137

example:

/* - Removed to disable push notification and Apple warning message
#ifndef DISABLE_PUSH_NOTIFICATIONS

    - (void)                                 application:(UIApplication*)application
        didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken
    {
        // re-post ( broadcast )
        NSString* token = [[[[deviceToken description]
            stringByReplacingOccurrencesOfString:@"<" withString:@""]
            stringByReplacingOccurrencesOfString:@">" withString:@""]
            stringByReplacingOccurrencesOfString:@" " withString:@""];

        [[NSNotificationCenter defaultCenter] postNotificationName:CDVRemoteNotification object:token];
    }

    - (void)                                 application:(UIApplication*)application
        didFailToRegisterForRemoteNotificationsWithError:(NSError*)error
    {
        // re-post ( broadcast )
        [[NSNotificationCenter defaultCenter] postNotificationName:CDVRemoteNotificationError object:error];
    }
#endif
*/
michaelbn
  • 7,393
  • 3
  • 33
  • 46
  • Did you make sure `DISABLE_PUSH_NOTIFICATIONS` was in fact defined ? It should have the same effect as what you're doing... weirdly, it is defined in my builds, but I still get the warnings. – Michael Jul 07 '15 at 09:31
  • 1
    I tried to set this flag but it didn't worked. I am not an expert in this so I might did it badly – michaelbn Jul 08 '15 at 13:18
2

It is most likely an issue with the version you are using, PhoneGap 3.5 has that same issue (PhoneGap is built on Cordova), you can view the discussion thread here

The current solution seems to be "use an older version"

Brett Gregson
  • 5,867
  • 3
  • 42
  • 60
-1

The email is pretty vague and can be taken multiple ways plus if you are a new developer you may not have known about the wait time for Apple Store app reviews. See AppReviewTimes.

To Clarify: Its just a warning and you can ignore it if you don't use push notifications.

Don't try to fix what ain't broke. Plus all the solutions I could find didn't work.

Weston Ganger
  • 6,324
  • 4
  • 41
  • 39