Newsstand App download when app is closed - iphone

I am implementing a newsstand magazine app, which receives new issues via Urban Airship push notifications.
This works fine, as long as the app is in foreground or background, but as far as I know, the download should also be triggered when the app is completely closed. But sending a push with "content-available":1 in the payload does not do anything if my app is closed.
I set the required background mode in the targets properties and I use NKDontThrottleNewsstandContentNotifications to avoid problems with testing.
Am I missing something?
Shouldn't the push lead to my
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
being called with UIApplicationLaunchOptionsRemoteNotificationKey?
Help much appreciated!

As per this article,
developers that are developing Newsstand apps can deliver a new “souped-up” push notification that informs their app (rather than the user as push notifications normally do), that a new issue is ready to be downloaded. When a Newsstand app receives such a notification, it can download in the background if the device is on WiFi. The main limitation here is that each app can only send 1 of these push notifications per day, so at the moment developers cannot develop newspapers that deliver both a morning edition and evening edition – although I suspect this might change eventually.
So it can download only if the device is on Wifi.
These are other similar questions, new stand push and execute code, iOS newsstand: push notification does not launch the app in background, Newsstand restarts the download on Resuming and this iPhone Newsstand push registration Failure. Check if you are missing anything mentioned in those answers as well.
Here is the apple documentation on this and another blog on this.

Related

How do I get notified when user starts messaging or mailing app in iOS

Actually I want to build such a iOS app which will give alert if user start sms application or messaging application when he is driving more than certain speed limit. As I am new in iOS development I don't know whether it is feasible or not?
Basically my id:
Q: How do I get notified when user starts messaging app?
Due to iOS sandboxing restrictions, you cannot get any information from your app regarding launching or usage of any other apps.
The only way to do this would be if you were the developer of both apps. In that case you could use an external server to log when each of the apps is launched and then get this information from the converse app.

Event when user activates / deactivates Push on iOS

I'm developing an iPhone & Android via Phonegap. I already got the Push Function to work on the iOS device, and I also can recognise whether the user has Push activated or not while the App is running.
Now I want to be informed when the user activated / deactivated Push Messages in the notification center, even if the app is not running.
Is there anyway to do this? I searched quite a lot on this topic, but all I found were ways to recognise if push is activated or not, which I already can.
Any help will be appreciated.

Can iPhone apps start on start-up?

I've answered two different questions now, both explaining how VOIP apps don't start on start-up, yet people seem to think they do.
I'm not 100% sure myself, someone linked me to a part of the apple docs, which doesn't really mention anything about auto-starting of apps.
I was originally going on prior knowledge and this answer, but after another person saying that they do, I'm really not sure.
As far as I'm aware, apps only react to push notifications, and can't be launched into the background when a device is turned on.
Can we please clarify whether it is possible to auto-start an app or not?
Take a look at the UIBackgroundModes section in this document - it seems to state that adding the voip key will autostart an app on boot.
Edit: a sample app seems to confirm this behavior.
I confirm that setting VOIP mode works. However, I've found that the app won't restart after power up unless it was running when the device was powered off. Furthermore, the app won't actually restart on the recently powered up device until the device is unlocked after power up.
OK, I don't know if this classifies as an answer but I feel obligated to say. I am developing an app that both tracks significant location changes and provides VoIP features. The app has voip key in Required background modes. I tried some cases which I would like to share the results:
App is in Debug mode - Turned off while app was running (active or background) - iOS 7.1.1 (11D201) and iPhone 4 (product name: iPhone3,2):
When booted, app is running in background, as well as other apps that were running before. I do not think this is related to VoIP in any way.
App is in Debug mode - Turned off while app was terminated - iOS 7.1.1 (11D201) and iPhone 4 (product name: iPhone3,2):
When booted, the app is not running, there are no logs in configuration utility, server says the user is not registered I cannot call it from other devices; and yet the other apps that are not related to voip or location tracking but were open before turning off are at least loaded in memory. Meaning, the voip key did not work.
I have continued the test with the same app but this time downloaded it from app store. The results are the same. Changed the device and os to iPhone 3G (product name: iPhone2,1) and iOS 6.1.6 (10B500). Nothing changed both in debug and release modes.
I have told my boss that Apple provides this behavior and it can be done. Then I had second thoughts and tried, now I am desperately trying to find another way. Going to send my regards to Apple about this.
You can not launch an application without user interaction. The user has to click on the app icon, on push notifications, on a custom link. May be there are other ways I am not aware of, but even if they exist, they require user interaction to intentionally launch the app.
Edit
It turns out, as Tim mentioned, there might be an exception for VOIP apps.
I have been developing VoIP apps and I can confirm that VoIP app will autostart when iPhone reboots as long as user doesn't kill it before reboot. When iOS autostart voip app only application:didFinishLaunchingWithOptions: will be run, i.e. applicationDidBecomeActive: won't be run.
I used to doubt whether iOS will automatically restart the voip app when it crashes. After investigating I find iOS does automatically restart the voip app but if it keeps crashing iOS will then try servals time before it finally gives up.
If you check iPhone console output from xcode, you can see logs like these after the first crash
..
Service exited due to signal: Abort trap: xxx
Unable to get short BSD proc info for xxxx: No such process
Application 'UIKitApplication:xxxxx]' crashed.
...
Significant location change or region monitoring also causes an app to launch on boot as long as its turned on and left on. No UIBackgroundModes key is necessary for this.

Push notification flag in Settings

When a app has a push notification feature implemented at what point in time do we see the app name under Settings-->Notifications for enabling/disabling notifications?
Is it when you install the app and IOS will automatically come to know this or we need to run the app at-least once to see this option.
I am seeing two different cases: When I install the app on my iPod touch I immediately see the Push notification enabling switch in Settings but when I install it on my iPhone it do not show this option even after running the app. What could be the reason?
It shows when you register the app for push notifications in code. The reason it is showing up for you as soon as you install it on one of your devices is that you have already accepted it on a previous install of the same app, and uninstalling/reinstalling unfortunately does not cause iOS to forget this.

iPhone Push Notification Problem with Ad Hoc Provision

The iPhone i'm developing with (building the application to, not installed via ad-hoc) receives push notifications as it should. I've got an application that just sends dummy push notifications on command, and the dev iphone receives them consistently. However, I've distributed a beta build under the release configuration to several co-workers, and none of these builds of the app have received a single push notification. I've confirmed that the app prompts the user on first run for permission to receive push notifications, and I've also confirmed that everyone has answered "yes" to this prompt. Has anyone else experienced this problem? I feel like it has something to do with provisioning, but the apple developer portal is so vague about things, I very well could be missing something important.
Looks like I missed the part in apples push documentation where it states that apps distributed via ad-hoc use the apple production push gateway, not the apple dev push gateway. I was under the assumption that while developing the application, I always wanted to use the "development" push gateway...but that's what I get for using common sense.