2017-09-20 2 views
0

Essayer utilisation this.props.navigator.showInAppNotificationréagir-navigation native showInAppNotification vide

this.props.navigator.showInAppNotification({ 
    screen: "example.InAppNotification", 
    passProps: { 
    title: 'Title', 
    body: 'Body...' 
    }, 
    position: 'bottom', 
    autoDismissTimerSec: 3 
}); 

écran InAppNotification est enregistré, mais voir une notification avec un contenu vide: enter image description here

Quelqu'un peut-il aider à ce?

example.InAppNotification:

export default class InAppNotification extends Component { 
    render() { 
    console.log(this.props); 
    return (
     <View> 
     <Text> 
      {JSON.stringify(this.props)} 
     </Text> 
     </View> 
    ); 
    } 
} 
+0

quel est le contenu de. exemple.InAppNotification –

+0

ajoutez-le à la question. –

Répondre

2

essayer en ajoutant flex:1 à conteneur View

export default class InAppNotification extends Component { 
    render() { 
    console.log(this.props); 
    return (
    <View style={{ flex: 1 }}> 
     <Text> 
     {JSON.stringify(this.props)} 
     </Text> 
    </View> 
); 
} 
} 

aussi vous devez vous inscrire écran InAppNotification correctement

+0

rien n'a changé. Aussi, je ne vois pas le console.log dans les outils de développement. –

+0

avez-vous enregistré l'écran InAppNotification? –

+0

oui, mais avec erreur .. vérifier .. –