Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(messaging,ios): add notification extension service to support im… #4085

Merged

Conversation

davidepalazzo
Copy link
Contributor

@davidepalazzo davidepalazzo commented Aug 14, 2020

Fixes #4016

Description

This PR adds support for an image in FCM. It uses a Notification Extension Service but without creating a target.
The necessary files were added to the RNFBMessaging project folder.

The original solution can be seen on this thread. From that idea (which worked well for v5) I added the equivalent implementation to work with v6.

Any feedback is appreciated.

Related issues

#4016

Release Summary

Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
    • Yes
  • My change supports the following platforms;
    • Android
    • iOS
  • My change includes tests;
    • e2e tests added or updated in packages/\*\*/e2e
    • jest tests added or updated in packages/\*\*/__tests__
  • I have updated TypeScript types that are affected by my change.
  • This is a breaking change;
    • Yes
    • No

Test Plan

iPhone 11 - iOS 13.6.1
iphone11

iPhone 6 - iOS 12.4.8
IMG_5323


Think react-native-firebase is great? Please consider supporting the project with any of the below:

🔥

@CLAassistant
Copy link

CLAassistant commented Aug 14, 2020

CLA assistant check
All committers have signed the CLA.

#import "RNFBMessaging+UNNotificationServiceExtension.h"
#import "FirebaseMessaging.h"

API_AVAILABLE(ios(10.0))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting - I had thought RNFB moved to iOS10 as a minimum but it still supports 9 right now: https://github.com/invertase/react-native-firebase/blob/master/packages/messaging/RNFBMessaging.podspec#L28 - it's Notifee and React-Native itself (with version 0.63) that have moved to 10 already

Copy link
Collaborator

@mikehardy mikehardy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will be the first to admit my Objective-C skills are weak but assuming the tests pass, this looks good to me at least. I'll see if I can get someone else to review it as well.

Are there any corresponding docs changes needed? Those are built from source as well (edit button at top right of every page) but I haven't used this feature in my work project so I'm not familiar (sorry)

@mikehardy mikehardy requested a review from Salakar August 14, 2020 06:38
@davidepalazzo
Copy link
Contributor Author

It's mostly Xcode boilerplate adapted with Firebase. For sure, having another set of eyes is always good.

I don't believe so as it doesn't involve any setup. The only thing I can think of that might need documenting is the instance for sending an image with the admin SDK. In that case we could cross reference with the official docs https://firebase.google.com/docs/cloud-messaging/ios/send-image.

Let me know if you need me to add it.

@Salakar
Copy link
Member

Salakar commented Aug 14, 2020

Code LGTM. Re the docs, could maybe briefly mention it on this page: https://rnfirebase.io/messaging/server-integration#send-messages-to-topics - happy for this to be in a follow up PR if you want to ship this for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Notification with image on iOS
4 participants