iOS推送通知只显示徽章。需要声音和横幅 [英] iOS push notifications only showing badges. need sounds and banners too
问题描述
我目前正在使用相同的方法向两个不同的应用发送推送通知,但其中一个只显示徽章。如果我从设置访问通知,则只会显示徽章而不是徽章,声音,横幅。
我使用 https:// github.com/phonegap/phonegap-plugin-push 插件。
我尝试重新启动,因此会要求第一次推送请求,尝试使用其他设备,反复调用 init
函数调用
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:
(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)]
但结果相同。 / p>
如果我在锁定屏幕上显示。
$ b 我设置像这样的通知:
UIUserNotificationSettings * notificationSettings = [UIUserNotificationSettings settingsForTypes:UIUserNotificationTypeAlert | UIUserNotificationTypeBadge | UIUserNotificationTypeSound categories:nil];
[[UIApplication sharedApplication] registerUserNotificationSettings:notificationSettings];
它工作正常。
希望有帮助。
I am currently sending push notifications to 2 different apps using the same methods, but one of them only shows only Badges. If I visit Notifications from Settings it displays only "Badges" instead of "Badges, Sounds, Banners".
I am using the https://github.com/phonegap/phonegap-plugin-push plugin.
I tried reseting so it would ask for first time push request, tried another device, and repeatedly called the plugins init
function which calls
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:
(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)]
but with the same result.
If I am on the lock screen it shows up. If I check notification center its there.
Thanks.
I am setting notification like this:
UIUserNotificationSettings* notificationSettings = [UIUserNotificationSettings settingsForTypes:UIUserNotificationTypeAlert | UIUserNotificationTypeBadge | UIUserNotificationTypeSound categories:nil];
[[UIApplication sharedApplication] registerUserNotificationSettings:notificationSettings];
It works fine. Hope this help.
这篇关于iOS推送通知只显示徽章。需要声音和横幅的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!