NotificationsIOS.js 2.24 KB
Newer Older
冷佳娟's avatar
冷佳娟 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const react_native_1 = require("react-native");
class NotificationsIOS {
    constructor(commands, eventsRegistry) {
        this.commands = commands;
        this.eventsRegistry = eventsRegistry;
        return new Proxy(this, {
            get(target, name) {
                if (react_native_1.Platform.OS === 'ios') {
                    return target[name];
                }
                else {
                    return () => { };
                }
            }
        });
    }
    /**
    * Request permissions to send remote notifications
    */
    registerRemoteNotifications() {
        return this.commands.requestPermissions();
    }
    /**
    * Unregister for all remote notifications received via Apple Push Notification service
    */
    abandonPermissions() {
        return this.commands.abandonPermissions();
    }
    /**
   * registerPushKit
   */
    registerPushKit() {
        return this.commands.registerPushKit();
    }
    /**
     * getBadgesCount
     */
    getBadgeCount() {
        return this.commands.getBadgeCount();
    }
    /**
     * setBadgeCount
     * @param count number of the new badge count
     */
    setBadgeCount(count) {
        return this.commands.setBadgeCount(count);
    }
    /**
     * cancelAllLocalNotifications
     */
    cancelAllLocalNotifications() {
        this.commands.cancelAllLocalNotifications();
    }
    /**
     * checkPermissions
     */
    checkPermissions() {
        return this.commands.checkPermissions();
    }
    /**
     * removeAllDeliveredNotifications
     */
    removeAllDeliveredNotifications() {
        return this.commands.removeAllDeliveredNotifications();
    }
    /**
     * removeDeliveredNotifications
     * @param identifiers Array of notification identifiers
     */
    removeDeliveredNotifications(identifiers) {
        return this.commands.removeDeliveredNotifications(identifiers);
    }
    /**
     * getDeliveredNotifications
     */
    getDeliveredNotifications() {
        return this.commands.getDeliveredNotifications();
    }
    /**
     * Obtain the events registry instance
     */
    events() {
        return this.eventsRegistry;
    }
}
exports.NotificationsIOS = NotificationsIOS;