1

When submitting my app to the app store which does not use push notifications I get a message saying I have no entitlement for push notifications.

I understand that you can add "DISABLE_PUSH_NOTIFICATIONS" to the xcode project

see here https://stackoverflow.com/a/31799975/122232

but everytime I build in VS I get a new xcode project, I would like to set this in a config in VS somehow so I won't have to remember

I tried adding a res\native\ios\cordova\build-release.xcconfig file

GCC_PREPROCESSOR_DEFINITIONS[config=Release] = $(inherited) DISABLE_PUSH_NOTIFICATIONS=1

but that didn't show up in the project - what am I doing wrong?

Community
  • 1
  • 1
Anthony Johnston
  • 9,405
  • 4
  • 46
  • 57
  • A teammate of mine just suggested that the config file you're trying to use should actually be named res\native\ios\cordova\build-release.xcconfig (i.e. xcconfig vs. xconfig). Can you try reverting my hook recommendation and see if this file name change works for you? I'll try to test this out later, too. – Jordan Matthiesen Sep 11 '15 at 17:39
  • sorry yes, thats what its called, I made a typo here – Anthony Johnston Sep 11 '15 at 21:34

1 Answers1

2

Here's another similar post that may have some answers that can help you:

Missing Push Notification Entitlement warning

In that post there is a useful snippet of code for a hook you can use to automate setting the preprocessor definition to DISABLE_PUSH_NOTIFICATIONS. Based on comments here, I made a change to it that may help - try using the code in this Gist:

https://gist.github.com/jmatthiesen/34eb71a73de39fd501df

Community
  • 1
  • 1
Jordan Matthiesen
  • 1,480
  • 7
  • 17
  • Hi thanks for that.. I put the file in res/native/ios/cordova and a hook in the config.xml under platform[name=ios] but it has a dependancy.. and I get the error "cordova-build error BLD401: Error : BLD00401 : Could not find module 'xcode'." – Anthony Johnston Sep 09 '15 at 22:49
  • I tried installing the xcode module on the build mac, it installed ok using "sudo npm install -g xcode" - but the build failed with the same error – Anthony Johnston Sep 09 '15 at 22:58
  • The same "Cculd not find module 'xcode'?" Are you building using the remote-build module for Visual Studio remote builds? Or are you just trying to build via the cordova command line interface on the Mac right now? – Jordan Matthiesen Sep 10 '15 at 18:29
  • via vs remoteBuild server on a mac mini – Anthony Johnston Sep 11 '15 at 19:04
  • I added a comment to the original post, please let me know if that helps out. Otherwise I have one more idea I can try out. – Jordan Matthiesen Sep 11 '15 at 20:08
  • 1
    I updated the code for that hook so that it should work for you. On your machine the app is being built without access to the globally installed npm modules, so "xcode" wasn't found. With my code change, it tells Cordova to look for the "xcode" module in the dependencies/modules it already has loaded. – Jordan Matthiesen Sep 15 '15 at 16:24
  • Woohoo that's worked, thanks @jordan-matthiesen. One thing tho I get the directive added twice for each configuration, although it doesn't make any difference – Anthony Johnston Sep 17 '15 at 12:44