andrehtissot / cordova-plugin-fcm-with-dependecy-updated

Google FCM Push Notifications Cordova Plugin
MIT License
210 stars 273 forks source link

Push Notification Not Working On iOS with cordova-plugin-fcm-with-dependency-updated . #309

Open vivekkumarbiswal opened 10 months ago

vivekkumarbiswal commented 10 months ago

Hello @andrehtissot & all i am facing problem with push notification with iOS application but its completely working fine with android (i have build an ionic cordova hybrid application). I think the push notification was working fine before i updating iOS 16.1 SDK (xcode 14.3).

Issues i m facing while building: (ionic cordova build ios --configuration production --release)

Screenshot 2023-08-28 at 15 14 27

but when i do edit the pod file with a specific version ~> 7.4.0 (Firebase/Messaging version) and do pod install and then build it again then it got build successfully without any error and all functionality is working perfectly in the application but the push notification is not working.

Note: if i m putting any other versions except 7.4.0 the pod install is getting succeeded but the build is getting failed.

Pod File:

Screenshot 2023-08-28 at 15 12 03

to

Screenshot 2023-08-28 at 16 48 20

pod install:

Screenshot 2023-08-28 at 17 12 49

node version: v14.17.3

npm version 6.14.13

cordova version 11.1.0

ionic version 5.4.16

Pod version(cocoapods) 1.11.2

System: macOS Ventura (13.2.1) Xcode 14.3

Thank you!

carlo318 commented 10 months ago

I am also working on a Ionic (hybrid) APP and this plugin is working fine on Android. On IOS it is compiled successfully, but the notifications no more arrive on Apple devices. It was working fine until mid August 2023. Is it anything changed on Firebase side?

vivekkumarbiswal commented 10 months ago

Hello @carlo318 its the same case with me also. I tired finding on firebase side but didn't get anything there.Please let me know if you get any solution to this issue, It will be a great help.

Thank you !

carlo318 commented 10 months ago

Hi @vivekkumarbiswal finally I solved with these 2 actions: 1) reinstalling the plugin with ALL the parameters suggested in the ReadMe:

ionic cordova plugin add cordova-plugin-fcm-with-dependecy-updated --variable ANDROID_DEFAULT_NOTIFICATION_ICON="@mipmap/ic_launcher" --variable ANDROID_FIREBASE_BOM_VERSION="26.0.0" --variable ANDROID_GOOGLE_SERVICES_VERSION="4.3.4" --variable ANDROID_GRADLE_TOOLS_VERSION="4.1.0" --variable IOS_FIREBASE_MESSAGING_VERSION="~> 7.4.0"

2) Inserting the explicit request for the Permission to receive the Push Notifications:

const wasPermissionGiven = await FCM.requestPushPermission({ });

If still not working, try removing the platform IOS, remove the plugin, reinstall the plugin, then reinstall the platform IOS.

vivekkumarbiswal commented 10 months ago

Hi @vivekkumarbiswal finally I solved with these 2 actions:

  1. reinstalling the plugin with ALL the parameters suggested in the ReadMe:

ionic cordova plugin add cordova-plugin-fcm-with-dependecy-updated --variable ANDROID_DEFAULT_NOTIFICATION_ICON="@mipmap/ic_launcher" --variable ANDROID_FIREBASE_BOM_VERSION="26.0.0" --variable ANDROID_GOOGLE_SERVICES_VERSION="4.3.4" --variable ANDROID_GRADLE_TOOLS_VERSION="4.1.0" --variable IOS_FIREBASE_MESSAGING_VERSION="~> 7.4.0"

  1. Inserting the explicit request for the Permission to receive the Push Notifications:

const wasPermissionGiven = await FCM.requestPushPermission({ });

If still not working, try removing the platform IOS, remove the plugin, reinstall the plugin, then reinstall the platform IOS.

Hello @carlo318 i tried reinstalling the plugin its failing and i tried removing platform(ios) and plugin, i m able to install the plugin but while adding platform its giving the same error :

Installing "cordova-plugin-fcm-with-dependecy-updated" for ios Running command: pod install --verbose Failed to install 'cordova-plugin-fcm-with-dependecy-updated': Error: pod: Command failed with exit code 1 at ChildProcess.whenDone (/Users/vivekbiswal/Documents/IOS/Push Notification/website/FSPortal/node_modules/cordova-common/src/superspawn.js:135:23) at ChildProcess.emit (events.js:375:28) at maybeClose (internal/child_process.js:1055:16) at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5) pod: Command failed with exit code 1 [ERROR] An error occurred while running subprocess cordova. cordova platform add ios exited with exit code 1. Re-running this command with the --verbose flag may provide more information.

do you know how to resolve this ?

carlo318 commented 10 months ago

I am sorry I don't know how to help you, I don't get that error.

vivekkumarbiswal commented 6 months ago

It got resolved as the issue is not with the plugin its because my app was not using the FCM request push permission, after putting the FCM request push permission its working now.

kunalSBasic commented 2 months ago

It got resolved as the issue is not with the plugin its because my app was not using the FCM request push permission, after putting the FCM request push permission its working now.

Is it working on the Android 13 & the latest iOS? Are you able to receive the Push notification successfully?