findContact

Contacts

Finds a contact in the native contacts list based on the filter string provided. The filter string is matched against all the properties of the contact like name, phone, email etc.

$m.findContact(function(response){

        if(response.code){

           var contacts = response.result;        

        } else{

           $m.toast(response.error.message);

        }

});

Syntax

        $m.findContact(filter[, fp_callback])

Parameters

filter

string (required)

The filter string to search in contacts list for matching contacts.

fp_callback

function (optional)

The function to execute when the find contact operation is completed. The function receives a response object as parameter with the following properties,

  1. code - {Number}. The value can be 0 or 1. 1 indicates that the find operation is successful. 0 indicates a failure.
  2. result - {Array}. Array of contact objects that matched the specified filter.
  3. error - {Object}. Available when the code is 0. The error object contains,
  1. message - {String}. A short description of the error.
  2. description - {String}. A detailed description of the error.