Lock Screen UI with incoming Call - ios

I am working on a video/audio call app. Now when my phone is locked and another user is calling me then from the lock screen I will get a notification and if I swipe the notification then the call automatically received. I used UILocalNotification for getting notification.
But I don't want like this. I want to see the UI same as when another user call me when my phone is unlocked that is there will be receive/reject option with my UI. I want to receive call like Viber or skype. How can I do that?

You should be looking into the PushKit framework form Apple.
The PushKit framework provides the classes for your iOS apps to
receive VoIP pushes from remote servers. VoIP pushes provide the
functionality that VoIP apps need to perform on-demand processing of
the push before displaying a notification to the user.
Apple Documentation
There are some tutorials might help you.
Tutorial 1
Tutorial 2
Update
To display the system-calling UI for your app's VoIP services you can use CallKit.
CallKit documentation
Sample code from Apple
Here is a tutorial which explains it well.
http://www.techjini.com/blog/enhance-voip-app-user-experience-using-pushkit-callkit/
https://www.raywenderlich.com/150015/callkit-tutorial-ios

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.

Handle the remote notification for chat application in iOS

BACKGROUND
I am buidling a chat messaging applicaiton and I faced a problem handling push notificaton when user receiving message from the sender.
WHAT I WANT TO ACHIEVE
Like Whatsapp does, after I received the push notification and I turned on the airplane mode, I still can see the message contents while I open the app. so, I believe it has gotten the message while receiving the notification.
PROBLEM
I cannot find a good way to handle the remote chat message push notification when the user opens the app through its icon on the home screen instead of pressing or doing another action on the notification.
WHAT I TRIED
I manually loaded the message when the app did apear, but this is not like the tested behavior on Whatsapp.
I tried this third party socket library, but iOS killed the listening service once the app was closed, it is not applicable to what I want to build.
MY QUESTION
If still using the push notification or background mode remote notification, is that any way to able to handle the push notification when the app is not running?
I also find out about the Apple PushKit, I not sure if this is only allowed for VoIP providing apps. Does anyone know if Apple will accept my app to be published to their AppStore if I use the PushKit for only text messaging?
The untimate question, how can Whatsapp achieve this? Does it use PushKit as well?
Actually you can't handle something when your app is killed, so simple solution for you problem is to store all push notifications data in server , get it from server when you run app, and delete them once you got them. I think Whatsapp handle this in same way.
Just search about XMPP server, for live chat there is no need for Pushkit, Pushkit is only for Video call notification when app is terminated.
Use XMPP server for live chat integration.
https://code.tutsplus.com/tutorials/building-a-jabber-client-for-ios-xmpp-setup--mobile-7190
What is XMPP, and how can I use it within an iOS chat application?

Will Apple reject my app if i use VOIP Capability in chat app(WhatsApp like application)

We are developing a chat application like WhatsApp. It's XMPP based application, the XMPP complaint servers are follows push model for sending the messages, presence..etc.
So when user is offline the messages goes into offline stack and pushes again once user comes into online.
We want know that when app is killed , Can we use voip capabilities to run in background? or we really need go push notification model?
Please help Me .
You cannot add VOIP for chat application but there are other background task execution options by which you can achieve this.
Modify your server side piece send notifications to the app at reasonable time intervals if user if not online and your app will get opportunity to execute in background when these notifications are delivered.
Yes Apple will reject your app if you use VOIP Capability in chat app(WhatsApp like application)
if are you trying to use in background with help of VOIP but you primary not implemented VOIP functionality then apple will reject your app i tried before this for my streaming music player.

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?

waking up ios applications without using ios notification

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.

Resources