According to the docs, sending sendMessage
from the WatchKit app will wake the iPhone app if it is inactive.
I would like to know the differences between such a wakeup app startup and a normal one. Surely a background process has a lot of differences to a normal foreground app. However, I could not find a thorough documentation on the subject.
Here's what I found so far:
didFinishLaunchingWithOptions
to receive a special launchOptions
key. After all, the user did not start the app on the home screen, so there should be an indication in launchOptions
. But when I tried it out, launchOptions
was nil
. Doesn't that contradict the docs?[UIScreen mainScreen]
might be nil
. But there seems to be no difference in mainScreen
in the background process. In my AppDelegate.m
, the code that creates the main window seems to run exactly the same way as in the foreground process.AppDelegate.m
seemed to run exactly the same way, regardless of background or foreground process. However, the whole Javascript part of the app did not run (which is kind of expected, because in a background process, we do not need any React UI). But there must be a difference in the process that causes the Javascript part to not run.Please don't consider this question to be about "more than one question". The question of this post is quite clear: I want to know all the differences between a didReceiveMessage
background process and a normal one. In the enumeration above, I just listed all the differences I would expect or that I have encountered so far, and the lack of documentation on those topics.
I think the background mode is just a UIKit
concept. The app is started (thanks to the UIApplicationMain function) as a regular one but your app UI is not rendered.
It is just a warning: this is a transition state, your app can be suspended at any moment, be concise. The documentation is clear.
Regular UIKit
APIs are available (if it was not the case, imagine all the potential crashs). But you won't receive any external events like touches.
Some external tasks like asking permissions, launching audio sessions etc would probably not be available too.
You can wait for the app to be launched by using the wait for the executable to be launched
option in the scheme panel.