waking up ios applications without using ios notification - ios

Is it possible to wake up a background application with a non ios notification center? e.g. if I were creating a calling or messaging application is it possible to wake the application via SMS.

Nope. If you want to call app outside the device, you should use APNS. On the device you can use local notification. Sending SMS to wake up app is kinda wrong. People don't like such solutions - imagine bunch of SMS every day for different apps. Sorry.

No.
If you have background code running, you can schedule a local notification to yourself. If the user clicks "Ok" then you will come to the foreground. See here for a description and sample code.
As far as I can tell, the only ways to launch an app without user input is via a custom URL handler or via an accessory. It doesn't sound like an accessory fits your use case. Sadly you can't open URLs from the background, so you can't use this to wake yourself.

Related

Awake application without using VoIP when user killed iOS application

I am trying to develop whatsApp like calling feature in an application of mine.
For audio call, I am using VoIP to initialize the CallKit and it's working perfectly.
But I am not able to get Video call work just like whatsApp.
If I assume that whatsApp is delivering is VoIP and then showing local notification. But as per iOS 13 documentation, you have to report incoming call to CallKit if you are using VoIP.
And If I think of sending silent notification, it won't work if user killed the application manually.
I have thought of many solutions but none behaves like whatsApp does.
Can anyone help me with this? Any suggestion will be appreciated.
You can just use normal push notifications, they will always be delevered. Your server has to generate a push every n-seconds that tells the user that he has an incoming video call.

How continue doing iOS location tracking even after the app is killed?

I am having an issue trying to have an ongoing location tracking enabled when the following conditions are in place:
Background fetch is disabled
App is killed
When the above happens, location updates are stopped. I tried to have my server send push notifications to wake the app up but they do not arrive if the app is killed.
What is puzzling is that a similar functionality seems to work just fine on WhatsApp (the live location). On WhatsApp, even if I disable background fetch and kill the app, it somehow manages to wake it up again to send updated location information.
Does anyone have any idea on what they are doing?
It seems WhatsApp could be using PushKit to get around this problem. According to this question:
WhatsApp could be using VOIP background mode along with PushKit for
solving this problem.
Voip pushes are:
delivered directly to the app.
considered high-priority notifications and are delivered without delay.
delivered even if the app was force-quit by the user.
I have also created a quick sample app to try this and it works like a charm. However, again according to the question linked, Apple doesn't really allow this solution:
Apple no longer allows the usage of the API for push notifications of non-VOIP apps. They do however allow WhatsApp to do it in their infinite fairness.
Use significant-change location services. It will work even the app is terminated.

how it works whatsapp

How does Whatsapp continue to receive notifications of received messages, even after you kill the app or restart the phone?
I am using an application that sends location coordinates, and it's for iOS, written in Swift.
My problem is that when I kill the app, the application stops sending coordinates. How I can make it restart automatically? For example, Whastapp, despite killing the app, if someone sends me a message, I receive the notification
I have also tried creating a widget app, but this is activated only when under the bar where the widget exists.
WhatsApp continues receiving PushNotifications. These are sent by Web Server and the App need not be active for it.
Coming to your requirement, you can use options like requestAlwaysAuthorization (to keep App awake in background to be able to send notifications). SignificantLocationChange, RegionMonitoringService, VisitService (to relaunch you app in the background if terminated).
Hope it helps.
Use this tutorial https://www.raywenderlich.com/123862/push-notifications-tutorial. you need to have one developer account to use push notification. It's easy to implement.

How to get system notifications in iOS

I want to get all the system notifications in my app and want to scheduling them. Is it possible in iOS ? Example - Suppose my mail app is on. When a email arrives, a notification appears there. I want to catch that notification in my app for scheduling either in foreground or background. How can i do it ? Please help. Thanks.
This is not possible. In iOS notifications are "owned" by an app. There is no way you can read the other apps notifications.
Moreover, as you probably know, iOS gives the user the ability to limit the types of notifications your app displays.

Custom push notification screen

I'm developing an iOS video chat application. I would like to display a notification like the FaceTime application does when someone calls me.
Currently I use push notifications that show banners, with a message and a custom sound.
Instead I want my app to show a custom screen for an incoming event like someone calling me for example. Is that possible using apple public API's ?
Please, see the FaceTime notification screen below.
Ps.: Skype also uses a different notification screen.
Thanks a lot,
Daniel
I doubt it has anything to do with push notifications, in fact Skype you are mentioning was able to do it before push notifications were available.
Instead iOS gives you some extra features if you create an app with background mode "voip" (voice over ip). This will allow the app to wake up and brought to the foreground once traffic is detected on the network sockets, and applicationWillEnterForeground: is called. And from there you can use any view controller.
If you now think «hmm, my app doesn't offer voip, but I will pretend to do so to get superior notifications» — don't try it, apple will reject any app claims to be a voip app just to get endless background time.
No, push notification dialog is a system dialog which cannot be customized. However FaceTime is Apple's application and they can customize it the way they want, not open to third party developers.
However you can take advantage of iOS 8.0 addition "UIMutableUserNotificationCategory" to customize the actions in the notification:
https://developer.apple.com/library/prerelease/ios/documentation/UIKit/Reference/UIMutableUserNotificationCategory_class/index.html
Example tutorial:
http://www.thinkandbuild.it/interactive-notifications-with-notification-actions/
I'm not sure how they did it, but Skype managed to get a customized notification when a User receives a call both while the device is locked and while in use.
http://blogs.skype.com/2014/09/22/skype-5-5-for-iphone-answer-skype-calls-in-an-instant/
EDIT: Looks like IOS8 added an Interactive Notifications API. This is likely your next question: How do I make interactive notifications in iOS 8 app?

Resources