Xamarin forms messaging plugin - ios

I've just tested the "new" Xamarin forms cross platform plugin. It works as it should and you get navigation to the phones messaging app when you are about to send a message. As I could read it is restricted by the OS to not let you send sms from within the app directly, is this the same if you go all native to the NS api on iOS? A solution if you don't want to have the sms app enabled is to have a backend/api, but then it also requires more than just the app and a separate sms gateway. So my question is to know if there is a custom workaround to just send a sms if the user allowed it, directly from the app?

In Android, you can use SmsManager class to send an Sms. There is an example in Xamarin's Documentation on how to do it.You need to add SEND_SMS permission. Here is the code snippet from the site
SmsManager.Default.SendTextMessage ("1234567890", null,"Hello from Xamarin.Android", null, null);
iOS does not allow us to Send an sms directly using an API alone. This is a restriction imposed by Apple. Recommended approach is use the default application installed in the iPhone. Best approach we can take to send message from within the App is to use the MFMessageComposeViewController class. With this we can present a UI (provided by iOS) within the App in which user can populate "Body" and "Recipient" fields and send Sms.
This blog post has an example of how to use MFMessageComposeViewController in Xamarin

Starting from iOS 4 you can use MFMessageComposeViewController which shows interface for sending sms messages inside your app. You can use PhoneService class from Xamarin-Forms-Labs project or Xamarin.Plugins pcl library.
These projects also provide the same functionality for sending sms messages in Android.

Related

How to send a text inside an iOS app?

Is it possible to send a text immediately inside an app. I have implemented the sms send. I just want to bypass the screen where the user has to press send.
There is no way to bypass the MFMessageViewController screen where the user has to tap "send." I assume Apple has designed it this way to prevent an app from potentially spamming a user's contact list.
In addition, there is no way to detect income SMS. Both these features are strictly reserved for the native Messages app.
For more information on sending an SMS on iOS check this out.
One alternative is to implement sending and receiving messages within your app using a web service to store and retrieve messages. For example, you could use a messages library like JSQMessagesViewController documented here and for simplicity's sake, you could use a BaaS like Parse.

Is there any Incoming SMS Broadcast Receiver like Receiver in iOS

I need to verify account using reading sms and then matching the verify code.
Android have such functionality like :
where they can read sms and check a particular value.
Need to verify account using text messages without open the text message like in Whatsapp used in Android.
Is there any NSNotification Center etc in iOS to serve this task?
There is no way to do this on iOS, since your app does not have acces to the incoming text messages.
Also it is disallowed by the AppStore review guidelines due too privacy concerns.
You can get OTP from your message.
otptextField.textContentType = .oneTimeCode
Can please get the project from his link.
https://github.com/karthickkck315/Automatic-OTP

How Can We Read Incoming SMS by using Application in iOS

In my application I am able to send an SMS programatically to a particular mobile number when the user clicks submit button. Then there is a response message from that mobile number now I want to read that message and populate that SMS text in to my application.
I searched for this and found that this is not possible in iOS.
My question is there any possibility accessing inbox SMS with user permissions?
Simply two words from Apple:
Not Possible
Detailed:
An iOS app can only access the data for which Apple supplies a documented public API. iOS can not access outside of the sandbox until Apple provides a public API for it. So intercepting/reading an incoming SMS not possible. And no idea when the iOS device is jailbroken.
No it's not possible in iOS, it's possible on jailbroken devices but you can not place your application in the App Store.
You can't read SMS, but you can auto fill a text field from SMS.
From Apple Documentation :
To ensure your text input view displays the right AutoFill
suggestions, set the textContentType property on any relevant input
views.
so you can do the following :
textField.textContentType = .oneTimeCode
More info :
check the link here

Perform some action depending upon the text in the inbox of iPhone

I am having a message in iPhone inbox. I want to send that message to a small app which in my iPhone to do some particular task.
Can some one suggest me , Whether it is possible to send that SMS to our application development.
Thanks.
Unfortunately is not possible handle sms at SDK level.
If you manage the send of sms you can add a link into it and, using a custom url scheme, passing data to your app.

Exchange data between iOS apps

I know about x-callback-url, and how it's possible to e.g. send a string to an app in iOS.
But is it possible to do this the other way around, e.g is it possible for an iOS app to fetch the song currently playing in Music.app? Can an app fetch a message with a specific caller ID from Messages.app?
I believe, you need to have access to their API/backend to do that. Talking directly to another iOS app is not possible.
No, I'm not a crook ;) I want my app to read the content of an SMS that my gateway has sent, for device authorization.
register a scheme for your app. add a link with that scheme in your sms, with the registration code as uri-path. by clicking that should open your app and you can process the uri.

Resources