Open vendelocky opened 6 years ago
I am having this same exact issue! I've been about to pull my hair out trying to figure out what I'm doing wrong over the last few days. I've also followed all 11 steps that you listed, and probably some other things as well. Android works great every time but the notifications are simply not received on iOS.
Only difference is that I'm using platform ios 4.5.5 and cordova 8.1.0
Glad to see I'm not the only one experiencing this. Any help would be appreciated.
I found a solution that works for me. Build and run your app using Xcode legacy system. I built the same project/workspace that I was getting an error using Xcode legacy version, and voilà! Worked perfectly! Now I'm receiving push when the app is in background and in foreground.
Xcode 10 it’s fairly easy to enable the legacy build system. Open your Xcode project or Xcode workspace, In Xcode, Select File -> Project/Workspace Setting. You will see a Build System option to select the legacy system as shown below
I hope it helps. Cheers.
@cesarak Thanks for the response! I've also seen this prove to be a solution for others across Github/Stack Overflow forums but it didn't prove to be the solution for me. I actually can't even archive the app in Xcode without using the Legacy Build System so I've been doing that for a little while.
The crazy thing is that I'm not getting any errors at all. I'm able to retrieve the device token and store it in a database with no problems. However, when I send a push notification to an iOS device (via device token) using the FCM console, pushtry.com, or a back-end server using the Firebase API, all signs point to it sending successfully but the notification just never seems to make it to the iOS device (my main testing device at the moment is an iPhone 7 running iOS 12, but this applies to other devices as well). When I do the same thing but instead I use a device token for an Android device, the notification makes it to the device without any issue.
@jkerb8 facing the same issue, there are some issues on ios 12, not able to receive notification.
@cesarak OMG! THANK YOU VERY MUCH! This actually fixed my problem! I forgot to check this since I just upgraded to XCode 10 a few days ago. I always built with Legacy Build System, but ever since XCode 10, it somehow builds as a new Build (Default). After I built it, It was still not working, But after that, I refresh everything again (turn on and off all the required capabilities), re-enter my signing code identifications, and re-add the team provisioning profile, AND I changed FirebaseAppDelegateProxyEnabled value to YES in info.plist. Just as you said, voila! now I can receive push notifications on iOS devices. You are a lifesaver, man.
@jkerb8 Hang in there buddy. I know right, I was also going crazy over this thing. My suggestion is you re-add the ios platform and the plugins, after that check back all the GoogleService-Info.plist file again, make sure they are not empty, then turn off and on back all the capabilities, and do not forget to use the Legacy Build System too. Try this to: FirebaseAppDelegateProxyEnabled value to YES in info.plist. Switch to No then Yes again for few times.
@akash-pal Keep trying to do all the steps one by one. Make sure to restart from a clean project build. That is all I did to get it works.
Also, guys, try using this plugin instead: https://github.com/andrehtissot/cordova-plugin-fcm-with-dependecy-updated . It is maintained well not like this current one, has been abandoned.
@vendelocky THANK YOU!! I removed the cordova-plugin-fcm plugin, removed the ios platform, added back the ios platform, and then added in the cordova-plugin-fcm-with-dependecy-updated plugin. I then opened the project in Xcode and followed everything else you said, including turning off and back on all of the capabilities, re-entering my signing identifications and setting the FirebaseAppDelegateProxyEnabled value to YES in info.plist. And BOOM it's fixed!
I can't thank you guys enough!
@jkerb8 Glad to hear that it is working for you now! Cheers, buddy!
@akash-pal Let me know your update or else I am going to close this issue. Hope you can solve it too!
really thank you your steps are useful for me but i stuck in apns key because i use free apple developer account ...any one can help me that really i should have a paid apple developer account to get the apns certificate and no other way ??? :( thanks in advance
@ShaimaaKhamees I'm almost positive you need to have access to a paid Apple Developer account in order to use push notifications and almost everything else in the iOS world with the exception of testing on a local device. If you are planning to publish your app to the App store you'll have to pay anyways. I wish they didn't require a paid subscription but it is what it is.
Click here for FCM notification integration in swift
@vendelocky seems to have solved his problem. I recognise his problem and it has been driving me nuts, too. In several days. The plugin seems smooth and solve a problem easily and it is welldocumented. Run conditions seems to be important. My breakthrough came when I in Firebase added "APNs Authentication Key". Firebase notice that it only is recommended. But added enabled the IPhone to receive notification. :-) Morten
I had the same issue, turns out I was missing the iOS pod file includes mentioned here:
pod 'Firebase/Core'
pod 'Firebase/Messaging'
Hope it helps the next dev burning hours on this
Anyone who still is having trouble with this, please make sure that you are not using the phone number that you have added to the firebase console Sign In Method (phone) for testing. If you are using the same number and are not receiving push notifications, then it is automatically signing you in and does not recognize that you expect to receive a push.
I found a solution that works for me. Build and run your app using Xcode legacy system. I built the same project/workspace that I was getting an error using Xcode legacy version, and voilà! Worked perfectly! Now I'm receiving push when the app is in background and in foreground.
Xcode 10 it’s fairly easy to enable the legacy build system. Open your Xcode project or Xcode workspace, In Xcode, Select File -> Project/Workspace Setting. You will see a Build System option to select the legacy system as shown below
I hope it helps. Cheers.
Thanks it works
I found a solution that works for me. Build and run your app using Xcode legacy system. I built the same project/workspace that I was getting an error using Xcode legacy version, and voilà! Worked perfectly! Now I'm receiving push when the app is in background and in foreground.
Xcode 10 it’s fairly easy to enable the legacy build system. Open your Xcode project or Xcode workspace, In Xcode, Select File -> Project/Workspace Setting. You will see a Build System option to select the legacy system as shown below
I hope it helps. Cheers.
I did all the above but did not work for me.
I had to change Code Signing Identity from iOS Developer to Apple Development. It worked.
@vendelocky : sir FirebaseAppDelegateProxyEnabled value to YES in info.plist option not showing my in info.plist can you tell me sir why its not showing?
@cesarak OMG! THANK YOU VERY MUCH! This actually fixed my problem! I forgot to check this since I just upgraded to XCode 10 a few days ago. I always built with Legacy Build System, but ever since XCode 10, it somehow builds as a new Build (Default). After I built it, It was still not working, But after that, I refresh everything again (turn on and off all the required capabilities), re-enter my signing code identifications, and re-add the team provisioning profile, AND I changed FirebaseAppDelegateProxyEnabled value to YES in info.plist. Just as you said, voila! now I can receive push notifications on iOS devices. You are a lifesaver, man.
@jkerb8 Hang in there buddy. I know right, I was also going crazy over this thing. My suggestion is you re-add the ios platform and the plugins, after that check back all the GoogleService-Info.plist file again, make sure they are not empty, then turn off and on back all the capabilities, and do not forget to use the Legacy Build System too. Try this to: FirebaseAppDelegateProxyEnabled value to YES in info.plist. Switch to No then Yes again for few times.
@akash-pal Keep trying to do all the steps one by one. Make sure to restart from a clean project build. That is all I did to get it works.
Also, guys, try using this plugin instead: https://github.com/andrehtissot/cordova-plugin-fcm-with-dependecy-updated . It is maintained well not like this current one, has been abandoned. @vendelocky how do you (turn on and off all the required capabilities). Could you provide steps for this, please?
Been few days stuck with this problem (again!). FCM push notification works fine on Android and on my current live/prd version of the app (still running and working well). But recently I upgraded to cordova 7.1.0, platform ios 4.4.0 and re-add all the plugins for my next update of the app.
Everything works well except this FCM on iOS!!!! Not working for all version and all iOS devices. I had this problem before, but it was an easy fix (missing GoogleService-Info.plist file on FCM plugin). But currently this problem appeared again and I really have no idea how to fix it. Been going through lots of questions and tried lots of things.
Steps that I have done:
openssl s_client -connect gateway.push.apple.com:2195 -cert pushtry.pem -key pushtry.pem
and return verify code 0(OK) at the endI run the app from Xcode 10 with multiple iPhone ranging from iOS 11 to 12. All cannot receive the push notifications. But when I download my app from play store, it is still receiving push notification. the FCM plugin version is cordova-plugin-fcm 2.1.2.
Please help! What should I do and check beside all of those mentioned above? I need to update the app soon. But I am scared after the update, all the live version with the newly updated app will not be receiving push notifications, which is very crucial for our app!
I am suspecting the mismatch of the provisioning profile with code signing identity, but I have never changed them for 1 year+ already (only update and recreate the cert once it is expired). I do not think it is the problem from FCM because it sent out the push notification and no problem on android. But then again, the last update of my app was 2 months ago.After that I rarely check on iPhone (especially push notification) because I don't have one. Always doing my dev with Android phone. So maybe I missed out something? Advice and solution, please? Thanks in advanced!
All version of my app on my development (my local MAC) is not working now. Even if I try to build and run the older version of my app. The push notifications are not being received. So maybe my cordova or iOS problem. Please anyone, help me~ Thanks!