node-apn | : calling : Apple Push Notification module for Node.js | Notification library
kandi X-RAY | node-apn Summary
kandi X-RAY | node-apn Summary
[][node-apn].
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Configuration .
- Prepares and returns a new token
- Decode a PNCCert .
- Parses an api key
- Create a certificate from an ASN .
- Client constructor .
- Find an APN key from the package .
- Validates the given credentials
- Configure address .
- Validates a token
node-apn Key Features
node-apn Examples and Code Snippets
Community Discussions
Trending Discussions on node-apn
QUESTION
We are using the parse fork of node-apn lib ( https://github.com/parse-community/node-apn ) - we switched a year ago to this fork because our actual problem - but now its back.
We are sending around 1.000.000 notifications, separated to different sub-jobs and some of them just hang while sending to apple, after calling
apnProvider.send()
... we don't get an answer/callback.
The problem was happen often end of last year and the whole year it worked fine - and beginning last weekend the problem came back - without any change on our side :-( from 40 processes 1 or 2 just break up there work.
We implemented a workaround, a watchdog that sees the hanging process after 30 seconds and stops it, but this is a bad solution. I wanted to ask if someone has any idears to fix it or to find out the real reason. I dont get an error event or something.
We tested different nodejs versions and working on ubuntu server - also tested differend versions.
best regards.
Code parts:
Initialisation:
...ANSWER
Answered 2020-Oct-26 at 12:08The issue ist now handled in the new version 4.0.0 of the node-apn fork from the parse community. New version handles the timeout of the http2 connections.
Issue: https://github.com/parse-community/node-apn/issues/24
QUESTION
I have created an independent watchkitapp in XCode, installed in apple watch and successfully sent push notification without errors from Pusher app (also in node-apn) but the notification does not arrive in app. (Tried another app for iOS and remote push notification successfully received in iOS app)
These are the steps i took
In my watchkitapp I did WKExtension.shared().registerForRemoteNotifications() and took the device token
UNUserNotificationCenter.current().requestAuthorization and allowed push notification on apple watch. ofcourse I set UNUserNotificationCenter.current().delegate to the InterfaceController (I tried Local Notification and local notifications display normally on the watch)
On XCode watchkitapp.watchkitextension I added Push Notification on capabilities
In Apple Developer page I created app id mirroring the watchkitapp bundle (not the watchkitextension one). In my case apple automatically created App Id in the server but I removed and recreated it to make sure
Checked the Apple Push Notification service and generated Development SSL Cert
Downloaded the Development SSL Cert and installed in keychain
Opened the Pusher app and selected the installed Development SSL Cert from the list. Ran the apple watch app and obtained the Token Id... sent the payload and it says the payload is sent
Tried to restart mac, iphone, apple watch, unpairing apple watch, reinstalling app but the result is the same... push is sent but does not receive in apple watch
anybody can help me how can I fix this?
...ANSWER
Answered 2020-Oct-07 at 01:23Finally, I got this successfully. I use node-apn to send from server.
Here are the worth noticing things:
create app id of the watchkitapp bundle in Apple Developer page
install the latest version of: node-apn,
"dependencies": { "apn": "git+https://github.com/node-apn/node-apn.git#3.0.0", [...] }
should set apns-push-type
notification.pushType (Required when delivering notifications to devices running iOS 13 and later, or watchOS 6 and later. Ignored on earlier system versions.)
The type of the notification. The value of this header is alert or background. Specify alert when the delivery of your notification displays an alert, plays a sound, or badges your app's icon. Specify background for silent notifications that do not interact with the user.
The value of this header must accurately reflect the contents of your notification's payload. If there is a mismatch, or if the header is missing on required systems, APNs may delay the delivery of the notification or drop it altogether.
QUESTION
Swift 5
iOS 13+
xCode 11
Node v14.2.0
Firebase/Firestore latest
SettingAlice send push notification to Bob, while Bob's phone is .inactive
or .background
. Bob's phone should get notification and immediately trigger code.
This question has plenty of answers, but most of what I can find revolves around hacking the PushKit and CallKit native API to send .voIP
pushes. Per this question (iOS 13 not getting VoIP Push Notifications in background), Apple no longer allow you to send .voIP
pushes w/o triggering CallKit's native phone ring routine.
On iOS side, I have the following bits in AppDelegate.swift
ANSWER
Answered 2020-May-16 at 11:41You need to enable the background mode - remote notifications capability.
To receive background notifications, you must add the remote notifications background mode to your app. In the Signing & Capability tab, add the Background Modes capability, then select the Remote notification checkbox.
Enabling the remote notifications background mode:
For watchOS, add this capability to your WatchKit Extension.
Source: Pushing Background Updates to Your App | Apple Developer Documentation
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install node-apn
This readme is a brief introduction, please refer to the full [documentation](doc/apn.markdown) in doc/ for more details. If you have previously used v1.x and wish to learn more about what’s changed in v2.0, please see [What’s New](doc/whats-new.markdown).
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page