Google通讯录API-创建联系人

时间:2019-01-30 14:30:38

标签: api

我使用以下代码在google联系人中创建联系人。像这样的“ kelly bandon测试”怎么会被分成我不想做的名字,中间名和姓氏。我想全部保存为名字。我可以使用一个属性将此名称全部保存到Google联系人的“名字”字段中吗?

喜欢http://prntscr.com/mea957,而不喜欢http://prntscr.com/meaacj

$add_customer = array(
            'name' => $this->input->post('name') ,
            'is_admin' => $this->input->post('is_admin') , 
            'company' =>$this->input->post('company') , 
            'email' => $this->input->post('email1'), 
            'phone' => $this->input->post('phone'), 
            'password' => md5($this->input->post('password1')), 
            );

        $newId = $this->Customer_m->insert_entry($add_customer);echo "<br/>";
        include_once('application/libraries/gContacts.php');
        $token = $this->session->userdata('gapiToken');
        $refreshToken = $this->session->userdata('gapiRefresh');
        list($client, $token) = setToken($client, $token, $refreshToken);
        if(ISSET($token) AND !empty($token)){
            $tokenData = json_decode($token, true);
            $access_token = $tokenData['access_token'];
            $contact = $this->Customer_m->get_one($newId);
            if($gid = $this->Customer_m->createGContact($client, $access_token, $contact))
             {   $this->Customer_m->update_entry($newId, array('googleId'=>$gid));

     }
        }

        /**/
       redirect('/customer');

0 个答案:

没有答案