raix-push
raix-push copied to clipboard
Anyone got this working with the new Apple p8 files
Hi, the current params are dependent on the old p12 based certs, Apple does to issue those any more. Wondering if anyone else has got this working with the new p8 files?
@adamgins I think we might have to bump the apn module version - there are a couple of breaking api changes around v2.0.0 https://github.com/node-apn/node-apn/releases
@raix yep just looking at https://github.com/node-apn/node-apn it takes a whole bunch of the new params... eg
var options = {
token: {
key: "path/to/APNsAuthKey_XXXXXXXXXX.p8",
keyId: "key-id",
teamId: "developer-team-id"
},
production: false
};
I will take a crack at it and see if I can fix. I am hoping it may be simple to get APN up and running again...
BTW, there is another thought of using something like Firebase (FCM), which can now send to both APN and FCM/GCM... but that probably more of a fork??? ala https://github.com/fechanique/cordova-plugin-fcm
https://github.com/raix/push/tree/chore/upgrade-apn-v2
@adamgins I've added a branch with the initial stab - please crack on (I'm out today and tomorrow - my birthday)
re FCM I think it would be a really nice thing to get in, (GCM is deprecating in favor of FCM right?)
@raix you're "da man!!!" happy birthday :-) and Happy New Year!!!
re: FCM yes... when I logged into FCM all my GCM stuff was there
@raix I cloned and just put into my packages
to see if I could get working and hack as necessary
I changed apn.Device
to apn.Provider
in var myDevice = new apn.Provider(userToken);
at https://github.com/raix/push/blob/master/lib/server/push.api.js#L187
I am getting this error Push: Could not send notification id: "ab4ikEykgKAk83RyZ", Error: ENOENT: no such file or directory, open 'cert.pem'
Seems related to this deep in the included NPM modules https://github.com/node-apn/node-apn/blob/master/test/config.js#L22
I was a bit confused that we still needed to include
cert: Assets.getText(some_cert.pem'),
key: Assets.getText('some_key.pem'),
I thought these were redundant with the new settings, anyway
My config is
Push.Configure({
apn: {
token: {
key: Assets.getText('APN_PUSH.p8'),
keyId: '<mykey>',
teamId: '<myteamid>',
},
// passphrase: 'amonkey-surfer',
//production: false,
//gateway: 'gateway.push.apple.com',
},
gcm: {
apiKey: '<gcmkey>',
},
cert: Assets.getText('<my>_cert.pem'),
key: Assets.getText('<my>_key.pem'),
production: false,
'sound': true,
'badge': true,
'alert': true,
'vibrate': true,
// 'sendInterval': 15000, Configurable interval between sending
// 'sendBatchSize': 1, Configurable number of notifications to send per batch
// 'keepNotifications': false,
//
});
I ended up at https://github.com/node-apn/node-apn/blob/master/doc/provider.markdown and it still seems like cert
and key
are required, phew in to the APN gorp of creating keys and certs again :-/ This seems even more complex than before... been a long day, trying to get my head around this.
@adamgins did you mean to say that Apple doesn't issue p12 any more? I am not able to find any info on that. What I see however is that FCM requires p8 which is easily converted from p12. Were there any announcement of discontinuation of p12 certificates?
can anybody confirm if p12 is obsolete? I haven't found anything about it anywhere like @paulincai mentioned. As that might be something causes my problems to send push notifications thru APN.
@twentyfortysix is this a project that worked fine and stopped working or is it something that you're developing now and can't send out via APN?
New project that I have never been able to setup for APN. I made a small demo, with the description.. #350
As fr as I remember, you need to "distribute" your app. Can you do a ad-hoc distribution and put it in testfairy or other place and try again. For some reasons I know that you can only receive in IOS with a production app.
Thanks for help. I tried it via TestFlight. no luck so far.
I have some time for you if you want to go on a chat: paulailincai in skype
I have some time for you if you want to go on a chat: paulailincai in skype mine is o----o. I have sent you request a minute ago