Go to file
2023-07-15 20:04:18 +08:00
src/ios 按需修改 2023-07-15 20:04:18 +08:00
www APNS LaunchPad 2019-04-05 19:51:32 +05:30
LICENSE Initial commit 2019-04-05 19:43:08 +05:30
package.json ios 13 support 2019-09-26 15:59:36 +05:30
plugin.xml 按需修改 2023-07-15 20:04:18 +08:00
README.md 按需修改 2023-07-15 20:04:18 +08:00

cordova-plugin-apns-push

https://github.com/NeutrinosPlatform/cordova-plugin-apns-push 克隆的。 主要修改:

  1. 调整了 app 在活动/非活动状态的逻辑,在活动状态时是不会弹出提醒的。
  2. 需要在发消息时指定 "content-available": 1这样才能接收到数据。但是在试用 https://github.com/PerfectExamples/Perfect-APNS-Demo 时,并不需要这个参数。还是有很多东西没搞明白。
  3. 如果想在活动状态弹出提醒,需要配合 cordova-plugin-local-notifications 插件。

Register and receive APNS push notifications

Install

cordova plugin add git+https://m.shuto.cn:8681/public/cordova-plugin-apns-push

Usage


    var push = window['APNSPushNotification'].init({
        ios: {
            alert: "true",
            badge: "true",
            sound: "true"
        }
        });


    push.on('registration', (data) => {
        // data.registrationId
        this.sendRegDetails(data.registrationId);
    });

    push.on('notification', (data) => {
        window['cordova'].plugins.notification.local.schedule({
        title: data.title,
        text: data.message,
        sound: data.sound,
        at: new Date().getTime()
        });
    });

    push.on('error', (e) => {
        // e.message
        console.error(e);
    });

Supported Platforms

  • iOS

More about us

Find out more or contact us directly here :- http://www.neutrinos.co/

Facebook :- https://www.facebook.com/Neutrinos.co/
LinkedIn :- https://www.linkedin.com/company/25057297/
Twitter :- https://twitter.com/Neutrinosco
Instagram :- https://www.instagram.com/neutrinos.co/

N|Solid