在Onesignal API中,我添加了isIos => true,ios_badgeType =>增加,ios_badgeCount => 1,content_available =>在字段数组中为true.
但是徽章计数始终保持为1,并且不会随着多条消息的增加而增加.
这是我的有效负载详细信息:$fields = array(‘app_id’=>“ xxxxxx”,’included_segments’=> array(‘All’),’data’=> array(“ notification_type” =>“ “),’contents’=> $content,’subtitle’=>> $subtitle,’headings’=> $heading,’isIos’=> true,’ios_badgeType’=>”增加“,’ios_badgeCount ‘=> 1,’content_available’=> true);
解决方法:
您必须添加Notification Extension才能自动更新徽章.请遵循link to setup.
另外,需要创建应用程序组并将两个捆绑软件ID都分配给该特定组.请参阅-
In order for your application to be able to let push notifications
increment/decrement the badge count, you need to set up an App Group
for your application.
标签:onesignal,swift,cakephp,ios,php
来源: https://codeday.me/bug/20191108/2009618.html