Receiving multiple Duplicate Push notifications from Firebase - ios

I am facing a serious issue, I am receiving multiple push notifications from the server? Even the server is sending once.
I read on stackoverflow different posts that its due to calling
application.registerForRemoteNotifications()
I checked and debugged the app, this method is calling only once in the AppDelegate.
Any suggestion will be helpful for me?

-There are certain reasons behind this issue, most of the solutions are "call once in the app "registerForRemoteNotifications".
First, check if you are not calling this method more than once in AppDelegate
-In my case, I debugged and checked my code, I am calling only once the above method.
from this link I realized, during development, I am again and again pulling "ipa" to the phone, let's check this solution if it works
First Uninstall your app from the phone
Install the app again, and check by sending push again
Now, in my case everything is just fine now, Xcode has this bug started in iOS 9 and till iOS 11, developers facing this issue. I hope if these above two solutions help you in understanding the problem.

Related

Firebase push notifications for Apple stopped working

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.

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.

Strange behaviours receiving notifications from firebase on 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.

iOS Push Notification Banner shown twice for a single Push

I've noticed that sending a Push notification results in the following behavior:
See how the banner is shown a second time, after a short delay?
At first I thought that our backend was mistakenly sending 2 push notifications, one after the other.
However, this appears to be default iOS behavior for a single Push notification. The banner is shown, then immediately "shown again". This results in this jittery UI shown in the gif. The banner appears to be received twice.
Tested using iOS 9.0.2.
I do not recall seeing this behavior from other apps that send me Push Notifications. Am I doing something wrong that would cause the banner to show twice?
Radar:
Engineering has determined that your bug report (23133694) is a duplicate of another issue (23130766) and will be closed.
I was experiencing the same issue, but after countless hours trying to debug, I realized that I was calling registerUserNotificationSettings(settings) twice in didFinishLaunchingWithOptions:. Verify that you're not doing the same
Are you sure you are doing all your setup right?
if you will provide more code it will be easier to find the bug. It's definitely not an iOS bug.
Basic things to check when you have trouble with server notifications:
1. Check your provisioning profile and clean up all unused certificates.
2. Be sure your server configuration is alright. Again, more details are needed for full answer.
If you are doing this offline then usually you missed something in your code or your handler for secluded posts is called two times.
Got this issue for two devices we were using with versions ios 9.3.3 and ios 9.2. But this issue was not coming for a device running ios 8.2 and another running for iOS 10 (tested on 10.3)
Issue occurred on devices with 9.3.3 and 9.2 on every fresh install. But restarting the device seemed to fix the issue. Although that is NOT a solution we can propose to customers.
On the console logs for the system we got 'Unbalanced calls to begin/end appearance transitions for SBBannerButtonViewController' message when this occured.
This seems like an issue with some devices having 9.x versions and should be working fine for devices running iOS 10.0 and above.
Are you using database to store device id?
If yes then may be store device id two times.if possible clean db and try to send it again
I think the wrong answer is accepted here (If this is about migrating from Parse to OneSignal). Because for OneSignal there doesn't seem to by any proper solution for this. I am also looking for the solution if any one is having. The only workaround for this was, to restart the phone.
But its weird. We can't ask all the users to reboot their device.
We were facing the same issue on IOS 9.3.1
We used urban airship for managing notifications and this was our setup
let config = UAConfig.default()
UAirship.setLogging(false)
UAirship.takeOff(config)
UAirship.push().userPushNotificationsEnabled = true
UAirship.push().notificationOptions = [.alert, .badge, .sound]
UAirship.push().backgroundPushNotificationsEnabled = false
UAirship.push().pushNotificationDelegate = self
After many attempts we simply removed the following line and it worked!
UAirship.push().notificationOptions = [.alert, .badge, .sound]
I hope this will help someone.
I know this answer is a couple years after the original post, but in case this helps anyone...
In my case, I was using CloudKit notifications and had accidentally created two subscriptions that tracked the same record type!
According to this answer on a similar question, this issue was reported as rdar://23569779 and should be fixed in the iOS 9.3 public release.
Please leave a comment if you reproduce this issue in iOS 9.3+
Supposedly fixed in:
iOS 9.2.1 beta (Build: 13D11)

IOS9 Push notifications dialog appears after delete and launch app with xCode7

I have an application, it uses APNS, so I have code that subscribes to notifications, and everything works fine. But every time I reinstall app, and run it with xcode, I get allow push notification dialog. Every time.
I found hundreds questions about how to achieve this dialog again, but none - how to stop achieving them. I need help!
It's seems known IOS9 bug, here is a link for developer forum and still no response from apple and no solution:

Resources