This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const jwt = require('jsonwebtoken'); | |
| const http2 = require('http2'); | |
| const fs = require('fs'); | |
| /* | |
| Read p8 file. Assumes p8 file to be in same directory | |
| */ | |
| const key = fs.readFileSync(__dirname + "/{your p8 filename}.p8", 'utf8') | |
| //"iat" should not be older than 1 hr from current time or will get rejected |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const http2 = require('http2'); | |
| const fs = require('fs'); | |
| /* | |
| Use 'https://api.push.apple.com' for production build | |
| */ | |
| host = 'https://api.sandbox.push.apple.com' | |
| path = '/3/device/{you device token}' |