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

Official Expo config plugin #1121

Open
LunatiqueCoder opened this issue Oct 10, 2024 · 8 comments
Open

Official Expo config plugin #1121

LunatiqueCoder opened this issue Oct 10, 2024 · 8 comments
Labels
Keep Open this label avoids the stale bot

Comments

@LunatiqueCoder
Copy link

LunatiqueCoder commented Oct 10, 2024

There are various features Notifee provides that require changes to the native code. Expo users definitely want to use JavaScript to implement those features:
iOS

Android

etc

There are several community config plugins that implement some of the features, but there's no plugin to do them all:

cc @kevpug

I think there should be a community effort to implement an official config plugin inside the notifee monorepo, or exported by the @notifee/react-native package to enable developers to fully enjoy all the Notifee and Expo features.

@LunatiqueCoder LunatiqueCoder changed the title Official Expo cnfig plugin Official Expo config plugin Oct 10, 2024
@mikehardy
Copy link
Collaborator

we used to have a config plugin but it was only needed for the maven repo addition (to resolve the AAR we ship internally) and that need went away (or should have - with gradle logic that fails for some? #799 (comment) )

I wasn't aware there were so many other native changes that are plugin only?

I thought expo had little config changers for all of those things such that it was handled without more code here or anywhere?

  • background modes can be done with stock config stuff IIRC?
  • adding the maven repo - if it is necessary for some reason - can be done with stock stuff?
  • notification icons - stock expo configuration stuff?
  • sounds, same? Or am I wrong

If there is some thing that cannot be done via stock expo stuff I would lobby to make it possible with Expo built in stuff actually, though if they for some reason reject that, then we can host a plugin here

@LunatiqueCoder
Copy link
Author

LunatiqueCoder commented Oct 11, 2024

I also have the #799 issue. Using one of the workarounds mentioned there.

I wasn't aware there were so many other native changes that are plugin only?

I thought expo had little config changers for all of those things such that it was handled without more code here or anywhere?

Expo experience is usually plug n play, but there are some occasions where you NEED to do some native stuff. In that case, Expo developers can create themselves a config plugin if there isn't one already available in the community. This plugin would do all the steps on the native side that you woud do as a developer.

They export all kind of utilities to help you like withEntitlementsPlist, withXcodeProject, withInfoPlist, withPodfile, etc. so even it this case is very easy for you to set it up.

For Notifee's icons and sounds, usually it would just copy the assets into the right places for both platforms. The remote notification support for iOS looked a little bit for complicated for beginners, but everything went smooth in the end.

The code for such a plugin isn't rocket science and I would love to implement and maintain it in the notifee (mono)repo. :) I mean, I'm already horsing around here: https://github.com/LunatiqueCoder/expo-notifee-plugin

@mikehardy
Copy link
Collaborator

mikehardy commented Oct 11, 2024

I understand how expo config plugins work, we host a bunch of them for react-native-firebase

This conditional is critical though:

If there is some thing that cannot be done via stock expo stuff

Is there any single thing that Expo doesn't already have a config tool for? There needs to be an actual inventory + analysis I think, and if there is any sort of config plugin there should be a doc file next to it with a table of every single element and it's status with regard to being configurable with stock Expo stuff vs the plugin

And then this direction is also critical:

I would lobby to make it possible with Expo built in stuff

...engaging in a "developer spends time doing stuff" race with the react-native core team and the Expo team is a losing battle and a malinvestment of time. Any plugin will always need maintenance here (or wherever it lives) vs upstreaming any required capabilities then just documenting which Expo tools + configurations to take advantage of

I'm not saying a plugin isn't perhaps needed right now, but I'd like to know

a) for exactly which items and
b) what the plan is for upstreaming so it goes away again...

I'm going to get rid of the need for a local AAR file / local maven repo shortly I hope. I always hated that solution but it was required when Notifee was paid - it's just a remnant now and I think I can use a pre-build / pre-publish source copy step to eliminate it, instead of the current pre-publish AAR-build+copy step (a functional hack that's worked well in another repo for me)

@LunatiqueCoder
Copy link
Author

Hmm ok, I see. Basically this plugin would be optional, you don't need it unless you want some custom features (described in first post)

So for iOS remote notifications, there's definitely a need for an Expo plugin, there isn't anything available except for the community plugins listed before.

For assets and sounds, both iOS and Android, perhaps expo-asset can be used, but I need to do some tests.

I also updated the first post's list of features with links that open their respective instructions from Notifee Docs.

I'm going to get rid of the need for a local AAR file / local maven repo shortly I hope. I always hated that solution but it was required when Notifee was paid - it's just a remnant now and I think I can use a pre-build / pre-publish source copy step to eliminate it, instead of the current pre-publish AAR-build+copy step (a functional hack that's worked well in another repo for me)

Honestly, I don't mind that work around in order to get Notifee working. Indeed it would be nice without it, but hey, Notifee works like a charm!

@mikehardy
Copy link
Collaborator

For anything not handled yet - including every single possible optional feature - I would love to have an official Expo plugin, for the record. Happy to host it though it would be community supported as I don't have any Expo test environments

Just would love to have the same paired with work to upstream the configurability into baseline Expo so we're not racing them. I hate racing other programmers, that's win/lose vs upstreaming which is win/win :-)

Copy link

github-actions bot commented Nov 8, 2024

Hello 👋, to help manage issues we automatically close stale issues.

This issue has been automatically marked as stale because it has not had activity for quite some time.Has this issue been fixed, or does it still require attention?

This issue will be closed in 15 days if no further activity occurs.

Thank you for your contributions.

@trajano
Copy link

trajano commented Nov 8, 2024

Package "@notifee/react-native" does not contain a valid config plugin.
When I added the app.json as per the documentation, it results in that one and looking at the code the config plugin stuff is missing.

@mikehardy mikehardy added the Keep Open this label avoids the stale bot label Nov 8, 2024
@AdamGerthel
Copy link

Package "@notifee/react-native" does not contain a valid config plugin.
When I added the app.json as per the documentation, it results in that one and looking at the code the config plugin stuff is missing.

Same issue here. The docs say to add it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Keep Open this label avoids the stale bot
Projects
None yet
Development

No branches or pull requests

4 participants