1.2.1 • Published 6 years ago

rnwallpaper v1.2.1

Weekly downloads
3
License
ISC
Repository
github
Last release
6 years ago

RNWallpaper

Getting started

$ npm install rnwallpaper --save

Mostly automatic installation

$ react-native link rnwallpaper

Manual installation

Android

  1. Open up android/app/src/main/java/[...]/MainActivity.java
  • Add import sonu.malik.wallpaper.RNWallpaperPackage; to the imports at the top of the file
  • Add new RNWallpaperPackage() to the list returned by the getPackages() method
  1. Append the following lines to android/settings.gradle:
    include ':rnwallpaper'
    project(':rnwallpaper').projectDir = new File(rootProject.projectDir, 	'../node_modules/rnwallpaper/android')
  2. Insert the following lines inside the dependencies block in android/app/build.gradle:
      compile project(':rnwallpaper')

Usage

import Wallpaper from 'rnwallpaper';

Wallpaper.setWallpaper('http://yourwebsite.com/anyImage.png', (res) => Alert.alert("Response: ", JSON.stringify(res)))

Wallpaper.openImage('content://media/external/images/media/Y')