Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add "Set as Wallpaper" option in React Native app

How to enable option "set as wallpaper" ? I'm using expo and I'm not able to find any API to enable that functionality. I only able to download image. I want to trigger set as wallpaper option. I tried to use react-native-wallpaper-manager library but it has not worked for me.

like image 698
Nilesh Kant Avatar asked Oct 12 '25 09:10

Nilesh Kant


1 Answers

I found the proper solution to 'set wallpaper' (in android) using react-native-wallpaper-manager by ejecting the CRNA . But it seems like the npm release is not up to date with the repo. To get it to work you will have to implement the last pull fix manually by removing

@Override
    public List<Class<? extends JavaScriptModule>> createJSModules() {
        return Collections.emptyList();
    }

from WallPaperPackage.java and make sure to link the package by react-native link react-native-wallpaper-manager

Note:- Right now there is no api working with expo or CRNA to 'set as wallpaper' in android

like image 123
Nilesh Kant Avatar answered Oct 14 '25 23:10

Nilesh Kant