How to set wallpaper of image in ionic app?

I’m building wallpaper app.
Is there any ionic method to implement set as wallpaper of image in ionic app?
I tried using cordova-plugin-wallpaper plugin to set an image inside ionic app(ionic card tag) as wallpaper on my device.Link to cordova plugin:
After installing using “cordova plugin add cordova-plugin-wallpaper” command in command prompt project location.I tried using plugin function “window.plugins.wallpaper.setImage(string /* image path */);” to set image i stored in my www image folder.But when i click on ionic card to set as wallpaper its showing “Runtime Error
Cannot read property ‘wallpaper’ of undefined” error on ionic lab localhost.
Is there any other way to set image as wallpaper in ionic? OR How to use this cordova plugin to set wallpaper from an image in ionic?
Full explanation:
I’m using <ion-card (click)=“setwall()”> in home.html to call setwall() in home.ts.
setwall() is a function i use inside home.ts export class HomePage {}.
Code for setwall():
window[‘plugins’].wallpaper.setImage(‘img/3.jpg’); }
Help me solving this as i’m losing hope in this.
Thanking in advance.

u need to declare window before @Component & @IonicPage()


declare var window;

  selector: 'page-full',
  templateUrl: 'full.html',

// somewhere in your code set as wallpaper..


@coderwizard Did you get it working? I’m trying to do the same but I’m not able to do it. Can you share your code?

1 Like

This question will never be answered. I am searching for a solution for almost 7 months. Still no sollution. Actually some cordova plugin was written long back. But it is not maintained and updated. It doesn’t work now. If someone, who knows to create cordova plugin using java, can help. That’s it

1 Like

I got it working

I used:


and it’s working fine.

Reference :

Hi, I used this but getting error with the name of Wallpaper is undefined. Do you know any other way of doing that or any solution of this error, please help?