2016-06-28 133 views
3

我在一个信号上创建了一个项目。OneSignal组通知

我可以发送到我的手机上的php通知。

问题出现时它到达多个通知。新通知取代了以前的通知(尚未阅读)。

你如何获得反馈说Android有2条未读通知?

该阵列可我送:

$fields = array(
    'app_id' => "XXXXXXXXXXXXXXXXXXXXXX", 
    'included_segments' => array('All'), 
    'data' => array("foo" => "bar"), 
    'headings' => array("en" => "TEST"), 
    'contents' => $content, 
    'android_visibility' => '0', 
    'priority' => '10', 
    'android_group' => '', 
    'android_group_message' => array("en" => "$[notif_count] message"), 
    'url' => "http://www.google.it" 
); 

谢谢!

+0

'$ [notif_count] message'是什么? – C2486

+0

嗨在这里找到它https://documentation.onesignal.com/v2.0/docs/notifications-create-notification在步骤:android_group_message –

+0

好吧我认为你必须逃避这种使用'“\ $ [notif_count]消息” – C2486

回答

1

使用单引号,或者如果你想使用$为字符逃离这里$

'android_group_message' => array("en" => "\$[notif_count] message"), 

OR

'android_group_message' => array("en" => '$[notif_count] message'), 
+0

这是一样的,新的通知取代了previus通知。是对的写:''android_group'=>'''?? –

1

您可以尝试值设置为 'android_group',像这样:

'android_group' => 'sameGroup'