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

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.

Related

Firebase Cloud Messaging - Send message to all users

I'm new using the Firebase Cloud Message. I built an IOS app to receive push notifications. The app works fine. I send messages from the Firebase console and they're displayed correctly.
Now I`m trying to build an web api to allow my customer to send the push messages (without accessing the firebase console). Studying the documentation here I realized that I've always to have a "to", meaning a group, topic or device id.
My question is: can I send a message to all devices (like I can do in the console)? I yes, how so?
Thanks in advance!
You can make use of topics. Given that all of your users are subscribed to a specific one. Just like what I mentioned here (removed some parts, just check them out if you want):
If you are looking for a payload parameter to specify that you intend the message for all your users, unfortunately, it doesn't exist.
Commonly, when sending notifications to multiple users, you can make use of the registration_ids parameter instead of to. However, it only has a maximum of 1000 registration tokens allowed. If you intend to use this, you can make batch requests of 1000 registration tokens each, iterating over all the registration tokens you've stored in your app server.
However, do keep in mind that Diagnostics for messages sent to Topics are not supported.
I found this:
!('TopicA' in topics)
With this expression, any app instances that are not subscribed to
TopicA, including app instances that are not subscribed to any topic,
receive the message.
So you could probably use
condition="!('nonExistingTopic' in topics)"

Opening app from sms and getting the sms contents in 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

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.

iOS - how to receive bug reports via email from a device without mail client set up?

I will have an app deployed to business iPads that would be given to customers and typically would not have a mail client set up. I would like to collect debug information from the app and have the user be able to send it, so I can receive it via email.
How can I receive email with bug reports from an app that does not have a native mail client set up? That is I cannot present a mail composer, because it is not configured and cannot send mail.
One way I'm thinking of is to create my own web service that will process a data packet and email it, but what other options do I have?
I would recommend two different services.
Crashlytics is a service that I started using recently. It tracks usage in the app automatically, and allows you to view it online (monthly users, device, OS, etc.). However, the most useful feature IMO is that it sends you an email if and when your app crashes, along with the crash report and the exact line it crashed on.
SendGrid is another option if you're looking to send yourself customized debug data. Basically, you can send emails in the background of your app without the user knowing. If you're looking to send automated emails in the background, this is the way to go.
I have used both in my own applications, and both have been very helpful in their respective ways.

Send a code to Varification Code by sms to user using my iphone

I am working on a application in which I have verify a users number.I will get the user's permission to send message from MFMessageComposeViewController.But I want to hide the code that I am sending in the message body from the user.I read that I can't send message from the
iPhone without showing MFMessageComposeViewController. And Apple will reject my application if i will use any third party framework for that.So what can i do to get my work done.Can any one guid me with that.Any help is welcome.Thanks in advance
Thanks
Happy Coding
There is no alternative method of sending an SMS on a non jailbroken phone.
Is the SMS method of sending critical? Otherwise - I would consider a behind the scenes webservice using HTTPS.

Resources