Firebase Cloud Messaging for iOS: Push Notifications | raywenderlich.com

Learn how to use Firebase Cloud Messaging to send and receive remote push notifications in your SwiftUI iOS app.


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/20201639-firebase-cloud-messaging-for-ios-push-notifications

Hey Andy,

Firstly thanks for share this good article but I have a problem with the push notifications. I’ve followed tutorial %100, same code, same environment but push notification is not receiving. When I test it with a manual tester(desktop app) it works, I copy and paste all code but no change for works. I am stack overflowing right now and If I find the problem, I will share it here.

[+] p8, key, membership id is ok
[+] code is same as %100
[+] fcm dashboard settings are ok

Are there any missing points that I may miss?

Hey @eelia,

Have you also ensured the plist includes the necessary entries for push notifications? When you install the app fresh on a physical device, you’re getting the notification permission alert?

Hey @macandyp

Thanks for your quick reply :slight_smile:

Yes, actually I checked again after your reply, I’ve added FirebaseAppDelegateProxyEnabled.

After the situation, I created a project from scratch for nonswiftui. I set the project by looking at some tutorials over the medium. It worked but every notification received after 5-10 min :confused:
Any idea about this?

By the way, I make work final project but it has same problem :confused:

I am planning to create a new Gmail account for the new firebase account because the problem seems so meaningless.

What do you think?

And another question, in another tutorial, Background Fetch, Remote Notifications and Background Processing has selected but in the article did not select. Are these important for remote notifications?

Hey @macandyp

I’ve solved the problem and found the missing part finally.
After .p12 certificate creation and upload, it worked like charm. However, I could ask a question about the situation. Is the p12 file necessary anymore? In other scenarios with just key upload a.k.a p8 file it did not work but I’ve added p8 & p12 file and it worked.

Thanks in advance

@eelia, wish I could tell you, but I’m not sure why it worked out for you. I’ll see if I can’t find any more information for you, though.

Hi Andy, I have followed the tutorial, I get the push notifications, but when I send the images from Firebase they don’t come through. I have checked the code and it all looks ok. Any idea where I’m going wrong?

Fixed it. I had to upgrade my phone to iOS 14.5.1 for it to work.

Hey Andy, thanks for the tutorial. I’ve followed a few of your tutorials before and they’re always great. This isn’t quite the use case I was looking for however. I’m looking to automate push notifications to users when another user interacts with them socially to drive them back to the app, when a user follows another for example. Is there a similar solution to the one shown here? If not, any content suggestions covering this topic would be GREATLY appreciated. Thanks again!