Swift:为什么在后台推送通知didReceive改为didReceiveRemoteNotification

时间:2018-11-26 09:00:46

标签: swift notifications push

为什么当我从服务器发送推送通知且应用程序处于后台时,调用了class CustomWidget extends StatelessWidget { CustomWiget(){ // Access the config in the constructor GlobalConfiguration cfg = new GlobalConfiguration(); print(cfg.getAppConfig("key1"); // prints value1 } @override Widget build(BuildContext context) { // Access the config in the build method GlobalConfiguration cfg = new GlobalConfiguration(); return new Text(cfg.getAppConfig("key2")); } } 而不是didReceive

当我的应用打开或被didReceiveRemoteNotification终止推送通知传递时,只有当应用处于后台时,它才能通过didReceiveRemoteNotification

为什么?

0 个答案:

没有答案