Cordova Plugin Scratch

Cordova Plugin Scratch

An Android Cordova plugin that allows users to scratch and reveal and image

Free!

(1)
Kevin Dias

Kevin Dias

Member since 2018

Details

Version:
1.0
Size:
12mb
Ionic:
3.x,4.x
Platforms:
Android
Released:
5 years ago
Updated:
5 years ago
Category:
Plugins
Tags:
ionic, cordova, plugin, scratch

Installation

 ionic cordova plugin add https://github.com/hitmacreed/Cordova-Plugin-Scratch.git

This requires cordova Platform Android 8.0+

Info

This Plugin accepts images from drawable folder and Url.

In Android 9.0+ only accepts https Urls

"ONLY => Scratched Card Image" can accept drawable or Url

Usage

Declare in your component

 declare var ScratchPlugin: any;

Syntax

    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/ScratchCardView

Hey there! You'll need to log in before you can leave a comment here.

There are no comments for this plugin yet

  ·   just now

{{ comment.comment }}

  ·   just now

{{ reply.comment }}



Hey there! You'll need to log in before you can leave a comment here.

  ·   just now

{{ comment.comment }}

  ·   just now

{{ reply.comment }}



Hey there! You'll need to log in before you can leave a comment here.

Hey there! You'll need to log in before you can leave a rating here.

Kevin Dias   ·     ·   5 years ago

its pretty cool xD!

  ·     ·   just now

{{ rating.comment }}

  ·     ·   just now

{{ rating.comment }}

Kevin Dias    ·     ·   5 years ago

its pretty cool xD!