Member-only story

Using iOS Notifications, Cryptography and iCloud to build your own Chat App.

Mark Lucking
6 min readFeb 18, 2020

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.

Finally I need say I already cover iOS notifications in another series, for which the I link in here. I’ll be using the code developed with it hence the mention.

On to the plan. One of the central pillars mentioned in iOS notification is the generation of the 64 character string that is linked to your idevice, a string that is used to identify it.

It’s a string I need to share with another users to start a notifcation conversation, indeed a meeting :). We can upload it to the public icloud directory of the app, but it feels a little too loosey goosey. No I need a tad more security. Not to mention the fact that typing in a 64 character address isn’t going to be too user friendly.

So lets create a simple directory, within it we’ll store a nickname and a public key linked to it. We’ll also have a second database that we’ll store the name again and a private key within. The former we’ll keep in the public cloud database, the later in the private cloud database. We’ll have one more database that we’ll use to mediate the conversations. A database that will contain the link the…

--

--

Mark Lucking
Mark Lucking

Written by Mark Lucking

Coding for 35+ years, enjoying using and learning Swift/iOS development. Writer @ Better Programming, @The StartUp, @Mac O’Clock, Level Up Coding & More

Responses (1)