Guys I am trying to use 'react-native-manage-wallpaper' library in my react native application to change the wallpaper...
But I am getting this error:
TypeError: null is not an object (evaluating'_reactNative.NativeModules.ManageWallpaper.setWallpaper')
This is the function which is being used to change the wallpaper
const callback = res => {
console.log('Response: ', res);
};
const changeWallpaper = () => {
ManageWallpaper.setWallpaper(
{
uri: 'https://i.pinimg.com/originals/76/5e/1d/765e1dc8cb1cc115fb3b0b39a895fdeb.jpg',
},
callback,
TYPE.HOME,
);
};
What exactly is causing the error?
I was also facing the same issue. But after the loss of hassle I know one package called @ajaybhatia/react-native-wallpaper-manager
If you are using expo then expo go has not native module. So first you have to build your app using this command