Is it possible to enable Communications Notifications Extension Expo for iOS?

Please provide the following:

  1. SDK Version: Expo 46
  2. Platforms(Android/iOS/web/all): iOS
  3. Add the appropriate “Tag” based on what Expo library you have a question on. #notifee

I installed Notifee and React Native Firebase, according to Notifee docs in Android it could be done but in iOS it seems like it requires Communication Notifications extension enabled. Is it possible to enable it in Expo?

If it is not possible, is it possible to display image on right side as attachment in iOS like this?

It should be possible; however, since it appears that this library requires additional native project configuration, in order to use this with Expo prebuild/ managed workflow, you will need a config plugin. More and more maintainers are providing their own config plugins, but it is possible to write your own if the vendor does not provide one. We also have a channel on our Discord for those who are writing config plugins.

Yeah, Notifee and React Native Firebase provide with their own plugins and I managed to add these, eas builds successfully. Just got stuck where it says Add the notification service extension enable Communications Notifications extensions here.

Edit: Looks like in order add extensions through xcode it requires ios native code for that I might have to switch to Bare workflow, is that right? If so, I am willing to switch, I hope I won’t mess things up for other stuff. if you could guide me a bit how does transitioning to bare workflow will affect and work, that would be great.

Hi @bayramn

Since Notifee has a config plugin, that should in theory take care of any changes to the native projects for you. The point of a config plugin is to make those changes automatically, instead of switching to the Bare workflow and making them manually.

I haven’t looked at what their config plugin actually does, though.

Hi @wodin

Really? If so, that would be great, as I am here lost the hope. I tried sending FCM Notifications with Image assuming Service Extentions enabled but it doesn’t display Image on Notification in iOS. I did post issue in Notifee github asking this. At this moment, all I want to is display image in notifications in a background/killed state.

Yes, the point of config plugins is to allow changes to the native projects without ejecting :slight_smile:
You do need to use EAS Build and you can’t use Expo Go anymore. You can build a custom development client instead.

Whether Notifee’s config plugin will work for you, I don’t know, since I haven’t tried it.
Their “Expo Support” instructions do say:

ensure you run expo prebuild

which is not required. As you can see in Add custom native code - Expo Documentation it is one option. But running expo prebuild (or these days npx expo prebuild) generates the native code, so it is basically the replacement for expo eject. If you have already run npx expo prebuild you might want to clean up the changes it makes. e.g. see expo.fyi/prebuild-cleanup

I found that Notifee plugins doesn’t do image attachments not to mention Communication Notifications. I switched to Onesignal, they have separate plugin package that includes all the necessary plugins for Expo and Notifications. Notifications with attachment images works perfectly! They don’t have Communications Notifications plugins just yet though.

Really appreciate your help and guidance here, expo plugins are super cool and powerful feature of Managed Flow that I super glad that you included in it.

It’s been hard to find info/docs for writing Expo Plugins beside from Expo’s own docs. There is gap between Expo’s, Apple’s and other library’s docs on writing plugins and modifying native codes that it’s bit hard to understand and get started writing plugins for people used to Managed flow. I would love to get links and article if you know any on this topic.

1 Like

Fyi, I am just an Expo user like you :slight_smile:
@keith-kurak is an Expo team member, though.

Yes, I agree that config plugins are cool and powerful and also that they are initially hard to wrap your head around or know how to start. I think this is mostly a temporary problem, though. Config plugins are still a fairly new concept, so there are still many NPMs that need one, and have not written one themselves. So if you want to use one of those NPMs, you’d need to write the config plugin yourself.

I think that over time more of these dependencies will have their own config plugins, and the chances of you needing to write one will be much lower.

I’ve written a few simple config plugins and I found that the easiest way to go was to find an existing Expo config plugin that did something similar to what I needed to do and basically copy that and modify it.

Places to look for examples:

You might also find something useful in the following forum posts that I’ve bookmarked:

3 Likes

That’s unbelievable! Thank You for your generous contributions here, as I have been seeing your responses everywhere here.

Yes, I agree that config plugins are cool and powerful and also that they are initially hard to wrap your head around or know how to start. I think this is mostly a temporary problem, though. Config plugins are still a fairly new concept, so there are still many NPMs that need one, and have not written one themselves. So if you want to use one of those NPMs, you’d need to write the config plugin yourself.

I think that over time more of these dependencies will have their own config plugins, and the chances of you needing to write one will be much lower.

Oh I see, that makes sense then as I have been feeling guilty not being able to wrap head around to add NSE.

I’ve written a few simple config plugins and I found that the easiest way to go was to find an existing Expo config plugin that did something similar to what I needed to do and basically copy that and modify it.

Got it.

Great, I will look into them. Thanks again! You’ve been incredibly helpful, and I learned a lot from this post through @keith-kurak and your guidance and help!

1 Like

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.