Push notification not working on iOS

  1. If i use “Get Device token beta”

    • THERE IS NO option for adding a GoogleService-info.plist file
    • build completes, no push notification coming through for firebase
    • i can send messages using curl straight to apple…
  2. If i use component : Get Firebase Device token beta

@Mevi

Same here. My error log revealed this:

[!] CocoaPods could not find compatible versions for pod “Firebase/CoreOnly”:
In Podfile:
RNFBAnalytics (from /Users/ec2-user/app-builder/STAGING/client/node_modules/@react-native-firebase/analytics) was resolved to 7.4.2, which depends on
Firebase/Analytics (~> 6.28.1) was resolved to 6.28.1, which depends on
Firebase/Core (= 6.28.1) was resolved to 6.28.1, which depends on
Firebase/CoreOnly (= 6.28.1)

RNFBApp (from /Users/ec2-user/app-builder/STAGING/client/packages/app-standalone/node_modules/@react-native-firebase/app) was resolved to 8.2.0, which depends on
Firebase/CoreOnly (~> 6.27.0)
[ warn ] [configure] pod install is not enough! Let’s try pod update! Error:
COMMAND:

pod install

FAILED with ERROR:

[!] CocoaPods could not find compatible versions for pod “Firebase/CoreOnly”:
In Podfile:
RNFBAnalytics (from /Users/ec2-user/app-builder/STAGING/client/node_modules/@react-native-firebase/analytics) was resolved to 7.4.2, which depends on
Firebase/Analytics (~> 6.28.1) was resolved to 6.28.1, which depends on
Firebase/Core (= 6.28.1) was resolved to 6.28.1, which depends on
Firebase/CoreOnly (= 6.28.1)

Command failed with exit code 1 (EPERM): pod install

Yes my error too using 2.8.31

FAILED with ERROR:

[!] CocoaPods could not find compatible versions for pod “Firebase/CoreOnly”:
In Podfile:
RNFBAnalytics (from /Users/ec2-user/app-builder/STAGING/client/node_modules/@react-native-firebase/analytics) was resolved to 7.4.2, which depends on
Firebase/Analytics (~> 6.28.1) was resolved to 6.28.1, which depends on
Firebase/Core (= 6.28.1) was resolved to 6.28.1, which depends on
Firebase/CoreOnly (= 6.28.1)

Command failed with exit code 1 (EPERM): pod install

Warning: the running version of Bundler (2.1.2) is older than the version that created the lockfile (2.1.4). We suggest you to upgrade to the version that created the lockfile by running gem install bundler:2.1.4.

Error: Command failed with exit code 1 (EPERM): pod install
at makeError (/Users/ec2-user/app-builder/STAGING/client/node_modules/rnv/node_modules/execa/lib/error.js:58:11)
at handlePromise (/Users/ec2-user/app-builder/STAGING/client/node_modules/rnv/node_modules/execa/index.js:112:26)
at processTicksAndRejections (node:internal/process/task_queues:96:5)

│ [ error ] [configure] COMMAND:

pod update

FAILED with ERROR:

[!] CocoaPods could not find compatible versions for pod “Firebase/CoreOnly”:
In Podfile:
RNFBAnalytics (from /Users/ec2-user/app-builder/STAGING/client/node_modules/@react-native-firebase/analytics) was resolved to 7.4.2, which depends on
Firebase/Analytics (~> 6.28.1) was resolved to 6.28.1, which depends on
Firebase/Core (= 6.28.1) was resolved to 6.28.1, which depends on
Firebase/CoreOnly (= 6.28.1)

Command failed with exit code 1 (EPERM): pod update

Warning: the running version of Bundler (2.1.2) is older than the version that created the lockfile (2.1.4). We suggest you to upgrade to the version that created the lockfile by running gem install bundler:2.1.4.

Error: Command failed with exit code 1 (EPERM): pod update
at makeError (/Users/ec2-user/app-builder/STAGING/client/node_modules/rnv/node_modules/execa/lib/error.js:58:11)
at handlePromise (/Users/ec2-user/app-builder/STAGING/client/node_modules/rnv/node_modules/execa/index.js:112:26)
at processTicksAndRejections (node:internal/process/task_queues:96:5)

