Skip to content

Instantly share code, notes, and snippets.

View juanchoperezj's full-sized avatar
🇻🇪

Juan Simón juanchoperezj

🇻🇪
View GitHub Profile
import { AsyncStorage, Alert, Platform } from 'react-native';
import firebase from 'react-native-firebase';
const displayNotificationFromCustomData = message => {
if (message.data && message.data.title) {
let notification = new firebase.notifications.Notification();
notification = notification
.setTitle(message.data.title)
.setBody(message.data.body)
.setData(message.data);
{
"message":{
"token":"eparYXI6eFA:APA91bGLPUJAfemkAIvm3xD6Y9Y02F3MFXg3MuZLH78b50gQJOvm75bHEYb_qVMlvuBKrYxQ5-wZB7qmNnuYScJcpdMbc5ZurM7AUUN_MTpReDCxxjgTn_2cVBc2PNiSSf3EiKL7bYfVvY4MwGSwnGBoSOYB-vi9QA",
"notification":{
"title":"Match update",
"body":"Arsenal goal in added time, score is now 3-0"
},
"android":{
"ttl":"86400s",
"notification":{
@juanchoperezj
juanchoperezj / actions.js
Created January 7, 2018 20:12 — forked from jtibbertsma/actions.js
react-native-navigation redux middleware example
import { createAction } from 'redux-actions';
import {
NAVIGATION_PUSH,
NAVIGATION_POP,
NAVIGATION_RESET_TO,
NAVIGATION_POP_TO_ROOT
} from './actions';
export const push = createAction(NAVIGATION_PUSH);
export const pop = createAction(NAVIGATION_POP);