How to set phone wallpaper by expo

Please provide the following:

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

i search a lot about how to set phone wallpaper using expo but i didnt find any way :slight_smile:

Hi @kotsh

It is apparently not possible for an app to set the wallpaper on iOS.

For Android there is a package called react-native-manage-wallpaper which should work in theory as long as you build with EAS Build.

I’m sorry to inform you even android package wont work with expo
that’s why I’m asking here

What makes you say it “won’t work with expo”?

EDIT: I’ve just tried it myself and it works fine. I did not need to do anything special. Just the following:

  • expo init WallpaperTest -t blank
  • cd WallpaperTest
  • yarn add react-native-manage-wallpaper
  • I replaced the contents of App.js with the example code from the react-native-manage-wallpaper README. I just converted it to a function component, but that’s optional.
  • I installed expo-dev-client as per Getting Started - Expo Documentation
  • I built the app with eas build --platform android --profile development
  • I installed the app on my phone
  • I ran expo start --dev-client
  • I ran the dev client on my phone and connected to the dev server (the best way to do this is to login to the dev client with your Expo account.)

And it worked fine.

If you want to build an app to submit to the app store, you just build again with:

eas build --platform android --profile production
1 Like

Thank you wodin for your replay im really happy

i dont know how to run dev client on android simulator i build the app and installed but when i run it by pressing “a” at terminal its open the app and then crashes

Hmmm… I don’t know why it would crash on the emulator.

Maybe try running it on a physical device to see if it works there.

Also, maybe try running the dev client manually on the emulator by clicking on the icon after you’ve installed it and connecting to the dev server. i.e. see what happens if you do not press “a” when running the dev server.

Also, try building a preview build and see if that crashes on the emulator or physical device.

eas build --platform android --profile preview

EDIT: The preview build is a standalone app that cannot connect to a dev server.

1 Like

finally did it :smiley:
Just finish read eas docs and its working thank you :slight_smile:

1 Like

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