Member-only story
Using iOS Notifications, Cryptography and iCloud to build your own Chat App V
I should start this article with a disclaimer, it based on iOS 13, Swift 5 and Xcode 11.x. If you reading this and those numbers look dated, be forewarned.
I should also warn you that notifications and iCloud code, involve Apple’s infrastructure which means you will need an Apple Developers account to use them.
Obviously this is part V, you need to go back to the beginning for it to make any sense, indeed you need to look at the notifications series before do that else your struggle, yes I am sorry, but we’re talking about 10 medium articles with an average 4 minute read each, so 40 minutes before you get here. 40 minutes that is not including cut’n’paste and debugging time :) but hey wait … you’ll have kick a**e chat app by that point. Imagine in less an hour you could have built your own alternative to whatapp.
Ok, hopefully that preamble didn’t completely put you off and you’re still here. Before I continue coding, some open thoughts.
We left off at a crash site. Did you figure out what the bug was. It was the sequence. If you choose a person to message before they had logged into another device, it picked up the wrong public signature, an old one which at worst crashed the app, at best left you in dark aka it didn’t work.
Now we can fix the crash, but the problem remains. One of you has an old signature and even worst you sent an invite using it. What is the fix.