0.0.1 • Published 6 years ago
scratchplugin v0.0.1
Cordova-Plugin-Scratch (Android)

Installation
cordova plugin add https://github.com/hitmacreed/Cordova-Plugin-Scratch.git ionic cordova plugin add https://github.com/hitmacreed/Cordova-Plugin-Scratch.gitThis requires cordova Platform Android 8.0+
Info
This Plugin acepts images from drawable folder and Url.
In Android 9.0+ only accetps https Urls
Scratched Card Image can accetp drawable or Url
Usage
Declare in your component
declare var ScratchPlugin: any;Sintax
ScratchPlugin.draw('My Toast Message', 'Scratch Card Image', 'Scratched Card Image', 'My Title Card', 'My Title Color Hex', 'My Background', function(mkay) {
console.log(mkay);
}, function(err) {
console.log(err);
});Example of usage with drawable
ScratchPlugin.draw('You Won!', '@drawable/scratch_card', '@drawable/winner', 'Scratch to Win', '#ffffe6', '@drawable/background', function(mkay) {
console.log(mkay);
}, function(err) {
console.log(err);
});Example of usage with Url
ScratchPlugin.draw('You Won!', '@drawable/scratch_card', 'https://i.imgur.com/DvpvklR.png', 'Scratch to Win', '#ffffe6', '@drawable/background', function(mkay) {
console.log(mkay);
}, function(err) {
console.log(err);
});Libraries used to make this plugin
https://square.github.io/picasso/
https://github.com/goibibo/ScratchCardView0.0.1
6 years ago