Is it possible to have a "notification only" app, or NOT show the watch app after a notification is displayed? - ios

The iOS app I'm working on for a client currently only uses Apple Watch for notifications.
When a local notification fires while the user's phone is locked, it displays the notification on the phone. The user can dismiss the notification or click on one of the action buttons on it.
In either case, I want to dismiss the watch app and go back to whatever state it was in (back to the watch desktop, or springboard, or whatever it's called.) I don't want to present the UI for the watch app, since there isn't one, at least not yet. I don't know if my client is going to define a watch app UI or not.
As it is now, once the user clicks the dismiss button or an action button on the notification, the user is left with a stupid-looking placeholder watch app that simply has a button called "button" (which I added for testing.)

I'm afraid that you cannot change this. iOS decides which device the notification is shown on and you have no control over this.
If the iPhone is locked then iOS assumes that you are using your watch and will deliver the notification to it, however if your iPhone is unlocked it tends to deliver to notification to the iPhone.

Related

how to hide close button in iOS notification on apple watch

we're sending critical alerts to the user by remote notification. Users with an apple watch recieve those notifications at their watch display. at the bottom of the notification at the apple watch display, there is a "close" button displayed. If the user hits this close button, the notification seems to be purged by the os and the iphone app has no change to get the notification anymore.
As there is some data transported within the APNS Payload, this data is lost for the app.
We didn't do anything special for apple watch (like a watch app), we only deploy an ios app.
What is the preferred way to
a.) remove the close button in apple watch notification
b.) have the app to be able to access the notification payload if the user hits "close".
Any help appreciated

Is there a way to suggest user to unlock the device when receiving a video call?

I'm receiving an incoming video-call (the app is in background), displaying system UI. When I slide to answer - call starts and there's a button to open the app. Can I somehow programmatically press this button on answering or suggest user to unlock his device without tapping app button?
Without use of a 3rd party API or a jailbroken iPhone, this is not possible. However, it would be possible to send a notification to the user to unlock their device.

Localnotification with background mode, Without click on notification open an UIAlertView

When my app is notify by local notification then without click on notification i want to open an UIAlertView. Is this possible for IOS?
I am attaching screenshot for detail understanding.
With iOS8 you can display actions for the user to choose from in the form of buttons. These buttons can launch your app in the background to perform some task or they can launch your app into the foreground as you can do with the notifications available in older versions of iOS.
You can't, however, display a UITextField for the user to enter data.

How to bring application to foreground in ios?

I am detecting for iBeacon in background. When my device comes in a particular region application should comes to foreground.
It cannot be done without user interaction. The only option is you can generate a push notification to tell the user to bring the application to foreground.
This is from the Apple documentation about this issue:
When the operating system delivers push notification (iOS or OS X)
and the target application is not running in the foreground, it
presents the notification (alert, icon badge number, sound). If there
is a notification alert and the user taps or clicks the action button
(or moves the action slider), the application launches and calls a
method to pass in the local-notification object or remote-notification
payload. If the application is running in the foreground when the
notification is delivered, the application delegate receives a local
or push notification.
To answer to some comments about WhatsApp, with it, when you receive a classic vocal call, IOS use CallKit to display your call and wake up your phone, but it's not inside app. I try to make a video call with WhatsApp, and in this case, there is a notification. Press notification open app and answer to the call.
Conclusion : It's impossible to wake up app from background to foreground in IOS, but it's not really a problem because you can use notification to display what you want and get the user to your app after a touch on your notification. All of iPhone users are familiar with this kind of interaction, it's better to deal with it.

detect why iOS app went into background, hardware home or incoming push notification

I want my app to behave differently if the user pushes hardware home button, versus other reasons it may go into background. I think I have sorted out the main cases, except I can't tell the difference between user tapping on incoming push notification from another app and hitting the hardware home. In iOS 5, I was getting an applicationWillResignActive when the notify first appeared, and then applicationDidEnterBackground when the user tapped. In iOS 6, I cannot find any event triggered by the appearance of a banner notification from another app. The applicationWillResignActive and applicationDidEnterBackground come back to back, just as in hitting hardware home. I tried listening to UIWindowDidBecomeVisibleNotification and other UIWindow notification, but nothing is fired. Any ideas?

Resources