Firebase push notifications for Apple stopped working - ios

I'm working with a pair of phone apps (Android and iOS) and I'm running into an inconsistency with push notifications between the two platforms. Android seems to have no problems. However, the Apple app will no longer send push notifications to the user, even though it used to in the past. Firebase is used for both of the apps and I'm a little lost on what might be causing the Apple version to break. I've gone through and updated versions of Firebase and checked for deprecated references, but nothing is jumping out at me as a cause (let alone fixing the issue).
I'm pretty new to Apple development (this is in Objective C) so it could be something really simple that I'm missing.
Small update on this: After looking through where and how we use push notifications I found that I'm getting an error (assumedly from firebase) stating [{"error":"InvalidApnsCredential"}]. Obviously this has to do with the way that I've implemented the credentials for APNs, but I don't know if it's something set in Xcode or Firebase itself. I've checked the auth key's Key/TeamID's and they check out, so I'm not too sure where to look next.

Related

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.

WhatsApp VoIP Push non-delivery and iOS 11

There's lots of problems with push in general in iOS 11.0n. I have two apps, one uses silent pushes and I can reproduce problems with the pushes not being delivered. Theres nothing I can do to fix it, its an Apple issue, they have changed the behavior of silent pushes and also introduced a bug with iOS 11.0.
However I also have another app which uses VoIP push. WhatsApp uses VoIP push and their users have been experiencing lots of notification issues with iOS 11.0n too:
https://whatsappen.com/news/5465/many-complaints-whatsapp-notifications-ios-11-update-solution
That link above (and WhatsApp web site states something sililar)
It’s indeed an iOS 11 bug. It is affecting users who habitually force
close their app.
I'm unable to reproduce any similar issue with my app which uses VoIP push (tried force quitting it several times).
And that's my problem - the fact that I can't reproduce it. Just because I can't reproduce it doesn't mean it doesn't affect my app.
If there is a problem with VoIP push and therefore potentially with my app's behavior I would like to reproduce it, and fix it.
WhatsApp claim they fixed their issue without waiting for a new release from Apple, so it must be something they can work around.
I would like to know if anybody knows what this VoIP push problem is with WhatsApp and what they did to fix it.

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.

GCM always returns "NotRegistered" for iOS devices

while i never had any issues with android, all my attempts for sending nofifications to iOS fail. everything is properly set up, but the gcm endpoint always returns "NotRegistered" for every iOS reg_id, even immediately after registration.
however, in 1 case it actually did work. compared to ~500 failed attempts, this seems like not working, although I did not change anything between those API requests.
has anyone ever experienced something similar?
nevermind. now it works. i didnt change anything overnight. i can only assume there were some disturbances at GCM / APNS..
edit: and it's not working again (10 hrs later). NotRegistered for every iOS registration token.
I ran into this, happened because xcode decided to use the wrong signing identity or provisioning profile (BuildSettings->CodeSigning->CodeSigningIdentity and ProvisingProfile->Automatic).
IOS uses the signature to match the push notification up to your app and if it's wrong, apple thinks that the app isn't installed or doesn't support push notifications and sends a message back to GCM telling it that the device is 'NotRegistered', which just means the app isn't installed on the device anymore.

Does Testflight no longer support in-app-notifications of new builds?

So far, my users where notified in the app without me having to do anything but call takeOff and (well here i'm not sure if this was necessary) use a few arbitrary checkpoints. They could choose wether or not they want to update their app now, later or never.
BUT apparently this has stopped working over the past few weeks, I'm receiving more and more feedback that the only way they got to know that there is an update available was through the email that is sent to them by TestFlight.
Did they replace this with "force-upgrade"? In-app update with TestFlight on iOS mentions that using force upgrade enables notifications, yet it forces them to update, which is not what i want.
Or has this something to do with the SDK 2.0 struggling with iOS7?
It's an iOS 7 issue. We're working on work arounds. Here's a help article that explains it more: http://help.testflightapp.com/customer/portal/articles/1318463-in-app-updates-are-not-working-on-ios-7-what-should-i-do-

Resources