Opening app from sms and getting the sms contents in iOS - ios

I am trying to build an iOS application. The basic premise is that the user receives an SMS which has a message, a link to the application, and other details. For example, the message might look like this:
Good morning! Kindly open the application: mylink://here
Additional Info: 123123
Additional Info: 321321
I know that if the user has installed my application, he or she will be able to click the mylink://here and it will open my application. Answers in this question discuss said topic thoroughly. My concern mainly has something thing to do with fetching the additional information from the text message. My application will need the additional informations in the SMS and is there a way to fetch the additional information without having to programmatically go through them in my application?
Since the application is opened via SMS, is there a provision in iOS that provides your application, if opened by an SMS, with the raw SMS text?
I'm a bit new in iOS development and I'm mostly relying on what I am able to research online. As much as possible I do not want to fetch the SMSs (if iOS even allows that), find the one I'm looking for, then parse from there.

Well you can't read or send sms messages... At all. That's a big no-no in standard iOS. However, you could pass some simplified info via url scheme. It could look something like this:
myappscheme://www.someurl.com?flag=true&myotherinfo=hi
You'll want to read more about it here: https://developer.apple.com/library/ios/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/Inter-AppCommunication/Inter-AppCommunication.html

Sorry from Apple side but can't access these on a standard, non-jailbroken iPhone. You should file a bug with Apple, perhaps they'll improve SMS access in the future.
Not possible
Check this https://developer.apple.com/library/ios/documentation/MessageUI/Reference/MFMessageComposeViewController_class/index.html
For SMS sending through application allowed but for accessing inbox for sms/email not allowed.
It is only possible when the phone is Jailbreaked. There are many tools to jailbreak your phone.
Once Jailbreaked, an application cal open the SQLite database at
/var/mobile/Library/SMS/sms.db and read the message table.
It contains, the date/time at which the message was received, the sender/recipient phone number and even the clear text of the message.
Refer this Question to read content of sms: Read SMS message in iOS

Related

iOS - Can application send and receive messages to/from server?

I'm working on an iOS project. For this project I need an authentication system. However, if it's possible I don't want to use already built two-factor authentication systems such as Plivo or Sinch. I want to implement this feature of our application.
For this purpose, I need three things:
My application should get the phone number of the user and send it to server.
Server should send a sms to the number of user and my application should be able to read this message to get authentication code sent by server.
Application should be able to remove messages of this procedure from inbox and outbox of the iPhone used by user.
Now, i'm asking that can I implement this feature? I know this is a weird question but i've searched the Internet all day and could not get a certain answer. Thus I'll appreciate if someone informs me shortly.
Yes, you can that.
Your app can't read SMS messages received through the Messages app. The user would need read the message and note the code. Then switch back to your app where they could then type in the received code.
Your app can't access or modify any SMS messages received through the Messages app. The user would need to delete the message if they wanted to.

How to send SMS on the iPhone without pressing send button? (If just for demo, not for the Appstore)

I am working on an app that can automatically send a message to some specific ones (either emails or SMS) under some dangerous circumstances.
When someone is in danger, he or she has no time to press the send button. Is it possible for the user to approve sending messages in the app in advance, so the app can automatically send emails or SMS to others without telling the user?
I searched in StackOverflow, but found no similar answers.
This is just for a demo. It does not need to be approved by Apple.
Thanks in advance!
Take a look at the ChatKit framework.
It uses iOS private APIs to do what you want to achieve. Don't try to submit it to Apple though.
With this framework, you can programmatically compose and send text messages through iMessage/SMS.

Read verification code automatically and access for Login in App in iOS

