1.0.4 • Published 4 years ago

rn-wallpaper-manager v1.0.4

Weekly downloads
10
License
-
Repository
github
Last release
4 years ago

rn-wallpaper-manager

  1. A library for set wallpaper as Home Screen wallpaper
  2. Currently Only Supports on ANDROID Platform

Getting started

$ npm install rn-wallpaper-manager --save

Mostly automatic installation (If react-native < 0.60)

$ react-native link rn-wallpaper-manager

Manual installation

Android

  1. Open up android/app/src/main/java/[...]/MainActivity.java
  • Add import com.reactlibrary.RNWallPaperManagerPackage; to the imports at the top of the file
  • Add new RNWallPaperManagerPackage() to the list returned by the getPackages() method
  1. 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')
  2. Insert the following lines inside the dependencies block in android/app/build.gradle:
      implementation project(':rn-wallpaper-manager')

Usage

import RNWallPaperManager from 'rn-wallpaper-manager';

// TODO: What to do with the module?
try{
  await RNWallPaperManager.setAsWallpaper(Url);
} catch(err) {
  // handle error here
}