UNPKG

react-native-notifications

Version:

Advanced Push Notifications (Silent, interactive notifications) for iOS & Android

19 lines (18 loc) 733 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.NotificationFactory = void 0; const Notification_1 = require("./Notification"); const NotificationIOS_1 = require("./NotificationIOS"); const NotificationAndroid_1 = require("./NotificationAndroid"); const react_native_1 = require("react-native"); class NotificationFactory { fromPayload(payload) { if (react_native_1.Platform.OS === 'ios') { return payload.aps ? new NotificationIOS_1.NotificationIOS(payload) : new Notification_1.Notification(payload); } else { return new NotificationAndroid_1.NotificationAndroid(payload); } } } exports.NotificationFactory = NotificationFactory;