I am using cordova-plugin-fcm in an ionic project to use Firebase push notification.
The Notification is working fine for android platform, but when I added iOS platform I couldn't get any notification on my device.
Here are the things I've done:
1- I added GoogleService-Info.plist to my project and inside platforms in ios folder.
2- Enabled notification from xCode
3- I also tried to send test notification from Firebase console and it worked.
4- The back-end team fired the function that sends notification and I could received the notification on my device.
But when I test the app and try the case where notification should be received, I never get it.
I don't even know how to debug this issues. Any ideas?
it turned out to be a back-end issue not an issue in the plugin itself.
The issue in the back-end was a wrong if condition.
Related
I'm using react-native-push-notification.
I'm trying to test push notifications, if I build app and upload it to testflight it shows remote notifications just fine, but when I do it with xcode build on a real device it doesn't react at all (I'm getting onRegister call and notification token though). This problem is only on IOS, android getting notifications in production and development. Can't google anything related so probably I'm missing something.
P.S. I'm using backend to send notifications through firebase
you have to go in capaibility in xcode and active PushNotification first
for more info see this
hope you have followed all the steps to get the APNS certificate and attached that to your xcode, before the build, if not please do so.
Also, in addition you need to have .pem file to add to your Firebase to make your ios app enable to send and receive push.
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.
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.
I am trying to using firebase push notification for IONIC 1. I am able to do it successfully in android. But in iOS i am able to add the FCM plugin and build it successfully. While opening the mobile app it ask for push notification permissions also.
But, when i try to send from the firebase notification. I am not able to receive notification in mobile.I have added the .plist to the project root directory and build it.
Do i need to do any configuration for IONIC 1 iOS?
Enable Push Notification in capabilities in XCode if your are using XCode 8 or higher.
Followings from Ionic site
Note for users of Xcode 8 and higher.
If you're using the latest version of Xcode, you will likely need to activate the Push Notifications capability before your app is able to receive notifications.
To do this, simply navigate to the Capabilities section in your app's overview within Xcode and toggle Push Notifications, as seen below.
I am developing a Phonegap application for both Android and iOS and would like to enable push notifications for both.
The app is using the Phonegap plugin PushPlugin which sets it to receive notification for both Android and iOS.
I am having issue with the iOS version of the app. When running it, I get the screen asking if I want to allow the app to receive notifications, I select yes then I receive a device token which is then used on the server side to send the notification to the selected device. This was a good indication that the Phonegap plugin was working.
Server side, I am using AmazonSNS to send the notifications. (Java code of this can be downloaded here.)
With AmazonSNS I need to pass in:
certificate (created in the online iOS development center)
private key (exported from the certificate)
device token (from PushPlugin)
to send the notification.
I followed this detailed tutorial on how to get the app id, certificate, private key and provisioning profile all set up.
The problem is, after sending the notification, not only does the app not receive the notification, but sending the notification doesn't error or give me any feedback as to what might have went wrong.
I'll also point out, the Android version of the app is successfully receiving notifications using the same java code.
Any advice on what the issue here might be would be great.
Thanks
I managed to work out what the problem was.
In my server-side plugin, I was trying to connect to APNS directly, but what I should of been doing was connecting to APNS_SANDBOX.