Remove contact

From PokeTALK developers

Jump to: navigation, search

Contents

Description

Remove contact from user addressbook

Usage

    ptAddressbook.remove_contact(id, callback);

or

    var result = ptAddressbook.remove_contact(id);

Parameters

Required Name Type Description
required id integer contact ID
optional callback function optional callback function to call after execution

Response

object (JSON)

 
    {"result":boolean}
Parameter Type Description
result boolean returns true if contact removed, false otherwise.

Example

Use result object

var data = ptAddressbook.remove_contact(id);
if(data.result){
    alert("Rmoved");
}else{
    alert("Can`t remove contact");
}

Use callback function

ptAddressbook.remove_contact(id, function(data){
    if(data.result){
        alert("Removed");
    }else{
        alert("Can`t remove contact");
    }
});
Personal tools