│ │
│ Project location: │
│ ./platformBuilds/app_316688_ios/RNVApp.xcworkspace │
└──────────────────────────────────────────────────────────────────────────────┘
exec: 2:47.463 (m:ss.mmm)
remove temp package: 2.571ms
ypx: 2:47.602 (m:ss.mmm)

I just ran a build with 2.6.8. … it built successfully, But app crashes right when it starts up through testflight.

Does this mean no way to get push notifications to work on iOS?

@Mevi

Have you gotten push on IOS with the latest build yet? Im wondering if it might be a conflict with a different component / plugin ?

I have tried pushing with a mac app to APN with success… and have it working, so its not a provisional / prod certif error, its something with firebase.

No I havent. It looks to me like an integration conflict with Firebase iOS SDK and Appgyver’s iOS libraries.Which means Appgyver needs to update something on their end.

Any update on this ?

@Mevi

Has anybody seen any movement on this? Still at a stalemate on iOS notifications through firebase?
@JOHN_WORSHAM @Kevin @Mevi

I havent been able to test this but the inclusion of the GoogleService-info.plist file into the iOS builds is a good step forward, as it is necessary for Firebase to invoke Push Notifications to iOS devices. So I would like to assume with the Firebase iOS Cloud Messaging configured properly on the back end that this should now work - in theory - with the proper api call to Firebase.

Ill be testing this today and find out

Keen to hear back! Was just about to start work on my custom Lambda backend, and this would save me a lot of trouble.

IOS push notifications still not working

Firebase does not send the push to IOS.

@Mevi

I have just managed to get IOS push notifications to work, not sure if you have tried again.

Would you be so kind as to post a “how-to” on that for the many here who have trouble with iOS?

2 Likes

Not sure if this is the best way but Firebase is now sending notifications to both Android and Apple phones.

The way to set it up is very close to how you set up notifications for Android. I used the latest build 2.8.33 but I don’t have any user account/login etc. in my app so not sure if that will affect the set up.

  1. Add a new app to your project in Firebase selecting IOS.

  2. Fill in the details to register the app. Download the Googleservice-info.plist.

  3. Continue (next), add Firebase SDK and initialisation code (both didn’t require any changes made to them). Then your basic is set up.

  4. In Cloud Messaging (under Project Settings) you need to add a APNs Authentication Key (.p8 file), that you need to create in your Apple Developer account.

  5. Go to your Apple Developer Account, select Certificates, Identifiers & Profiles. Select Keys and add a new key. Fill you key name and select Apple Push Notifications service (APNs) and register.

  6. Download your key and note the key ID ( you need this)

  7. Add APN Key (.p8) file to Firebase with your key ID and team ID

  8. In Appgyver: Check that the HTTP request method in your app is set to post and that the URL is https://fcm.googleapis.com/fcm/send.

  9. Add your Googleservice-info.plist document to your Appgyver Build settings under Advance and the build your app using 2.8.33 and upload your app.

  10. After this you can go to Firebase Cloud Messaging, make a new notification and make sure you select the right app and that your app allows notifications.

I hope this helps, let me know if I have missed something and I will make changes to the guide and, when I get time, add pictures. I also added a Apple Push Services certificate but I don’t know if you actually need to :thinking:

Dan

2 Likes

Thanks Dan. My main question is concerning #8
8. In Appgyver: Check that the HTTP request method in your app is set to post and that the URL is https://fcm.googleapis.com/fcm/send .

What does your send API request object look like? I use one like this to send Android notifications:
Capture

Hi @JOHN_WORSHAM ,

I use Firebase to write and send the Notifications (Firebase Cloud Messaging), so I am not sending any API requests. Are you creating the notifications on your phone?

Yes, I send API requests from the users phone. I have had it work with Android but never with iOS before, but after reading the FCM docs I see that my API requests should theoretically work for both, without requiring a separate API.

Hey John , was you able to send notification from the users phone on IOS? if yes , can you please share how does your send API request object look like.

I havent tested on IOS it yet, but according to the Firebase docs a generic API should work on both Android and IOS. I send this API in an object like this:
Capture