如何设置Google Glass Mirror API时间轴项的creator.email

时间:2014-07-12 12:52:38

标签: php google-glass google-mirror-api

我尝试按照此处的文档向Google Glass时间轴项目添加SEND_MESSAGE菜单命令:
https://developers.google.com/glass/v1/reference/timeline/insert

SEND_MESSAGE - Initiate sending a message to the timeline item's creator:
If the creator.phoneNumber is set and Glass is connected to an Android phone, the message is an SMS.
Otherwise, if the creator.email is set, the message is an email.

它声明我必须将creator.email设置为要发送的电子邮件。但是,Google_Contact类型上没有电子邮件属性,如果我将Google_Contact子类化并添加一个或传入除Google_Contact以外的任何内容(如带有电子邮件值的数组),则API会引发错误。

如果我将所有其他字段设置为电子邮件,则在运行菜单命令时,我会在Glass上收到错误声音:

$new_timeline_item = new Google_TimelineItem ();
$creator = new Google_Contact();
$creator->setDisplayName('admin@acemoda.com');
$creator->setId('admin@acemoda.com');
$creator->setSource('admin@acemoda.com');
$creator->setSpeakableName('admin@acemoda.com');
$new_timeline_item->setCreator($creator);

如何在PHP Google Glass Mirror API中设置creator.email字段?

0 个答案:

没有答案