Example of using Firebase PushMessages in iOS
- Add these pods to your project
pod 'Firebase/Core'
pod 'Firebase/Messaging'
-
Add
GoogleService-Info.plist
file to your project -
Copy AppDelegate+Firebase.swift file to your project
-
Add next code to your AppDelegate
didFinishLaunchingWithOptions
method:
initNotifications(application: application)
-
Add fcm token handling (storage / sending / etc) logic into
didReceiveRegistrationToken
method -
And add this method to your AppDelegate file:
internal func openNotification(userData: PushNotification) {
// Push handling here
}