全员推送
全员推送
$tim->push->setTIMTextElem('大家好吗')->pushAllMember();
$tim->message
->setTIMTextElem('在吗')
->setTIMLocationElem('someinfo', 29.340656774469956, 116.77497920478824)
->setTIMFaceElem(1, 'content')
->setTIMCustomElem('message', 'notification', 'url', 'dingdong.aiff')
->setTIMSoundElem('sound_url')
->setTIMImageElem('image_url')
->setTIMFileElem('file_url')
->setTIMVideoFileElem('video_url', 'thumb_url')
->tagsAnd(['股票A', '股票B'])
->tagsOr(['股票A', '股票B'])
->attrsAnd(['会员等级' => '超白金会员', 'city' => '深圳'])
->attrsOr(['会员等级' => '超白金会员', 'city' => '深圳'])
->setOfflinePushInfo(new OfflinePushInfo(0, '这是推送标题', '这是离线推送内容', '这是透传的内容'))
->pushAllMember('101', 86400);
设置应用属性名称
$tim->setAppAttr([
'0' => 'sex',
'1' => 'city',
'2' => 'country'
]);
获取应用属性名称
$tim->getAppAttr();
获取用户属性
$tim->getUserAttr(['101', 102]);
$tim->getUserAttr('101');
设置用户属性
$tim->setUserAttr([
'101' => [
'sex' => 'attr1',
'city' => 'attr2',
],
'102' => [
'sex' => 'attr3',
'city' => 'attr4',
]
]);
删除用户属性
$tim->removeUserAttr([
'101' => [
'sex',
'city',
],
'102' => [
'sex',
'city',
]
]);
获取用户标签
$tim->getUserTag(['101', 102]);
$tim->getUserTag('101');
添加用户标签
$tim->setUserTag([
'101' => [
'a',
'b',
],
'102' => [
'a',
'b',
]
]);
删除用户标签
$tim->removeUserTag([
'101' => [
'a',
'b',
],
'102' => [
'a',
'b',
]
]);
删除用户所有标签
$tim->removeUserAllTags(['101', 102]);
$tim->removeUserAllTags('101');