natanfeitosa / rn-wallpapers

A lightweight library for setting wallpapers with React Native

Home Page:https://npm.im/rn-wallpapers

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

rn-wallpapers

A lightweight library for setting wallpapers with React Native

GitHub Repo stars Version in NPM License in GitHub Downloads in NPM

Installation

npm install rn-wallpapers

// or with yarn
yarn add rn-wallpapers

Usage

import { setWallpaper, TYPE_SCREEN } from 'rn-wallpapers';

// ...


await setWallpaper(
  {
    uri: 'https://i0.wp.com/techwek.com/wp-content/uploads/2021/01/wallpaper-gotas-de-chuva.jpg',
    headers: {
      // your custom headers ...
    }
  },
  TYPE_SCREEN.LOCK // Sets the wallpaper on Lock Screen only
);

await setWallpaper(
  {
    uri: 'https://i0.wp.com/techwek.com/wp-content/uploads/2021/01/wallpaper-gotas-de-chuva.jpg'
  },
  TYPE_SCREEN.HOME // (default) Sets the wallpaper on Home Screen only
);

await setWallpaper(
  {
    uri: 'https://i0.wp.com/techwek.com/wp-content/uploads/2021/01/wallpaper-gotas-de-chuva.jpg'
  },
  TYPE_SCREEN.BOTH // Sets the wallpaper on both screen
);

If you are using Expo Go, you may need to add the SET_WALLPAPER permission to your permissions array

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Made with create-react-native-library

About

A lightweight library for setting wallpapers with React Native

https://npm.im/rn-wallpapers

License:MIT License


Languages

Language:Java 73.8%Language:TypeScript 11.8%Language:Ruby 10.1%Language:Objective-C++ 2.4%Language:Objective-C 1.4%Language:JavaScript 0.5%