IOS How do I use a button send a message? - ios

I set a button, it jump to make a phone call view while be clicked!Now I set another button send a message while be clicked. How to make it just stay in APP view rather than jump to the phone send message view.

Phone calls cannot be made from within an app. You can only redirect the user using a telephone number URL.

This isn't possible without delving into private frameworks.

Related

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.

How does iMessage preserve viewController state after view disappears?

I observed that iMessage preserves last typed message in a chat even if I move to another chat and come back to it.
For eg. I am in Chat1 and typing. Then without sending the message I move to Chat2 and then come back to Chat1. Last typed message is still there.
If I understand correctly, when I press back button in Chat1, it should execute viewWillDisappear which should destroy all local elements.
Then how is last typed message still there?
iMessage is not the only app which does it. Whatsapp also does it. Even you open a chat in whatsapp scroll to older message->go back->and come again on the same chat. You will see the old state of chat.
The Recommended way to do it is App State Restoration if you want to store the whole state of your controller with more UI elements and values.
You can check following tutorial available for this..
https://www.raywenderlich.com/117471/state-restoration-tutorial
http://useyourloaf.com/blog/state-preservation-and-restoration/

Can you programmatically send iMessage/SMS without having to press the green up-arrow in iMessage?

I am trying to figure out if it's possible to send an iMessage/SMS without having the user press the green up-arrow to SEND. Is it possible to have an iMessage/SMS just be sent?
As far as I have tried, no.
I can only go as far as setting recipient and content of the message so the user only need to hit the send button to complete the action.

Detecting Bluetooth Keyboard in iPad App

In my app I am having a customer info form on which there are a number of text fields I have used, now when a user edits any field I need to move whole view up so that the editing text field won't get under iPad's internal keyboard and this is working fine.
Now the client wants to use external Bluetooth keyboard for filling this form. Once this external keyboard is connected with iPad then in the app when editing any text field won't show internal keyboard as the external is connected and in this case whole view needs to be on the page and no need to move it up.
But when I edit text field it still goes up without showing internal keyboard on the screen and this leaves half of the screen blank as it moves whole view up.
For this I have tried some ways like enabling internal keyboard show/hide notifications but these notification only gets called when external keyboard is not connected and this is not helping me.
Also have tried with ExternalAccessory framework, but it wont detect the bluetooth connected keyboard also tried with EADemo to detect external keyboard and its not detecting external keyboard but it detects credit card swiper connected trough dock.
If anyone here has gone through this functionality or knows anything related with this, then please let me know.
#SpySudhir --
Logic A:
have a bool variable in some file which will return yes/no value when the keyboard is external or internal.
On the basis of the bool value returned call the animation function.
Logic B:
Listen to the keyboard notification using NSNotificationCenter.
Notifications like will,show,hide notification put an NSLog over their and see which one of them is getting called.
If external board is connected the willShow method does not gets called. so in this case can we can do some work around and set the bool value to no or we can have a counter and check it every time if its value is increased by one or is same something like this.
You should not move the view up when field gets focus - you should only move the view up as a response to a UIKeyboardDidShowNotification. The system takes care of the rest for you.

IOS web view handling phone numbers

I am using UIWebView to show some data.
UIWebView is detecting phone numbers, which is fine, but when the user clicks on the phone number it is trying to fire a call directly.
Is there any way I can show an confirm message after a user clicks on a phone number, to allow the user to confirm they would like to place a call to this number?
Did you try to putting a breakpoint in shouldStartLoadWithRequest delegate method of UIWebview ? You might be able to catch the event click there.
There is no part of UIWebView that allows you to know when a phone number has been clicked. You will either have to turn of phone number detection or detect phone numbers yourself and convert them to links manually, so will have control over what happens when you click them.

Resources