Cordova how to remove "Push notification" on iOS - ios

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?

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):
Hope this helps other people out there in same situation.

In AppDelegate.m remove didRegisterForRemoteNotificationsWithDeviceToken and didFailToRegisterForRemoteNotificationsWithError. Working on PhoneGap 3.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.
Open platforms/ios/InfoganGardenAdmin/Classes/AppDelegate.m
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
*/

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"

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.

Related

iOS9 Text notification feature, I get nil value in responseInfo in app delegate

I am trying to update my app with new "text reply" action added in iOS9.
I updated my code as per instruction in WWDC15 videos/documents and http://fancypixel.github.io/blog/2015/06/11/ios9-notifications-and-text-input/.
I am able to get reply button and text box in my notification on IOS9 beta 5. After typing the message the app delegate
(void)application:(UIApplication *)application handleActionWithIdentifier:(nullable NSString *)identifier forRemoteNotification:(NSDictionary *)userInfo withResponseInfo:(NSDictionary *)responseInfo completionHandler:(void(^)())completionHandler{
i implemented also gets called. But "responseInfo" is coming null and i am unable to get the text.The "identifier" clearly shows "TEXT_ACTION". "category" in user info shows as 'reply'. The only piece missing is "responseInfo". Am i missing some more setting in order to receive the text i typed.
I had the exact same problem as you when I was on iOS 9.0, even though it had previously worked on iOS 9.0. I thought maybe updating to iOS 9.1 would fix it along with the update to XCode, but on the first push it the problem persisted. I kept continuing to send push notifications and reimplemented the delegate method with just a NSLog and it started working again. So I'm not really sure what fixed it.
Have you tried setting activationMode to background?
action.activationMode = .Background
action.activationMode.behavior = .TextInput

How does flurry analytics track my apps version number?

I'm viewing my top used version numbers in flurry for my app. It appears flurry is using the build number field (bundle version) in my plist to report what version a particular app is. Is this true? If so, can I have use a different field in my plist? (i.e Bundle Version string short) How? I frequently change the build number and I want to see something like 1.0.1 (a version) instead of 28 (a build number) in flurry.
I got bit by this too, it seems bizarre to me they would use the build number by default. I added an auto-incrementing build number script and by the time I next checked Flurry, it showed about 100 different "versions", each just a new build. Ugh, what a mess.
The good news is the Flurry API provides a way to explicitly set the reported app version at runtime. I have a #define in my prefix file that links to the "short version string", which in Apple's system is basically your user-facing app version (e.g. "1.0.2"), and is probably the one you want to be tracked in Flurry.
#define kAppVersion [[NSBundle mainBundle] objectForInfoDictionaryKey:#"CFBundleShortVersionString"]
Doing it this way means that you don't have to remember to set the version in more than one place. Set it in your target's "Identity" section or in the Info.plist file and you're done.
Then in my app delegate's application:didFinishLaunchingWithOptions: method, when I start up Flurry collections, I tell it to use that.
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[Flurry setCrashReportingEnabled:YES];
[Flurry setAppVersion:kAppVersion]; // <-- will now report your short version string
[Flurry startSession:kFlurryAPIKey];
// ...
}
Above method is deprecated instead user as below.
if let version = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String {
Flurry.startSession("xxxxxxxxxxxxxxxxxxx", with: FlurrySessionBuilder
.init()
.withCrashReporting(true)
.withLogLevel(FlurryLogLevelAll).withAppVersion(version))
}

improper advertising identifier [IDFA] usage, but it doesn't

