- A library for set wallpaper as Home Screen wallpaper
- Currently Only Supports on ANDROID Platform
$ npm install rn-wallpaper-manager --save
$ react-native link rn-wallpaper-manager
- Open up
android/app/src/main/java/[...]/MainApplication.java
- Add
import com.reactlibrary.RNWallPaperManagerPackage;
to the imports at the top of the file - Add
new RNWallPaperManagerPackage()
to the list returned by thegetPackages()
method
- Append the following lines to
android/settings.gradle
:include ':rn-wallpaper-manager' project(':rn-wallpaper-manager').projectDir = new File(rootProject.projectDir, '../node_modules/rn-wallpaper-manager/android')
- Insert the following lines inside the dependencies block in
android/app/build.gradle
:implementation project(':rn-wallpaper-manager')
import RNWallPaperManager from 'rn-wallpaper-manager';
// TODO: What to do with the module?
try{
await RNWallPaperManager.setAsWallpaper(Url);
} catch(err) {
// handle error here
}