【发布时间】:2020-08-30 13:09:39
【问题描述】:
世博 SDK 37
componentDidMount() {
this.registerForPushNotificationsAsync();
this._notificationSubscription = Notifications.addListener(this._handleNotification);
}
_handleNotification = notification => {
Vibration.vibrate();
console.log(notification);
console.log(“hello”)
this.setState({ notification: notification });
};
当应用程序处于前台时,句柄函数被执行并执行console.log,但是当应用程序关闭时,句柄函数根本没有执行? 有人可以帮忙吗?
【问题讨论】:
标签: javascript react-native push-notification expo mobile-development