Objective C - Adding contacts to send SMS/Email - ios

I'm trying to create a custom sms/email sending view (I don't think i can use the regular SMS/Email API's since i'm planning on calling a server to send these emails and sms messages - meaning no instant sending so apple's api won't do).
The issue i'm facing:
Using the contacts bar the way apple uses it - writing a list of all the contacts needed in a way which makes the bar a "dynamic" contacts bar, which allows the user to add with completion or a "+" button which opens a people image picker view, and change the size of the bar in a very unique and nice way for each contact added.
I saw this stackoverflow question, but the project is archived and not relevant any more i guess.
IS there any source which has already implemented this? or should i face the fact i will have to implement it from scratch?

Related

How to check if there is new data in API response?

Im creating two types of functionalities in my app, live status update for my order and social media integration too. I would like to know how to update data for these 2 situations as I want my UI to change automatically when there is change in API response. I have made them work but I'm not sure my approach is correct.
These are few situations I'm confused with:
I have to track my order using some status codes from 0 to 9 coming in API response and update UI based on status code, like for 0, say order received, for 1, order confirmed and so on.
Right now I'm using timer to keep calling api again and again to check if there is any change in status in API response and reload tableview if there is.
I have opened all user posts page and first post on the screen is a post posted by me, and if someone likes my post on other device, is there any way to change likes count on my device without refreshing the page again?
Again im using timer to call API and if there is new data, I reload my UITableView.
This is I got covered but just want clarity. In my social media post, if I click a post it opens CommentViewController showing comments, and if I click any comment then it opens RepliesViewController for all the replies and from any UIViewController you can tap userImage and open their profile. So if I like any post/comment/reply, im using delegates to make changes in other view controllers, so if I like a post in their profile, using delegates I'm adding like to post in HomePage for same postId but this approach increases number of delegates by a lot. It works fine but is there any way to tackle this situation with live updating API too like above two situations?
recently I worked with a Socket based chat app and it was easy to handle any live updates but is there any other way to get same functionality with my API's especially for that tracking feature?

Swift get OneTimePassword (OTP) in class

I’ve read about how to achieve this using Storyboards and UI text elements and it seems to be pretty straightforward, however, I am building a hybrid app so I need to intercept this OTP in the controller and feed it to another event listener which will pass it to my app, so in this scenario I cannot make use of ios text input fields etc but surely there is a way to hook into the devices capability to recieve and parse it’s value ?
You can't parse security code. It only works this way:
If the system can parse a security code from an SMS message, the
QuickType bar shows the code for up to three minutes after it has been
received. If a security code arrives while the text input view is
selected, the system pushes the incoming code to the QuickType bar.
Reference: Swift Docs
UPD: You can access code once it pasted in UITextField

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.

How can I intercept text messages using cocoa

I intend on writing an app for iOS that would require me to monitor incoming texts from select contacts etc - in short, I need to somehow get the strings from a text message into my app directly. Is anyone able to point me in the right direction here?
Apple doesn't provides any SDK (and doesn't allows developers) to access on the messages.
You can just access to the screen New Message from the app.

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.

Resources