Skip to content

Instantly share code, notes, and snippets.

diff --git a/node_modules/expo-notifications/build/NotificationsEmitter.js b/node_modules/expo-notifications/build/NotificationsEmitter.js
index d537118..d4b8968 100644
--- a/node_modules/expo-notifications/build/NotificationsEmitter.js
+++ b/node_modules/expo-notifications/build/NotificationsEmitter.js
@@ -13,7 +13,13 @@ export function addNotificationsDroppedListener(listener) {
return emitter.addListener(didDropNotificationsEventName, listener);
}
export function addNotificationResponseReceivedListener(listener) {
- return emitter.addListener(didReceiveNotificationResponseEventName, listener);
+ const subscription = emitter.addListener(didReceiveNotificationResponseEventName, listener);
import * as Notifications from "expo-notifications";
import React, { useState, useEffect, useRef } from "react";
import { Text, View, Button, Platform } from "react-native";
Notifications.setNotificationHandler({
handleNotification: async () => ({
shouldShowAlert: true,
shouldPlaySound: false,
shouldSetBadge: false,
}),
@cruzach
cruzach / sendNotificationToAPNS.js
Created August 24, 2020 21:43
Example of sending a notification to APNS
const jwt = require("jsonwebtoken");
const http2 = require("http2");
const fs = require("fs");
const token = jwt.sign(
{
iss: "APPLE-TEAM-ID"
iat: Math.round(new Date().getTime() / 1000),
},
fs.readFileSync("./myapp_apns_key.p8", "utf8"),
import Constants from "expo-constants";
import * as Notifications from "expo-notifications";
import * as Permissions from "expo-permissions";
import React, { useState, useEffect, useRef } from "react";
import { Text, View, Button, Platform } from "react-native";
Notifications.setNotificationHandler({
handleNotification: async () => ({
shouldShowAlert: true,
shouldPlaySound: false,