I just put the application in apple . apple sent me a mesasge
Missing Push Notification Entitlement - Your app appears to include API used 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. See “Provisioning and Development” in the Local and Push Notification Programming Guide for more information. If your app does not use the Apple Push Notification service, no action is required. You may remove the API from future submissions to stop this warning. If you use a third-party framework, you may need to contact the developer for information on removing the API.
knowing that I did not use the notification in my project
// all plugins will get the notification, and their handlers will be called
[[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVPluginHandleOpenURLNotification object:url]];
I have received this same warning. However, I believe that since I am not using push notifications there should be no issue. At least, that is what I gather from the above quote. Has anyone had experience otherwise?
I’m getting the same issue, even after I thought I added the entitlements to the App ID. I guess I’ll try removing those methods in AppDelegate? Did that work for anyone else?
What is the common denominator here? PhoneGap perhaps?
Or PhoneGap 3.5?
On the PGB forums there is a recognised issue with this particular error and PGB 3.5. It does not exists on 3.4 and appears to not cause App Store rejects though. I submitted to the App Store yesterday, with PG 3.5 and I got this error. Will feedback.
Got the same warning myself today, on a project I used Phonegap/cordova 3.5 for (not ionic) so it seems to be cordova based if you guys are getting it for ionic.
Also like you guys, my app has nothing to do with push notifications.
It says that if you’re not using Push Notification, then no action is required. So I would just wait until they accept or deny your app submission. That’s what I’m doing. This just seems to be more of a warning than a “denied” message.
I am not sure if this helps but I fixed the problem as follows:
Create a hook to remove the offending functions from AppDelegate.m.
Invoked the hook for the ios platform during “after_prepare” in config.xml.
HOOK: ios-remote-notification-fix.js
The hook looks like this. Please note that you will have to change MyApp in the fn setting to your app name.
#!/usr/bin/env node
// ================================================================
// Read the platforms/ios/<appname>/Classes/AppDelegate.m
// and comment out the following functions:
// 1. didRegisterForRemoteNotificationsWithDeviceToken
// 2. didFailToRegisterForRemoteNotificationsWithError
// ================================================================
var fs = require('fs');
var sys = require('sys')
sys.puts('');
sys.puts('# ================================================================');
sys.puts('# HOOK: ios-remote-notification-fix.js');
sys.puts('# ================================================================');
// The file to change (and its backup).
var fn = 'platforms/ios/MyApp/Classes/AppDelegate.m';
var fno = fn + '.orig'; // backup
// Make sure that this hook is re-entrant.
if (fs.existsSync(fn) && !fs.existsSync(fno)) {
sys.puts('INFO: creating ' + fno);
fs.writeFileSync(fno, fs.readFileSync(fn));
fs.readFile(fn, function(err, data) {
if (!data) {
sys.puts('ERROR: could not read file: "' + fn + '"');
process.exit(1);
}
sys.puts('INFO: read ' + fn);
sys.puts('INFO: ' + data.length + ' bytes');
// Convert to lines for parsing.
var lines = [];
var line = '';
for(var i=0; i<data.length; i++) {
var ch = String.fromCharCode(data[i]);
line += ch;
if (data[i] == 10) {
lines.push(line);
line = '';
}
}
if (line.length > 0) {
lines.push(line);
}
sys.puts('INFO: ' + lines.length + ' lines');
// Filter out the functions in question using line parsing.
var fcts = [ 'didRegisterForRemoteNotificationsWithDeviceToken',
'didFailToRegisterForRemoteNotificationsWithError'];
var newlines = [];
var start = 0;
for(var i=0; i<lines.length; i++) {
var line = lines[i];
// See if one of the functions is found. If it is
// we are one line beyond what needs to be filtered
// out.
//
// Example:
//
// - (void) application:(UIApplication*)application
// didFailToRegisterForRemoteNotificationsWithError:(NSError*)error
// {
// // re-post ( broadcast )
// [[NSNotificationCenter defaultCenter] postNotificationName:CDVRemoteNotificationError object:error];
// }
//
var found = false;
for(var j=0; j<fcts.length; j++) {
if (line.indexOf(fcts[j]) >=0 ) {
found = true;
break
}
}
// The function was found, ignore it.
if (found) {
// We are one past the lines to ignore.
var end = i - 1;
for(var j=start; j<end; j++) {
newlines.push(lines[j]);
}
// Skip the function code and reset start.
for(; i<lines.length; i++) {
line = lines[i];
var j = line.indexOf('}');
if (j >= 0 && j <= 2) {
// + 2 because we know by inspection that there is
// a trailing empty line.
start = i + 2;
break;
}
}
}
}
for(var i=start; i<lines.length; i++) {
var line = lines[i];
// Handle the case where the last line does not end with a new line.
if (line.indexOf('\n') < 0) {
line += '\n';
}
newlines.push(line);
}
var newdata = newlines.join('');
sys.puts('INFO: writing ' + fn);
sys.puts('INFO: ' + newdata.length + ' bytes');
sys.puts('INFO: ' + newlines.length + ' lines');
fs.writeFileSync(fn, newdata);
});
}
sys.puts('# ================================================================');
sys.puts('# DONE: ios-remote-notification-fix.js');
sys.puts('# ================================================================');