Strange behaviours receiving notifications from firebase on iOS - ios

I have a project with two iOS apps configured on iOS. First I created one app on firebase console, downloaded the configuration file (Google-services.plist), subscribed to a topic, and tried sending notifications from firebase console with success. Then, in the same XCode project, I changed the bundle identifier and the google-services.plist info with the info from another app. I deleted the app from the phone, made a clean and a build on the XCode project and tried to send notifications. I have no success, so I started making experiments.
After a while, I realized that I can send notifications to the device and to the topic so I tried sending notifications from the old app and then I realized that, strangely, I can receive notifications from the old app instead of the configurated app. It has no sense since the new app has a different bundle and a different google-services.plist pointing to the new bundle. Which could be my mistake?

Finally I found how to solve this. It seemed like Firebase notification server was the cause, so I deleted the two projects, created again and upload the .p12s again. Now all is working properly. I wrote these lines to help people with the same problem since I didn´t found anything similar on internet.

Related

FireBase Test Not Sending Notifications

I am working with a Vanilla React Native project that uses Expo Modules (NOT built on Expo) and I am trying to hook up Firebase Push Notifications. I followed the instructions here and it seems like everything should be working. I get the Firebase Token as expected, and there are no firebase errors in the console. The Notifications Permissions pop up appears when I run it on an emulator, letting me know that it's properly configured on Apple's side of things.
The kicker is that I had everything working, but I needed to create a new Firebase project because I changed the App's Bundler ID. Since you cannot edit the Firebase Projects' Bundler ID's, I had to start a new project on
Firebase, but all of the code in my Podfile, AppDelegate, and other files in the code base was already there and did not need to be changed in any way. The only thing code-wise to be changed was the GoogleService-Info.plist file that Firebase provides.
However, when I extract the FCM Token and use it in the Firebase Cloud Messaging Test page, (shown below) nothing happens when I send the test message.
What can I do to try to fix this? I've gone over the steps again and again, making sure I have the proper Apple Key, Provisioning Profile, and Certificate, and that they've been properly uploaded to Firebase. I've also checked inside of Xcode to make sure that Push Notifications and Background Services were enabled, and they both were.

IOS firebase connection stuck on 'Run your app to verify installation'

I'm working on a Flutter application on both iOS and Android, for this I need to use notifications and I made it work on android successfully after some hard part ( flutter clean FTW ).
I now wanted to do the same for iOS and I have problems connecting the app to the firebase backend, I followed step by step the Tutorial on the firebase_messaging pub.dev but I can't get it to connect on the 5th and last task on the the firebase backend. It's stuck on 'Run your app to verify installation, you might need to uninstall and reinstall it again'.
Of course I downloaded the GoogleService-Info.plist and put it next to info.plist and I've added the FirebaseAppDelegateProxyEnabled key as well as this code in the AppDelegate :
if #available(iOS 10.0, *) {
UNUserNotificationCenter.current().delegate = self as? UNUserNotificationCenterDelegate
}
I also made sure to activate the push notifications and background modes capabilities on Xcode.
But somehow it still doesn't work at all and stuck on the same message, yet I can use the firebase tool to get the user Token for example ?!?!
I also made the call so that the user enable the app to get notifications.
Here's my flutter doctor :
Can anyone help me with this? I found a lot of issues on GitHub for this but no clear answer have been given yet. I don't have any error message or really anything more that could help identify what's wrong there.
Thanks a lot in advance
So, after a lot of time i finnaly did get notifications on my IOs device, since i had the firebase Token of the Iphone, i managed to send a notification to this deveice even thought it still isn't connected to the firebase backend.

Notification status suddenly "undetermined" for all builds

I am building an ejected Expo app (React Native w/ ExpoKit), and have recently run into an issue with notifications. I had them working previously with no issue, but recently, that suddenly changed, even though I didn't change anything relating to the notifications. Note that I am only using local notifications.
Anytime I try to add a notification, I get an "undetermined" status code, thus I can't add register notifications. This happens in the simulator, app built on device, and app distributed through TestFlight.
I tried downloading an older app version from TestFlight that had worked no problem before, but now I get the "undetermined" code on that version to! Does this mean that my device is the issue?
Thanks for any help you can give.
I figured out the answer. I did not have push notification entitlement configured, and adding that seemed to fix the issue. I’m still unsure why it worked before and suddenly stopped though.

Why the Flutter phone authentication won't work my real device

I have encountered a strange problem. I'm using the Flutter tool to create my iOS app which requires Firebase phone authentication. I was able to make it work on the other app platform without any fuss, but I'm not able to make it work on iOS real device. As per the documentation, I have to register an APN key from the developer account which I did and added my app's bundle ID too. This key I had to upload in my app console in Firebase which I also did. The REVERSE_CLIENT_ID was entered in the project settings in Xcode too, so the simulator version works flawlessly.
However, when it came to make it work on the real iPhone, I get this issue
flutter: exception code verifyPhoneNumberError message Invalid token.
I just am not able to make out what the issue is. One thing to note is that I had created a native Swift version using same APN key with different App ID for test purpose. Could this be a cause? Should I create a new APN key and will that allow my old App ID?
I got it working by doing a couple of things. I don't really know which one is the actual reason of it working, but along with official docs, I also followed this blog post https://medium.com/flutter-community/flutter-adding-sign-in-with-google-and-phone-authentication-to-your-app-69f681518f9b for help and achieved it due to the blogger's additional help when asked.
Basically I created a new APN key altogether for both push notifications and Firebase phone authentication, then uploaded in Firebase console (removing my old one). Later, the blogger suggested I also enable Background modes for remote notifications in my Xcode project settings. I didn't know this, as I had thought the Push Notifications switch was enough. Anyhow, bam! it started working.

Firebase Cloud Messaging Push Notificartions don't arrive on iOS anymore

I have a problem with Firebase Cloud Messaging on iOS. I have implemented Firebase into the app like stated in the docs and a Firebase instance id is generated. However, if I try to send a push notification (for example using http://pushtry.com/), nothing happened. The thing is, it did work, and I don't remember changing anything to do with notifications.
Because I couldn't find anything, I even tried deleting the whole project and doing everything again from scratch (by copying the code). Then it worked again, but now (an hour later) again, it again doesn't work.
If I send a FCM from pushtry or from the Firebase Console, it says the message is delivered, but nothing happens! (Push notifications are enabled in the iOS Settings. It did work)
I really don't know what to do. Does anybody know about anything I could do?
Thank you in advance.
Okay after two whole days of utmost frustration, I figured it out.
The problem was the line FirebaseAppDelegateProxyEnabled set to NO in the info.plist file.
After I removed the line, the problem was gone!
I am so relieved right now
set parameter content_available to true
In my case, I had migrated my Apple account and forgot to configure both my Apple and Firebase account correctly.
Apple side
Make sure that "Push Notification" is enabled for that app id.
Make sure that you had created "Apple Push Notification service" certificate and attached to the Apple Id.
Create an Authorization Key that will be later updated load Firebase so it can communicate with Apple servers in your behalf. (link)
Firebase side
Make sure your iOS apple bundle is set correctly in your Firebase project
Upload the Authorization key you created before in Apple - Step 3 above. (link)
Follow all the steps to have the iOS app integrated with Firebase SDK
That is it.

Resources