While uploading app-file to itunesconnect the XCode says: improper advertising identifier [IDFA] usage...etc.
But I do not use this feature in my project. I've tried to find any
[[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString]
calling. Futhermore, I'm just fixing a bug of my app, I hadn't included such features since my first release. The first release didn't said about IDFA-usage.
Well, this error happened about 15 days ago and it wasn't clear what is the reason till Apple released the Xcode update the same day and everything went smooth after that. Again, today I get the same message though I tried to upload the same builds for an app which I submitted 8 days ago.
I think we have just to wait for a few hours and see what will happen.
EDIT: Here is a link to show people complain about it at that time and how it was solved without doing anything: LINK
UPDATE: For anyone who uses PlayHaven ads, this may be helpful to avoid this error. Comment the 2 following sections:
In the file PHAdRequest.m (Lines 35-44)
/* if (![PHAPIRequest optOutStatus] && [ASIdentifierManager class])
{
NSUUID *uuid = [[ASIdentifierManager sharedManager] advertisingIdentifier];
NSString *uuidString = [uuid UUIDString];
if (0 < [uuidString length])
{
theIdentifiers[#"ifa"] = uuidString;
}
}*/
In PHAPIRequest.m (Lines 379-383):
/* if ([ASIdentifierManager class])
{
NSNumber *trackingEnabled = [NSNumber numberWithBool:[[ASIdentifierManager sharedManager] isAdvertisingTrackingEnabled]];
[combinedParams setValue:trackingEnabled forKey:#"tracking"];
}*/
This is a temporary workaround till PlayHaven updates their SDK.
I had provided this answer on another similar question and it seems to have been of help & I think my answer is particularly suited also to this question...
I had a similar error in an update to an app that had previously updated fine and then a few days ago was causing an error, after Apple made a recent change. I wasn't using any ads but do have Facebook integration (which needs the AdSupport framework). I believe, after searching the net, that Facebook uses the advertising ID for its own analysis purposes so, even though I'm not including ads in my app, the validation and upload processes through xCode were failing with the error "Your app contains the Advertising Identifier [IDFA] API..."
I searched and found that I needed to download the Facebook SDK source code, update the FBUtility.m to remove the references to the advertisingID but, in fact, I simply needed to:
1) download the source code for the latest SDK, which I did from here: https://github.com/facebook/facebook-ios-sdk (I downloaded the zip file from github to my documents folder)
2) build the framework - open the terminal. Use cd documents at the command prompt, then use this command: sudo scripts/build_framework.sh, which will run the build_framework.sh script that is in the scripts subfolder within the downloaded Facebook SDK folder
3) Remove the old FacebookSDK.framework from your Xcode project and add the new one (in my case, I navigated to documents/facebook-ios-sdk/build & choose the FacebookSDK.framework folder
4) Archive the project and it should (it was in my case) be good to upload
Hope that helps someone along the way - I've been at this for days!!
Simply upload your binary as you've been doing this while, and broadly classify IDFA in two categories:
publisher: You use third-party ad-networks library to display ad. Choose the 1st option in IDFA -> "Serve advertisements within the app". You're a publisher since you show ads, but do not perform advertising for your own app.
Advertiser: You use third-party libraries to track conversions for your app, as well as track 'goals' in your app. You directly do not show ads in your app. Choose the 2nd & 3rd option in IDFA -> "Attribute this app installation to a previously served ad". AND "Attribute an action taken within this app to a previously served advertisement".
Mixed: You track conversions for your app, as well as display ads in your app. Choose all three options.
In case of PlayHaven, setup PH_USE_AD_SUPPORT to 0 will disable the AdSupport framework.
PHConstants.h
/**
* By default, PlayHaven will require the AdSupport framework. Projects using a version of
* Xcode older than 4.5 may define \c PH_USE_AD_SUPPORT to be 0.
*
* #note By disabling the AdSupport framework, the SDK will not be able to collect the IFA
**/
#ifndef PH_USE_AD_SUPPORT
#define PH_USE_AD_SUPPORT 1
#endif
Work for me to fix "improper advertising identifier" when submit.

phonegap push notification showing errors in Xcode

So I'm incorporating the phonegap plugin for push notifications into my phonegap app but was receiving an error in my consol saying that #import <Cordova/JSONKit.h> was wrong and the file couldn't be found. So going off this post here I was able to resolve the error but now its coming up with two addition warnings.
NSString* uuid = [[UIDevice currentDevice] uniqueIdentifier]; uniqueIdentifier in depreciated
and
NSString *jsStatement = [NSString stringWithFormat:#"window.plugins.pushNotification.notificationCallback(%#);", [userInfo cdvjk_JSONString]]; instance method -cdvjk JSONString not found
Has anyone come across this before? I'm using phonegap 2.4.0
The first error is due to UUIDs being deprecated, unless you fix that warning your app will never be accepted into the app store. The fix is easy, replace [[UIDevice ...] ...] with:
NSString *uuid = [[ASIdentifierManager sharedManager] advertisingIdentifier]
For the second issue, change cdvjk_JSONString to JSONString, this will be resolved in the next release of Cordova / PhoneGap.

CoreMidi _MIDINetworkNotificationContactsDidChange symbol not found

I'm getting the following error after a crash in an iPad app that uses CoreMIDI (The * are to blank out the app name):
Dyld Error Message:
Symbol not found: _MIDINetworkNotificationContactsDidChange
Referenced from:
/var/mobile/Applications/8F08B78E-929D-4C5A-9F02-08FD5743C17F/***.app/***
Expected in: /System/Library/Frameworks/CoreMIDI.framework/CoreMIDI
in /var/mobile/Applications/8F08B78E-929D-4C5A-9F02-08FD5743C17F/***.app/***
Dyld Version: 179.4
When the app launches, I listen for MIDI Network Sessions using
[[NSNotificationCenter defaultCenter] addObserver:self selector:#selector(sessionDidChange:) name:MIDINetworkNotificationSessionDidChange object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:#selector(sessionDidChange:) name:MIDINetworkNotificationContactsDidChange object:nil];
Which seems to be what is causing the crash. This is after I call
session = [MIDINetworkSession defaultSession];
session.enabled = YES;
session.connectionPolicy = MIDINetworkConnectionPolicy_Anyone;
MIDIClientCreate(CFSTR("MidiManager"), midiNotifyProc, (void*)self, &midiClientRef);
This kind of looks like CoreMIDI library has not been included in the build. Problem is, it IS included in the build as a required framework. (And the deployment target is set to 4.2). I can run the build fine on my iPad and have been testing extensively with other users' iPads also with no problems whatsoever. Also, this is an update to an existing app that has had several updates already with no problems.
I just double checked my deployment build and the framework is definitely included, and I just installed that build onto my iPad (with a different provisioning profile from the store) and it works fine also.
What could be happening? Could it be that Xcode just did a bad build for the one I sent to Apple, or am I missing something obvious? Could I change the MIDINetworkNotificationSessionDidChange notification symbol to a literal string (#"MIDINetworkNotificationSessionDidChange") to fix things for the mean time?
Thanks for any help!
Seems like this was an Apple thing. The .mm of PGMidi's workhorse class includes this at the top:
// For some reason, this is not pulled in by the umbrella header
#import <CoreMIDI/MIDINetworkSession.h>
https://github.com/petegoodliffe/PGMidi
Did you remember to set the minimum OS requirements to 4.2 in your Info.plist? It could be that the crash reports are coming from users on an earlier version of iOS who are upgrading when they shouldn't be.

Resources