Skip to content

Instantly share code, notes, and snippets.

View OtavioBraga's full-sized avatar

Otavio Braga OtavioBraga

View GitHub Profile
### RNPushNotificationHelper
#Linha 263
String imageUrl = bundle.getString("pinpoint.notification.imageUrl");
if (imageUrl != null) {
Bitmap bigPicture = new DownloadImageAsync().execute(imageUrl).get();
notification.setStyle(new NotificationCompat.BigPictureStyle().bigPicture(bigPicture));
} else {
notification.setStyle(new NotificationCompat.BigTextStyle().bigText(bigText));
}
<Repeater items={this.state.body}>
{(({ tag, text }) => {
const Tag = tag || "p"
return <Tag>{text}</Tag>
})}
</Repeater>
// Código pra gerar um array com N numero
const getNumbers = max => [...Array(max).keys()]
// Gero o array com numero abaixo do 60 (0...59)
const numbers = getNumbers(60)
// Método que calcula
const getMultiples = ({numbers, orOperand, andOperand}) => {
return numbers.map(number => {
const orOperandResult = orOperand ? orOperand.reduce((last, operand) => {
const newsList = [
{
title: 'Título',
resume: 'Resumo',
featuredImage: '',
readMore: 'https://...',
publisherLogo: 'https://logodownload.org/wp-content/uploads/2017/07/estadao-logo-2.png',
},
];
{
id: 1,
title: 'Todos o plano unimed com 100% de desconto',
imageHeader: 'https://www.unimedcuritiba.com.br/wps/wcm/connect/04758f01-36ef-445c-bdc1-6e414c2cc8fc/Unimed-Laboratório.png?MOD=AJPERES&ContentCache=NONE&CACHE=NONE&CACHEID=ROOTWORKSPACE-04758f01-36ef-445c-bdc1-6e414c2cc8fc-mv4JWd5',
body: '<div class="content"> <div class="card border-0 pb-2 my-4 d-flex flex-row"> <img src="https://secure.gravatar.com/avatar/84843736d55bafbd060df86a944a7278?s=96&amp;d=mm&amp;r=g" class="rounded-circle"> <div class="d-flex flex-column justify-content-center ml-3"> <span>Otávio Braga</span> <span>5 de Março de 2018 às 12:05</span> </div> </div> <p>É inegável que os aplicativos para dispositivos móveis dominaram o mercado. Seja no iOS, no Android ou em outras plataformas, os APPS são o principal canal para consumir informações atualmente. Pensando nisso os engenheiros do Facebook tem desenvolvido o React Native. O React Native consiste em um série de ferramentas que ajudam o desenvolvedor a criar aplicativos m
import { takeLatest, call, put, race, take } from 'redux-saga/effects'
import { eventChannel } from 'redux-saga'
import {
WS_NEW_EVENT,
USER_LOGOUT,
WS_CONNECT_FAIL,
WS_CONNECT
} from '../actions/types'
export function * handelWsConnection () {
export function * watchMessages (eventChannel) {
// Executamos indefinidamente
while (true) {
// Usamos o effect take para ler os eventos do channel
const event = yield take(eventChannel)
// Enviamos uma ação para nossa store do redux
yield put({ type: WS_NEW_EVENT, payload: JSON.parse(event) })
}
}
import { eventChannel, END } from 'redux-saga'
function getWsChannel(websocket) {
// Devemos retornar o channel pois é
// nele que iremos buscar os eventos emitidos
return eventChannel(emitter => {
websocket.onmessage = event => {
emit(event.data)
}
[
{
"to": "ExponentPushToken[sbY85YHho_lXScLhsOktbD]",
"sound": "default",
"body": "Sua senha HUC-65 é a próxima a ser atendida. Dirija-se ao Hospital Unimed agora.",
"priority": "high",
"channelId": "posicao-na-fila",
"data": {
"actions": [
{
this.sections = [
{title: 'Chamadas',
data: [
{
id: '1',
date: '14 de abril de 2018',
status: 'CALLING',
ticketNumber: 'N45',
place: 'Hospital Unimed',
estimatedTime: '45 minutos'