A server-side library for sending Push Notifications to iOS (iPhone/iPad APNS), Android (C2DM and GCM - Google Cloud Message), Windows Phone, Windows 8, Amazon, Blackberry, and (soon) FirefoxOS devices!
I've recently implemented our notification service for Passbook and after much tinkering/headaches I believe I've found an issue with Pushsharp for this type of notification.
The issue being that the connection to the APNs (when sending a Passbook Notification only) needs to use the Certificate that has been used to sign the Pass, as this has the pass type identifier embedded within it. Using the standard APNs certificates always successfully sent my notifications, but they were never received by Passbook on the handset. It also always needs to use the production server since there is no concept of a dev/ production pass identifier, there's just a production one.
So, I downloaded the source and altered the following file PushSharp.Apple.ApplePushChannelSettings, altering the CheckProductionCertificateMatching method where the production certificate subject is checked from:
if (production && !subjectName.Contains("Apple Production IOS Push Services"))
throw new ArgumentException("You have selected the Production server, yet your Certificate does not appear to be the Production certificate! Please check to ensure you have the correct certificate!");
to:
if (production && !subjectName.Contains("Apple Production IOS Push Services") && !subjectName.Contains("Pass Type ID"))
throw new ArgumentException("You have selected the Production server, yet your Certificate does not appear to be the Production certificate! Please check to ensure you have the correct certificate!");
This allows the use of the Passkit certificate and I am now able to connect to the APNs and my device is receiving passboook updates.
Hopefully that all makes sense, and aside from my headache from the last day, Pushsharp is working like a charm, so thanks for that!
Hi
I've recently implemented our notification service for Passbook and after much tinkering/headaches I believe I've found an issue with Pushsharp for this type of notification.
The issue being that the connection to the APNs (when sending a Passbook Notification only) needs to use the Certificate that has been used to sign the Pass, as this has the pass type identifier embedded within it. Using the standard APNs certificates always successfully sent my notifications, but they were never received by Passbook on the handset. It also always needs to use the production server since there is no concept of a dev/ production pass identifier, there's just a production one.
So, I downloaded the source and altered the following file PushSharp.Apple.ApplePushChannelSettings, altering the CheckProductionCertificateMatching method where the production certificate subject is checked from:
if (production && !subjectName.Contains("Apple Production IOS Push Services")) throw new ArgumentException("You have selected the Production server, yet your Certificate does not appear to be the Production certificate! Please check to ensure you have the correct certificate!");
to:
if (production && !subjectName.Contains("Apple Production IOS Push Services") && !subjectName.Contains("Pass Type ID")) throw new ArgumentException("You have selected the Production server, yet your Certificate does not appear to be the Production certificate! Please check to ensure you have the correct certificate!");
This allows the use of the Passkit certificate and I am now able to connect to the APNs and my device is receiving passboook updates.
Hopefully that all makes sense, and aside from my headache from the last day, Pushsharp is working like a charm, so thanks for that!
Cheers