1
我正在製作一個反應本機應用程序oneSignal push notifications。我想在收到通知時更改屏幕。如果應用處於前臺或者點擊了通知,我可以做到這一點。如果應用程序已關閉或在後臺中,我將如何觸發此操作?OneSignal + React Native +後臺通知
import OneSignal from 'react-native-onesignal';
export default class Test extends Component {
componentWillMount() {
OneSignal.addEventListener('received', this.onReceived);
OneSignal.addEventListener('opened', this.onOpened);
OneSignal.addEventListener('registered', this.onRegistered);
OneSignal.addEventListener('ids', this.onIds);
}