Data null in background
See original GitHub issueBug
Data payload null if in background In Background
{"chat": "us0jXE4qG9gPuSMJF0xzHTH", "collapse_key": "com.hallopet.user", "data": {}, "finish": [Function finish], "foreground": false, "from": "1095807157509", "google.delivered_priority": "normal", "google.message_id": "0:1598946632974825%eaee66e3eaee66e3", "google.original_priority": "normal", "google.sent_time": 1598946632971, "google.ttl": 2419200, "object": "chat", "object_id": "us0jXE4qG9gPuSMJF0xzHTH", "userInteraction": true}
In Active App
{"color": null, "data": {"chat": "us0jXE4qG9gPuSMJF0xzHTH", "object": "chat", "object_id": "us0jXE4qG9gPuSMJF0xzHTH"}, "finish": [Function finish], "foreground": true, "id": "1860630111", "message": "Pp", "sound": null, "title": "cepw4xh5n8", "userInteraction": false}
Environment info
react-native info
output:
System:
OS: Windows 10 10.0.19041
CPU: (8) x64 Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz
Memory: 1.31 GB / 7.91 GB
Binaries:
Node: 14.9.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.4 - ~\AppData\Roaming\npm\yarn.CMD
npm: 6.14.8 - C:\Program Files\nodejs\npm.CMD
IDEs:
Android Studio: Version 4.0.0.0 AI-193.6911.18.40.6626763
npmPackages:
react: 16.9.0 => 16.9.0
react-native: 0.61.5 => 0.61.5
npmGlobalPackages:
react-native-cli: 2.0.1
Library version: ^5.1.0
Describe what you expected to happen:
- I will data is not null like Active App notification attached
Reproducible sample code
import React, { Component } from 'react'
import Route from './src/Route';
import { Root } from 'native-base';
import AsyncStorage from '@react-native-community/async-storage'
import axios from 'axios'
import SplashScreen from 'react-native-splash-screen'
import { AppState, Text, View, Image, StatusBar, Dimensions, StyleSheet, Linking, Platform } from 'react-native'
import { API_URL, BASE_COLOR, SOCKET_URL } from 'react-native-dotenv'
import Icon from 'react-native-vector-icons/AntDesign';
import NotifService from './NotifService'; // use example of this library
import NavigationService from './NavigationService'; // use example of this library
import ADD_DATA from './redux/notification/action';
import storeNotification from './redux/notification/store';
import * as storeUser from 'react-native-simple-store';
import PushNotificationIOS from "@react-native-community/push-notification-ios";
import { Provider} from 'react-redux';
import store from './redux/store';
export class App extends Component {
constructor(props) {
super(props);
this.state = {
showRealApp: true
};
this.notif = new NotifService(
this.onRegister.bind(this),
this.onNotification.bind(this),
);
}
onRegister(token) {
AsyncStorage.setItem('notification:token', token.token);
}
onNotification(notif){
console.log(notif);
}
componentDidMount() {
SplashScreen.hide();
}
render() {
return (
<Root>
<Provider store={store}>
<Route />
</Provider>
</Root>
);
}
}
export default App
Issue Analytics
- State:
- Created 3 years ago
- Comments:14
Top Results From Across the Web
My data gets null when app is relaunched after being at ...
Just avoid this issue entirely by storing your values using SharedPreferences inside the onPause and onDestroy method overrides.
Read more >Solved: Formatting Background Color Conditional - Blank, N...
Hello, I am try to conditionally format the background of my visuals based off of a measure then a scoring level of 0...
Read more >Conditional formatting Cell background color with Null Values
Hi,. I have a requirement to conditionally format the cell background color and using the below formula. if COUNT([Item])=[CA_Count] THEN 'Green'.
Read more >Background-image: null | WordPress.org
Hi,. I've got this in my website's code, is it normal for the background image url to be “null”? <style type=”text/css”>#lyte_Uq1o6w5zHUQ ...
Read more >NSUserDefaults might be NULL when app is launched
We have hundreds of iPad and iPhone users; but in some iPhone users (a very very small portion), all values in [NSUserDefaults standardUserDefaults]...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@Dallas62 fixed in version 6.0.0, can i close this issue
In Active not click
In Background + Click