Skip to content

Instantly share code, notes, and snippets.

import PushNotification from 'react-native-push-notification';
import PushNotificationIOS from '@react-native-community/push-notification-ios';
import { AppState, Platform } from 'react-native';
import { checkNotifications, RESULTS } from 'react-native-permissions';
// BIIIIG WARNING: in iOS you'll get a token ONLY if you request permission for it.
// Therefore, a call for PushNotification.requestPermissions() is required.
// Android doesn't need the user's consent to send notifications, whereas iOS does
// but Android's user can still turn off notifications in the system settings
@arnaudambro
arnaudambro / ChatRoom.tsx
Last active September 10, 2025 13:08
Here is a full example of a working ChatRoom, the intention is to be kind of a clone of WhatsApp - it's not a lib, you can just copy past it and adapt to your own style
import React, {
useState,
useEffect,
useCallback,
useRef,
useMemo,
} from "react";
import {
View,
Text,