Check is phone registered in iMessage - imessage

I need to make a script that will check the phone numbers in the downloaded txt file for their presence in imessage. If there is such a number, then send it to the white list in txt format, if not, then send it to the txt blacklist. After checking all the numbers, make it possible to save two lists. I can pay for the work.
I am a novice programmer. I can't complete the task. I ask for help

Related

Deeplink iOS Calendar

Trying to share a calendar event over SMS. The text contains the datetime of the event, which iOS picks up as a link, which opens iCal (Create Event, Create Reminder, Show in Calendar, Copy Event).
When a user taps "Create Event" - it just creates an empty cal event for the datetime. Is there a way to auto-fill the event with details when the users taps "Create Event"? Perhaps through deeplinking a URL or similar?
The behaviour you describe is iphone ios doing some natural language processing and recognising that 'hey that looks like a date or time and location'. When you click on the text, it will offer to create the event but one still has to fill in the rest of the details. It is not yet clever enough to work out the Event subject, and may not be that good at it if it tried.
There is a term 'Rich Media Messaging'(RMM) which aims to get past the limitations of the basic sms (short message system). This is hard if one is looking for universal phone and phone provider support as not all phones do multi media messaging. RMM appears to basically be a combination of multi media messages and short links. So basically there is no 'markup' for simple text messaging.
The only reliable universally acceptable way to 'text' an event via sms, an event with full details that would be recognised by all smart phones is via a link to an ics file. As the standard SMS length is only 160 characters and most hyperlinks are pretty long (usually between 40 to 100 characters), they can eat up necessary space in your message. Unicode characters could use that up quicker, so a user friendly short link might be best.
The ics file has all the info to pass to the system:
the text/calendar mime type tells the system it's got events inside so pass the file to the calendar app
then the contents of the ics file inform the calendar app of all the bits of the event as per the RFC5545.
For demonstration, I texted the "5 May yoga" single event link from this page https://test.icalevents.com/agenda/ to a phone. That ics file only contains a single event.
When one clicks on the link in the text message, the smartphone does as described above and suggests to create an event. This method has the benefit that one could perhaps track the clicks to the short link.

Twilio Messaging - Correlating SID

We use twilio for sending message.
We are not sure how to correlate the response with the message we send. We might send multiple messages to the same Mobile. But, not sure how to correlate response with the messages we sent as the SID's are different.
Is there anyway to relate the response with the message.
Thanks
No, SMS doesn't work like that.
I you send me 5 text messages from your cellphone and then I reply to one you have no way of telling which one I'm replying to.
It's not a Twilio limitation, the SMS standard has no provision to track replies to individual messages
As an afterthought I came up with a hacky solution to this. It's a bit involved so I guess it depends how much you want the functionality.
This works for me using Chrome beta on Android 7.0, YMMV.
Create a php script with the following code and put it on your webserver:
<?php
// increase last digit as necessary to suit string length of your variable
$smsid = substr($_SERVER["QUERY_STRING"],0,1);
// Query database for SMS id, record timestamp of request, optionally return text to be included at the beginning of the SMS reply
$msg= urlencode($databaseResult);
// Remove <?body=$msg> if you just want the link to create a blank reply. Change the phone number to your incoming Twilio number.
header( "Location: sms:+1555444333?body=$msg" )
Now sign up for a URL shortening service which passes URL parameters and create a shortened URL which points to your php script. I used tr.im.
Depending upon your volume of SMS you will have to adjust the length of your variable, but unless you spam people to death I'm going to assume a single character will be enough to identify a unique text.
Using the example tr.im/SMS as your shortened url, you append a variable to the end like so tr.im/SMS?A and put the link in your outgoing SMS. When the user clicks the link your server redirect will open the SMS app on their phone and create a text to your number. If you have included the "?body=$msg" in your php above the new message will have your text at the start.
Personally I probably wouldn't bother adding text, they might delete it before they send it anyway and it's just likely to confuse people. If you log the request variables and timestamps to your database you should be able to tie them together with the phone number as most people will send you their reply within a couple of minutes of the server request. You can also increase the length of your custom URL variable if you struggle to correlate messages. Recycle variables once you have linked a reply etc...
Finally change your Twilio configuration so your outgoing SMS present the company name instead of your Twilio number as the sender. Users cannot directly reply to messages if the sender isn't a number, so they will have to use your link.
Generate a sequential identifier for each message and append it to your link. Save the identifier to your database along with the corresponding message Sid from Twilio and the number you sent it to so you can match them up later.
Append "Click tr.im/SMS?$ to reply" to outgoing SMS, where $ is your variable.
Profit.

How do I Generate a Text Message to a Predefined Phone Number in iOS 10?

Let's say I have the user of my app define a phone number in a setup step of my program, saved in the plist as a number with the key "PhoneNum". Now lets say that I want to have a button in the program which, when pressed, generates a text message that says "Hi! How are you today?" to the phone number saved under "PhoneNum". Is it possible to have this message auto-send without confirmation from the user? If so, can you point me in the right direction?
Yes, it's possible, if you pay for an SMS-sending service. Type “sms sending api” into your favorite search engine.
If you want to send a message through the user's own iMessages or cell phone account, then you cannot do it without confirmation. How to programmatically send SMS on the iPhone?

Count Word Use in iMessage Messages?

Could an app count the number of uses of a specific word in an iMessage message? What if the word was in the AutoCorrect dictionary? For example, an app that counted the number of uses of the company name in user's iMessage messages. From what I have researched so far, the answer seems like no because the messages are secure, but I just want to be sure.

How does snapchat do their friends functionality?

So I am trying to have users in my app find each other via their address book (a la Snapchat). How do I go about this?
I can have access to the user's address book so I would be able to associate each number with a user (I verify this via text for each user). Once I have all these users associated though, would I have to compare each phone number to my data base (Parse) in order to have a section of "Friends who have MyApp"? Otherwise, how can I grab an address book of X user and tell them which of his contacts have the App already installed?
Also, I have read in many places I should not upload their contacts info to my backend.
Help?
First thing that comes to my mind is to store each user's phone number as well. However, you might be right about not to upload their contacts to your server even though you do ask for confirmation that you're going to access their contact list.
I'll put forward another idea, how about storing their contact list as encrypted data? Thus, even you personally won't be able to reach any of the contact info. Use an irreversible encryption algorithm like sha512 and then store these phone numbers as encrypted strings. Each time a user requests if his/her contacts are exist in your database, encrypt each phone number locally and make a request if those strings exist in your DB. This implementation is really similar to common password storing techniques and I believe it is quite secure -and ethical.
Related: How can I compute a SHA-2 (ideally SHA 256 or SHA 512) hash in iOS?

Resources