杀死类似于 WhatsApp 的应用程序后实现通知

Achieving Notifications after killing app similar to WhatsApp

我们正在尝试实现类似于 WhatsApp(iOS 版本)通知处理的通知功能,即使在明确杀死 WhatsApp 之后 - 通知消息出现在带有消息计数的新消息的顶部聊天中 – 这可以实现通过 VOIP 推送。

想了解一下金融App是否可以使用VOIP,是否会导致App被拒。

您的应用将被拒绝,原因如下,

2.16: Multitasking apps may only use background services for their intended purposes: VoIP, audio playback, location, task completion, local notifications, etc.

We found that your app uses a background mode but does not include functionality that requires that mode to run persistently.

如果您打算使用 VOIP 推送,您的应用必须支持 VOIP。

注意,如果你只想显示徽章数而不显示通知,那么可以通过静默通知来实现。

iOS 显示徽章计数,与应用程序 运行 状态无关,即即使您的应用程序被明确终止,在收到静默通知时,徽章计数也会反映出来。需要注意的是,app被杀掉是不会被唤醒的。

你的负载应该是,

{
"aps" : 
      { "content-available" : 1
        "badge" : 5
      }
}

查看一些关于静默推送通知的好教程

https://blog.layer.com/how-we-leverage-ios-push-notifications/

https://www.raywenderlich.com/123862/push-notifications-tutorial