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

using plugin with Expo react native app #354

Closed
krunalc opened this issue Aug 4, 2021 · 10 comments
Closed

using plugin with Expo react native app #354

krunalc opened this issue Aug 4, 2021 · 10 comments

Comments

@krunalc
Copy link

krunalc commented Aug 4, 2021

I have very general question. Will this plugin work with react native application developed using Expo?

@christocracy
Copy link
Member

Yes, if you "eject" your app (or however they refer to it now.

@krunalc
Copy link
Author

krunalc commented Aug 4, 2021

ohh... thanks for prompt response. It's big decision and will give a thought to it.

@mikehardy
Copy link
Contributor

@christocracy this may be of interest to you - there's a new "config plugins" system from Expo to "customize" a "managed workflow" app. Use of the same was just contributed to react-native-firebase in invertase/react-native-firebase#5480 - for this module and for geolocation, it may be of interest in that it could broaden the potential userbase of the plugins significantly given that Expo has a large share of the react-native market.

@krunalc - for the avoidance of doubt, nothing I just wrote above would allow this to be used by a non-ejected Expo app right now, it does not alter the answer from Chris.

@barthap
Copy link

barthap commented Aug 11, 2021

Let me explain more:

  • As it was said before - this will work with Bare Workflow - in "ejected" app
  • This will not work in the "Expo Go" app - you have to rely on expo-background-fetch there
  • If you do not want to opt-out of Managed Workflow, you can build a custom Development Client with react-native-background-fetch (or any custom native library) included. You can read more here.
  • Config plugins' purpose is to automatically apply native installation steps, so you don't have to touch Android Studio/Xcode stuff, the expo prebuild / expo run commands take care of everything for you. The config plugin for react-native-background-fetch seems not to exist yet. But if you want to develop your own - start by reading the config plugins guide, you can take inspiration from expo-background-fetch plugin source code.

@azizsaad
Copy link

As per the docs, we can now add "react-native-background-fetch" to the plugins in our Expo config file.

Does this mean this package should work in managed workflow?

@christocracy
Copy link
Member

christocracy commented Jul 17, 2023

See the README "Installing the plugin".

@azizsaad
Copy link

azizsaad commented Jul 17, 2023

Yep, I followed the instructions

  • ran npx expo install react-native-background-fetch
  • this is the relevant part of my app.config.js file:
 ios: {
      supportsTablet: true,
      infoPlist: {
        UIBackgroundModes: ["fetch", "processing"],
        BGTaskSchedulerPermittedIdentifiers: ["com.transistorsoft.fetch"],
      },
      usesAppleSignIn: true,
    },

but still encountered the following error:

Screenshot 2023-07-17 at 14 57 56

This is a managed app, just for an iOS application btw, not Android.

@azizsaad
Copy link

and there's no mention of bare/managed Expo workflows in that README?

@christocracy
Copy link
Member

This issue is closed. Post a new issue.

@azizsaad
Copy link

This issue is closed. Post a new issue.

Yep, will do 👍 - thanks!

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

No branches or pull requests

5 participants