【发布时间】:2016-02-10 09:22:22
【问题描述】:
我正在使用付费的 Pushwoosh 帐户,以便以编程方式向我的用户发送推送通知。
我已经实现了Pushwoosh PHP SDK,一切正常,但我无法在 iOS 设备上设置通知徽章,如下图所示:
到目前为止我的代码是:
$devicesArr[] = ...
$pushwoosh = Pushwoosh::create()
->setApplication('79XXX-9CXXX')
->setAuth('Wkf...2C8');
//Create the Message
$request = CreateMessageRequest::create()
->addNotification(Notification::create()
->setContent('A new workout is available!')
->setDevices($devicesArr));
//Call the REST Web Service
$response = $pushwoosh->createMessage($request);
我尝试根据this page使用->setBadge(5)方法,但这也不起作用:
$request = SetBadgeRequest::create()
->setBadge(1)
->setHwid('18D...1AF');
你知道我怎样才能实现我的目标吗?
【问题讨论】:
-
您的应用收到通知了吗?注册通知的时候,有没有设置
UIRemoteNotificationTypeBadge为UIUserNotificationSettings? -
感谢您的回复。我正在使用 Ionic/Cordova 和 Pushwoosh-Cordova-Plugin 来使用 Pushwoosh。是的,一切正常,因为我正在检索推送通知(在 iOS 和 Android 上)。但我无法设置徽章计数。
标签: php ios push-notification apple-push-notifications pushwoosh