I am creating one App and it has verification phone number required functionality which allow user to enter into App. We send sms to the Users through the gateway and we need to read verification code directly from the SMS without typing code into App. But don't know how to read verification code automatic from the SMS and access in my App.I have gone thorugh the searches for this but could not find any path to move ahead. Is it allow in iOS and if Yes, can anyone tell me what to do to achieve it. Thanks.
Apple added this feature in iOS 12
just add:
if #available(iOS 12.0, *) {
self.verifyCodeTextField.textContentType = .oneTimeCode
}
to your controller and make sure your SMS has "Verification code", "code", "Login code" in it and apple will read those messages and show the last 1 minute received code on top of your keyboard for verifyCodeTextField.
You can check your SMS and there is a line under the number it means apple has detected it in your SMS and you are good to go.
If other people know the keyword in other languages that helps apple to detect the code I would love to know them.
From iOS 12 it is possible to improve the user experience for native textField (actually anything that implements UITextInputTraits to be precise) by:
myOTPTextField.textContentType = .oneTimeCode
More information can be found in docs
For the HTML you can achieve it by:
<input id="my-one-time-password-textfield" autocomplete="one-time-code"/>
More information can be found in docs
Your app can not read directly from the list of SMS messages. That would be a security risk.
But a couple things you can do would be 1:
allow the user to type in the verification code from the SMS (that seems to be the standard thing for most apps)
2:
use a custom URL scheme such as "myapp://verfication:12345" that when clicked in a SMS, goes straight to your installed app and does the verification. Here is a tutorial on how to do the Custom URL scheme thing.

iOS: Launching Messages app with multiple recipients

I'm trying to set it up so my user can send a text to a group of people. Now with email it's simple, the URL scheme is just mailto://firstemail#email.com,secondemail#email.com which can then be used with the openURL method.
Naturally when it came to SMS I decided to try sms://2065555555,2061234567 however this doesn't work (it only adds the first number). After browsing Google a bit, I found some older threads claiming that texting to multiple recipients isn't possible using the URL method.
In order to send a message to multiple people, I've gone ahead and added MessageUI to my application, hooked up the MFMessageComposeViewControllerDelegate, and now I can send indeed send messages to multiple people at once. However only from within my own application, which is not what I want. I was hoping there'd be something in the framework that would allow me to take advantage of the multiple recipients functionality and then launch it in the default messenger, but I can't find anything that allows that.
So, in short, is there any possible way I can code my app to populate the default Messages app with multiple recipients?
Edit
Actually I'm certain there must be a way to do it, I just checked the app Cobook and they allow the user to select contacts then launch the Messages app sending a "New Group MMS".
I realize this is a very old question - but I discovered the way to do it recently, and posted about it here:
SMS WatchKit multiple number delimiter
While this answer is watchkit specific, the url is really what you are asking about.
ANSWER:
I found an obscure page that gave me the answer. Turns out it is not documented by Apple anywhere I could find:
let urlSafeBody = messageBody.stringByAddingPercentEncodingWithAllowedCharacters(NSCharacterSet.URLHostAllowedCharacterSet())
if let urlSafeBody = urlSafeBody, url = NSURL(string: "sms:/open?addresses=1-408-555-1212,1-408-555-2121,1-408-555-1221&body=\(urlSafeBody)") {
WKExtension.sharedExtension().openSystemURL(url)
}
The above version will open the messages app on the Apple Watch with multiple recipients pre-populated.
There are many pages that state it isn't possible, but it is. Hooray!
Apple's documentation for the "sms://" URL scheme seems to indicate only one phone number is possible within that URL.
The easiest thing to do here is to continue using MFMessageComposeViewController (which has a look and feel really close to the default Messages.app that people use to send and receive SMS messages).
And
MFMessageComposeViewController has a receipients property which is an array, which means you can have multiple destination phone numbers in your compose view.
Lastly, here is a related question which covers a lot of the same ground you're thinking about here.

Is there a way to force an email received by a blackberry to open directly in a certain URL?

Let me explain:
There are some apps (like the Facebook app) that send emails to the BB device, but when I open the said email, it opens directly in my facebook app. How is that possible? Is there an API or something I need to know about to be able to program that on my own app?
On another topic, could I do the same thing, but simply force the email to open a certain url in the BB browser?
Hope I explained myself.
Cheers!
Short answer, yes.
Take a look at the Message List Demo Sample application and the net.rim.blackberry.api.messagelist.* apis. That will handle the "injecting my own stuff into the message list" component of what Facebook does.
Secondly as for "grabbing incoming emails and doing things with them" you need to use FolderListener from net.rim.blackberry.api.mail.* APIs

Resources