Contact list issue with Livecode and iOS

Getting into LiveCode for iOS? Ask your questions here.

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

Post Reply
Devin
Posts: 7
Joined: Mon Sep 15, 2014 6:56 pm

Contact list issue with Livecode and iOS

Post by Devin » Mon Sep 15, 2014 7:19 pm

This is the first time I have posted on these forums so please be patient with me if I have done something wrong on the order of:

1) This may have been addressed elsewhere (I looked everywhere and I can't find any mention of it)
2) This is posted in the wrong place (It seems to be the most likely area, perhaps I am wrong)
or
3) This is an amazingly stupid question/the answer it obvious (I'm new).

Having gotten that out of the way, I am having an issue in an app that I am constructing that needs access to the iOS built in contact list. The app intends to query the contact list, pull the individual telephone numbers and then compare them to a database with the intention of determining if any of the numbers in your contact list match up with the ones already existent in the app's database.

Upon a fresh install of the app, a script runs that is intended to get the contact information. It uses this command:

Code: Select all

mobileGetContactData contactId
What I get as a return is empty.

The app is not accessing the contact list itself, and in Settings > Privacy > Contacts the app isn't showing at all.

However, if this command is inserted at the beginning of the script:

Code: Select all

mobilePickContact
I get the dialog box that asks if it is OK for this app to access the contact list. From that point on the script will access the contact list as expected, and the app DOES show in Settings > Privacy > Contacts.

For some reason the mechanism that inserts the app into the Contacts preferences, and triggers the appropriate dialog box is not being activated by the mobileGetContactData command.

Further testing shows that these commands that cause the user to actually interface in some way with the contact list WILL cause the dialog box (mobileCreateContact for example) but commands that "silently" get data from the contact list do not (mobileFindContact for example).

That's all great, but as it stands when my users run the app there is this awkward jarring step where they are taken out of MY interface and dropped into the contact list, where they have to touch "Cancel" to get back to my world. From a UX perspective it is not optimal.

Shouldn't any command that tries to access the contact list trigger that dialog, and as a by product insert the app into the Contact List settings? And if not, is there any way to cause that to happen that doesn't involve taking my user out of the app just to accomplish it?

Thank you for any help or direction you can provide me.

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am
Location: Palo Alto

Re: Contact list issue with Livecode and iOS

Post by Simon » Mon Sep 15, 2014 8:04 pm

Hi Devin,
Welcome to the forum :)

I haven't worked with mobileGetContactData in a while, here is where I left it;
http://forums.livecode.com/viewtopic.php?f=49&t=16422
Not sure if they've improved it since then.
Note that it returns an array.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Devin
Posts: 7
Joined: Mon Sep 15, 2014 6:56 pm

Re: Contact list issue with Livecode and iOS

Post by Devin » Mon Sep 15, 2014 8:42 pm

I know that it returns an array.

I found that thread some time ago.

I have a feeling you aren't understanding my question.

My problem is that that "silent" calls to the contact list, meaning the ones that don't bounce the end user physically in and out of the contact list ARE NOT GENERATING A "THIS APP IS TRYING TO ACCESS THE CONTACT LIST" DIALOG BOX and subsequently it those commands DO NOT HAVE ACCESS TO THE CONTACT LIST.

The only way I can grant access to the contact list is through one of the "opaque" commands that causes the end user to bounce in and out of the contact list.

I have created a sample stack with the commands as simplified as possible. You'll need to run this in the iOS xCode simulator, or build it for your phone.

The first two buttons are "silent" accesses to the contact list. They will ALWAYS return empty and using them will NEVER trigger the "can I access the user list" dialog.

The second two green buttons are "opaque" and they bounce the end user in and out of the contact list. These commands WILL trigger the "can I access the user list" dialog, and it will insert the app into the Contacts setting in the Privacy section of Settings.

After hitting either of the second two buttons, the first two will work AS INTENDED, meaning from that point on they WILL have access to the contact list.

This can't be the intended behavior.
Attachments
Contact test.livecode.zip
(1.73 KiB) Downloaded 65 times

Devin
Posts: 7
Joined: Mon Sep 15, 2014 6:56 pm

Re: Contact list issue with Livecode and iOS

Post by Devin » Fri Sep 19, 2014 8:54 pm

Nothing? No one?

Post Reply

Return to “iOS Deployment”