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.
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.
Share Improve this question edited Oct 6, 2018 at 12:22 Nirbhay Singh 1,2981 gold badge12 silver badges19 bronze badges asked Apr 9, 2018 at 19:55 Nilesh KantNilesh Kant 3592 silver badges10 bronze badges2 Answers
Reset to default 3I 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
you can use NativeModules from react-native
import NativeModules from 'react-native';
NativeModules.WallPaperManager.setWallpaper(image,callback);