Xamarin.iOS push notifications – part I

As I said in post about push notifications in Android, I wanted to show you how to configure notifications in your iOS project for development. All you need is valid Apple developer account, Apple machine and Apple mobile device for tests. Configuration is quite complicated so if you want to do it in your own project I recommend you to follow my steps.

Open your Apple developer account and open Certificates, Identifiers & Profiles section. Add new App ID.

Specify a name of your application,

and bundle ID

Then select Push Notifications from available app services.

 

Click Continue and confirm application by clicking Register.

Now we need to generate certificate for push notifications. Open certificates section. As you can see I already have an iOS Development certificate. We will use it further so if you don’t have your own, create it.

Select Apple Push Notification service SSL (Sandbox)  in Development section.

In next step select App ID which you created previously

Then upload a CSR file. It is a CertificateSigningRequest.

Open Keychain Access -> Certificate Assistant -> Request a Certificate From a Certificate Authority.

In popup write your email and select Saved to disc option. CSR file is ready, upload it.

Click Continue , Download a certificate and Install it on your machine.

Now it is time for provisioning profiles. Open a Provisioning Profiles section and add a new one.

Select  iOS App Development option and correct App ID.

Then select your iOS Development certificate.

 

And your device. If the list is empty you have to register your device. UDID will be helpful during registration.

The last step. Name your newly created provisioning profile.

Next download it and install on your machine.

Ok, work on apple development account done.

Open Microsoft Azure portal, go to your Notification Hub component and open Notification Services section.

If you don’t have your own Notification Hub component read my post about configuration push notifications for Android – here.

Select Apple (APNS) provider.

Azure will ask you for certificate. Click Upload Certficiate.

If you installed certificate which we created previously on your machine go to Keychain Access find it and export to Desktop.

Exported certificate should have .p12 extension. Now select it, type your certificate password and upload.

Configuration is done!

In part II I will show you how to test push notifications and receive them on iOS mobile device. There will be some code 🙂

If you have some troubles during following my instructions feel free to contact me using this form Contact.
I will answer your questions with pleasure. Enjoy!

Part II released! Available here.

Leave a Reply

Your email address will not be published. Required fields are marked *