Add new contact

General discussions about Automagic and automation in general

Moderator: Martin

Post Reply
bricex308
Posts: 5
Joined: 25 Dec 2016 11:54

Add new contact

Post by bricex308 » 15 Mar 2019 15:25

Hello I thought I saw that the question has already been asked but does not seem concretely to find a solution but maybe I'm wrong.

Is it possible to have a flow that allows to add a new contact but not on the sim card but just in the internal memory of the smartphone.

I am responsible for a music festival in France (eco green cabaret festival) and I work with a lot of people. I would like the flow to run when a new text message arrives, if the number is unknown then look in the sms the sign "+" and add in contact name the first name that follows just after the sign "+". ..

For example: All my comrades have instructions to sign their sms whatever happens "+ first name"!

New sms: +33612345678
- hello I just arrived on the site, I'm waiting for you scene 2. +DavidRegisSon -

Then after receiving this message automagic automatically adds a new contact name: DavidRegisSon ; number .....

But I do not know where to start or how to do it?

thank you in advance to whoever will know how to delight me ^^ :D

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Add new contact

Post by Desmanto » 15 Mar 2019 16:21

Use Start Activity as shown in this thread : viewtopic.php?f=5&t=7239
You might need to add some Control UI to accept/press OK for the last confirmation. (depends on your phone)

For incoming sms, use Trigger SMS received.
To get the name, you can use simple split() based on the " +" (space and plus), or you can use regex too. You can check if the contact name is blank, then pick the name and use it in add contact activity.
But i can't test the sms yet, since I don't keep my previous sms logging. Will check the value first for tomorrow, after I get some data.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

Post Reply