为什么当我从服务器发送推送通知且应用程序处于后台时,调用了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
为什么?