Page 1 of 1

using contacts service to perform an action on a number

Posted: Mon Jul 27, 2015 7:31 am
by David7661654

Hello,

I followed this tutorial to use a filter to display the contacts names and phones:
https://devcenter.appery.io/tutorials...

I'm trying to press the button next to each result in order to push the phone number into a sessionStorage variable, but although I mapped it, it is not entered.

When I do exactly the same thing with an input text, it works exactly as it should.

The contact phone is located in
Mainmobilecontainercontacts_listcall_contactcontact_gridmobilegridcell_15contact_phone

Has anyone managed to use the result to make a call or perform some action?

This is my mapping and I don't see why it doesn't work:
Image

Thank in advance for your assistance,

David


using contacts service to perform an action on a number

Posted: Tue Jul 28, 2015 6:31 am
by Evgene Karachevtsev

Hello David,

Could you please clarify do you call this service on button click event?
Also you may debug your app with http://devcenter.appery.io/documentat... to check what is actually stored in your local storage with the following js code:
precode var myLSV = Apperyio.storage.destination.get();
alert("local storage = '" + myLSV + "'");code/code/code/pre


using contacts service to perform an action on a number

Posted: Tue Jul 28, 2015 1:33 pm
by David7661654

Hi Evgene,

Yes.

I click on the button next to the specific name/number that I want to call:
Image

Do I inject the debug JS during the mapping, the button click, the page load...?

Regards,

David


using contacts service to perform an action on a number

Posted: Tue Jul 28, 2015 2:26 pm
by Illya Stepanov

Hi David -

You can make a separate click event on this list and check whether you are getting the correct value from your local storage variable.


using contacts service to perform an action on a number

Posted: Tue Jul 28, 2015 10:41 pm
by David7661654

Hi Ilya,

Thank you for responding to my post. I'm afraid I don't understand what you mean.

As you can see herein, these are the events I set on the top yellow call button (the mapping I sent previously is the 1st event):
Image

The 2nd event checks the value in the session storage variable and that's where I see that there's a problem.

As I specified, in the 2nd call button (the one next to the manual input), I do exactly the same thing (map the input value to sessionStorage.destination) and there, it works


using contacts service to perform an action on a number

Posted: Wed Jul 29, 2015 5:19 am
by David7661654

In the weinre console I see this message:
ContactsService can't process request because navigator.contacts is undefined.

The problem with testing the app on the browser is that there's no contacts list that we can use during the testing (is there??) and building an apk and using it on the phone doesn't give us the debugging capabilities required


using contacts service to perform an action on a number

Posted: Wed Jul 29, 2015 8:24 am
by David7661654

OK. I sorted it out.

It seems that the mapping to storage doesn't actually populate the data into the variable and the "Set storage variable" action is required:
Image