How to add new Firebase Crahlytics SDK to your iOS project?

Now a days Fabric is sending notice for migrating, as I got email today about [FINAL NOTICE] Fabric is shutting down May 4, 2020. We can move to the new Firebase Crashlytics SDK.

Integrating the new Firebase Crashlytics SDK is quick and easy. Let’s take a look.

Read more

Push Notifications in iOS 10 [Objective-C]

Push Notification iOS10
Push Notification iOS10

The new framework called “UserNotifications” is introduced with iOS 10 SDK. The UserNotifications framework (UserNotifications.framework) supports the delivery and handling of local and remote notifications. So, Let see what we have to change to get the push notifications in iOS 10.

Steps for implement code to handle push notifications in iOS 10

Import UserNotifications.framework in your AppDelegate file

Also add UNUserNotificationCenterDelegate.

Register for push notification

Before registration check the version of iOS and then based on versions do the code. For iOS 7 code was different, fro iOS 8 & 9 code was different and again for iOS 10 code is different.

As per my opinion you have to set the deployment target to iOS 8 or iOS 9 and later. For this you can check the adoption ratio of iOS in the devices.

Define constant for version check :

Add code in your did finish launching

Handling delegate methods for UserNotifications

You will be surprise that notification displayed when application in foreground too in iOS 10. As we know that in old versions we display alert or something else which will be look like notification comes in foreground.

There are two delegate methods need to be handled :

Add Push Notifications Entitlements

Go to your project target’s Capabilities tab and add Push Notifications Entitlements.

Push Notifications Entitlements

If it’s available in your certificates then it will enable directly else configure your profile with the certificates and you can enable this capability by that.

All Done!

Happy Coding ?

I have added sample code of objective-c on github with iOS 8, 9 and 10 support of push notification.
I have also posted about Push Notifications in iOS 10 [Swift].