Created
September 3, 2012 19:01
-
-
Save a-bx/3612393 to your computer and use it in GitHub Desktop.
APNS - Create Conncectino
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
| var apns = require('apn'); | |
| var options = { | |
| cert: __dirname + '/../config/keys/aps_cert_' + env + '.pem', | |
| certData: null, | |
| key: __dirname + '/../config/keys/aps_key_' + env + '.pem', | |
| keyData: null, | |
| gateway: env == 'production' ? 'gateway.sandbox.push.apple.com' : 'gateway.sandbox.push.apple.com', | |
| port: 2195, | |
| enhanced: true, | |
| errorCallback: function(errorCode, note){ | |
| util.debug('ERROR APNS ' + errorCode + " : " + note); | |
| }, | |
| cacheLength: 5 | |
| }; | |
| var apnsConnection = new apns.Connection(options); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment