当我点击取消按钮,它显示“未定义不是一个对象”。代码如下所示。反应本地AlertIOS回调
更新:
componentWillMount() {
PushNotificationIOS.addEventListener('notification', this._onRemoteNotification);
}
_onRemoteNotification(notification) {
AlertIOS.alert(
'Push Notification Received',
'Alert message: ' + notification.getMessage(),
[{
text: 'OK',
onPress: null,
},
{
text: 'Cancel',
onPress:()=>this.setState({key: value}),
},
]
);
}
}
你能告诉你如何调用这个警报在您的组件? – rclai
已更新。请检查 – bns