Posts

Showing posts from August, 2016

Apple Store Passbook UML Diagrams and Error Messages

Image
While working on a recent project, a major stumbling block was a lack of clear documentation of what happened where. This was confirmed when I attempted to search for some of the messages returned to the Log REST points by iPhone.. There were zero hits!     In terms of a Store Card, let us look at the apparent Sequence Diagram     Log Errors Messages Seen and Likely Meaning Passbook Inactive or Deleted or some one changed Auth Token [2016-08-28 11:57:01 -0400] Unregister task (for device ceed8761e584e814ed4fe73cbb334ee9, pass type pass.com.reddwarfdogs.card.dev, serial number 85607BFE98D91A-765F7B05-D5E4-4B32-B16D-69C2038EF522; with web service url https://llc.reddwarfdogs.com/passbook) encountered error: Authentication failure [2016-08-28 20:44:25 +0700] Register task (for device 19121d6b570b31a3fa56dbd45411c933, pass type pass.com.reddwarfdogs.card.dev, serial number 85607BFE98D91A-765F7B05-D5E4-4B32-B16D-69C2038EF522; with web service url https:

Solving PushSharp.Apple Disconnect Issue

While doing a load test of a new Apple Passbook application, I suddenly saw some 200K transmissions errors from my WebApi application. Searching the web I found that a “high” rate of connect/disconnect to Apple Push Notification Service being reported as causing APNS to do a forced disconnect.   While Apple does have a limit (very very high) on the number of notifications before they will refuse connections for an hour, the limit for connect/disconnect is much lower. After some playing around a bit I found that if I persisted the connection via a static, I no longer have this issue.   Below is a sample of the code. Note : we disconnect and reconnect whenever an error happens (I have not seen an error yet)    using Newtonsoft.Json.Linq; using PushSharp.Apple; using System; using System.Collections.Generic; using System.Security.Cryptography.X509Certificates; using System.Text; namespace RedDwarfDogs.Passbook.Engine.Notification {     public class AppleN

Taking Apple PkPasses In-House–Working Notes

This year I had a explicit, yet vague, project assigned to me: Move our Apple PkPass from a third party provider to our own internal system. The working environment was the Microsoft Stack with C# and a little googling found that the first 90% of the work could be done by nuget, namely: Install-Package dotnet-passbook Install-Package PushSharp Created a certificate file on the apple developer site and we are done … easy project… not quite   Unfortunately both in-house expertise and 3rd part expertise involved in the original project had moved on. Welcome to reverse engineering black boxes.   The Joy of Certificates! Going to http://www.apple.com/certificateauthority/   open a can of worms. The existing instructions assumed you have a Mac not Windows 10. The existing instructions found on the web( https://tomasmcguinness.com/2012/06/28/generating-an-apple-ios-certificate-using-windows/ )  broke due to some change with Windows or Apple in April 2016 ( apple forum