简体   繁体   English

有多少用户启用了推送通知?

[英]How many users have push notifications enabled?

I have a SAAS product with many users. 我有一个SAAS产品,有很多用户。 iOS + Android app. iOS + Android应用。

1) Is there a way to check how many of them have push notifications enabled? 1)有没有办法检查有多少人启用了推送通知?

2) Can I programmatically check if they have push enabled? 2)我可以编程检查是否已启用推送? And if not, then I want to trigger alternative communication. 如果没有,那么我想触发替代沟通。

Questions apply for both iOS and Android. 问题适用于iOS和Android。

Thank you. 谢谢。

For ios 对于ios

You'll have to implement a smart solution for do this job. 您必须实施智能解决方案才能完成这项工作。

The initial point is identify a permission users. 最初的一点是识别权限用户。

As this response : https://stackoverflow.com/a/44407514/6273003 作为此回复: https//stackoverflow.com/a/44407514/6273003

after, you can storage this information with some user identification. 之后,您可以使用某些用户标识存储此信息。

and then, when you decide notificate, you must check this information. 然后,当您决定通知时,您必须检查此信息。

PS : This permission is dynamic as @paulw11 said. PS:这个许可是动态的,正如@ paulw11所说。

Sorry my answer only about iOS part 对不起我的回答只有iOS部分
I think you need know what users get notification messages and if user don't get message, send it message with alternative chanel. 我想您需要知道用户获取通知消息的内容以及如果用户没有收到消息,请使用备用chanel发送消息。
It can be do (in iOS) with Notification Extension 可以使用Notification Extension(在iOS中)
Just add send delivery status with api request (in your service) 只需使用api请求添加发送传递状态(在您的服务中)

override func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) {
let content = request.content
// send delivery status in your service
sendStatistic(content: request.content, onCompletion: {
    // show push with default content
    contentHandler(content)
})

} }

Some guide with extension 一些指南与扩展
https://code.tutsplus.com/tutorials/ios-10-notification-service-extensions--cms-27550 https://code.tutsplus.com/tutorials/ios-10-notification-service-extensions--cms-27550
More Information about extension https://developer.apple.com/documentation/usernotifications/unnotificationserviceextension 有关扩展的更多信息https://developer.apple.com/documentation/usernotifications/unnotificationserviceextension
More Information about Notification 有关通知的更多信息
https://developer.apple.com/notifications/ https://developer.apple.com/notifications/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM