Skip to content

Commit

Permalink
ios notifs [nfc]: Remove now-unused fromPushNotificationIOS! 🎉
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbobbe committed Jun 1, 2023
1 parent ea1b2fe commit 3169cf4
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions src/notification/extract.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/* @flow strict-local */
import PushNotificationIOS from '@react-native-community/push-notification-ios';

import type { Notification } from './types';
import { makeUserId } from '../api/idTypes';
import type { JSONableDict, JSONableInput, JSONableInputDict } from '../utils/jsonable';
Expand Down Expand Up @@ -170,20 +168,3 @@ export const fromAPNs = (data: ?JSONableDict): Notification | void => {

// Despite the name `fromAPNs`, there is no parallel Android-side `fromFCM`
// function here; the relevant task is performed in `FcmMessage.kt`.

/**
* Extract Zulip notification data from the blob our iOS libraries give us.
*
* On validation error (indicating a bug in either client or server),
* logs a warning and returns void.
*
* On valid but unrecognized input (like a future, unknown type of
* notification event), returns void.
*/
export const fromPushNotificationIOS = (notification: PushNotificationIOS): Notification | void => {
// This is actually typed as ?Object (and so effectively `any`); but if
// present, it must be a JSONable dictionary. It's giving us the
// notification data, which was passed over APNs as JSON.
const data: ?JSONableDict = notification.getData();
return fromAPNs(data);
};

0 comments on commit 3169cf4

Please sign in to comment.