所以我终于得到一个信号,向特定用户用户发送推送通知。 我的问题是我想在php脚本中包含唯一的标题和链接,因此当用户收到通知时,他们可以看到自定义标题而不是网站标题,点击它时会将它们带到网站的特定页面。这是我的代码。
`$ content = array( “en”=> “向用户发送自定义消息”, );
$fields = array(
'app_id' => "App Id",
'include_player_ids' => array($playerId),
'data' => array("foo" => "bar"),
'contents' => $content
);`
答案 0 :(得分:1)
我明白了。 我所做的是将用户玩家ID存储在数据库中,然后调用推送消息功能,该功能包括查询以获得我想发送推送消息的用户的特定玩家ID,然后包括玩家ID作为对象工作完美。这是我的代码,其他人需要这个。
$content = array(
"en" => $pushMsg,
);
$headings = array(
"en" => "Fimibucks Marketplace",
);
$fields = array(
'app_id' => "app_id",
'include_player_ids' => array($playerId), // Play id from database
'data' => array("foo" => "bar"),
'headings' => $headings,//Title of your website
'contents' => $content, // the message
'url' => $urls // url of the page you want to send the user to after clicking the notification.
);