How can you use a button to send a vibrational pattern to another iOS device in swift? - ios

The user enters another user's phone number. If both people are inside the app simultaneously, each user can tap a big button which makes the other person's device vibrate simultaneously. How can I make the button make the other person's iOS device vibrate?

You need to establish some line of communication between the two devices. This is a very vague question, in general, but to get immediate vibration, you'll want some server communicating over a socket with both devices. If one device presses the button, it tells the server to vibrate the other device. The server then tells the other device to vibrate.

Related

swift: How to make a call when phone is locked or app in background

I have implemented Agora call in iOS app which works perfectly fine when app is in foreground ... Actually in my case we initiate call through Bluetooth BLE iBeacon. Along with this we call an API which is also working fine.
Problem is when app in background or when phone is locked ... Even when app is in background, app listens bluetooth event and Call API but it never start Agora call until we bring app to foreground. Means call works in foreground or it waits to start call when app enter in foreground.
To handle this I implemented local notification to prompt user to tap notification and bring app to foreground. But we want to do it through Bluetooth iBeacon. That instead of user to tap notification, it press beacon button to bring app in foreground and start call. On beacon button press I can catch the event in background as well but unable to bring the app to foreground.
Could not find some solution of it. But seems like its do-able as with Car tablets which are connected with bluetooth to phone we can dial a number on tablet and through bluetooth communication with phone it makes a call to selected or dial number even when phone is locked.
Means third party bluetooth devices can send command to locked phone and initiate call.
There are two ways using that you can make calls when app is in background or in locked state even your app is in killed state.
Using CallKit Framework provided by apple.
You can send custom push notification to the user and on click of push notification application is wake up and call is happen.

How to detect non-intrusive phone call

In iOS 14 you can now accept phone calls that do not take up the entire screen (the new non-intrusive phone call UI looks like a push notification). If you accept the call, but do not open up the full screen call UI, the app remains open. This is true even if you pick up the phone and put it to your ear the app remains active.
What would the best way be to detect an incoming call, or that the user began the call?
You can’t detect it. If the user just takes the call direct from the banner, your app remains active and there is nothing to detect. That is the whole point of this feature: a call need not interrupt your app in any way.

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.

BLE CoreBluetooth in Background, what I am authorized to do?

I've designed a very simple wearable BLE device with one physical button. This device has a UART Service and can notify a connected device when the value change (when the button is pressed).
My goal: The smartphone must be able to send an HTTP request in background every time the button is pressed. even when the app is not running.
For this need, I have to implement the iOS Bluetooth background process with CoreBluetooth. But before, i would like to know if CoreBluetooth can meet my need.
So my questions are:
Is it technically possible to keep a long-term background connection between Smartphone and BLE device, even if the Smartphone reboot.
Can I wake up or start my app in foreground (without notification) when the BLE device button is pressed.
And if the previous statement is not possible, can I execute a very basic HTTP request in background when the user press the button ?
Thank you for your help!

How can I recognize a tap onto the back of a phone when it is in a pocket on the lockscreen?

I want to be able to recognize a double tap on the phone when it is in the users pocket. I know sleep cycle has a feature like this for snooze. Is this possible to implement while the phone is locked? Can apps still receive accelerometer data when locked? I don't know how else one would code this besides using the accelerometer.

Resources