This is the fourth article in series which describes how to set up Firebase push notifications with Flutter framework. In the last blog post we have covered how to set up Android for receiving push notifications in Flutter.
Table of Contents:
- How To Configure Push Notifications With Flutter
- Wordpress Set Up For Flutter Push Notifications
- Android Set Up For Flutter Push Notifications
- iOS Set Up For Flutter Push Notifications
Please note that this tutorial applies only to building apps with Flutter Deco News app template.
In this blog post we will cover how to set up receiving iOS push notifications with Flutter framework. Navigate back to Firebase Console where we left in the first article from this series. At the bottom of project settings page you will have a list of added applications.
Step 1. Click on iOS button to add iOS application to your Firebase project.
Step 2. Fill out iOS bundle ID and optionally add application name.
Step 3. Download GoogleService-Info.plist file.
Step 4. Click "Continue".
Step 5. Please note that for iOS, additional steps are needed and that we are still not ready to start receiving push notifications on iOS.
Step 6. Navigate to https://developer.apple.com and login with your Apple ID. You will need to enroll in the Apple Developer Program if you didn't already. After you are logged in click on "Certificates, IDs & Profiles" menu item.
Step 7. Navigate to "Keys" page from the left side menu. In the top right part of the screen you can find you Team ID, save it. Click on "Create a key" button next.
Step 8. Fill out key name, mark checkmark next to "Apple Push Notifications service (APNs)" and click on "Continue" button.
Step 9. Click on "Register" button.
Step 10. Save key ID from this page, and make sure to download key file. Click "Done" next.
Step 11. Go back to Firebase and click "Upload" to add your key file to Firebase.
Step 12. Upload key and fill out Key ID and Team ID fields.
Step 13. With this step we have finished the configuration of Firebase.
Step 14. Add downloaded "GoogleService-Info.plist" file to your project.
Step 15. Using xCode open "Runner.xcworkspace" file from ios folder of your project. Make sure that you are opening ".xcworkspace" and not ".xcodeproj" file.
Step 16. On the left side, right click on "Runner" folder and select Add Files to "Runner" options. Browse to "GoogleService-Info.plist" file location.
Step 17. "GoogleService-Info.plist" file should show up.
Step 18. Open Capabilities, scroll down to "Push Notifications" and click on toggle button to enable it.
Step 19. Under Capabilities also make sure to enable Background Modes with "Background fetch" and "Remote notifications" options.
Now you should have everything configured for receiving push notifications on iOS.