Hi Vicky. Noticed that this post actually existed before. I added in an answer. Next time, please avoid delete-reposting a question. Give some time for other users to see it and give opportunity for other new questions to be seen. Cheers! :)
– AL.Feb 7 '17 at 6:41

For GCM - iOS, something similar needs to be done (with further settings needed to connect with APNs). See the official documentation -- Setup a GCM Client on iOS. The guide can be adjusted for Objective-C or Swift.

With that said, the code you referred to is under the section labeled APNS Sample Usage, so I guess it's also safe to refer to this post. Or directly from the Apple Developer site if you plan to directly use APNs without GCM.

PS: If you intend to use GCM, I would strongly recommend that you proceed with using the newer version, which is firebase-cloud-messaging. Official docs here.