NeutrinosPlatform / cordova-plugin-document-scanner

cordova plugin for document scan
https://www.neutrinos.co/
MIT License
84 stars 63 forks source link

window.scan is undefined #48

Closed crapthings closed 5 years ago

crapthings commented 5 years ago

i'm trying this plugin with android, but can't make it work.

window.scan is undefined, what's wrong?

import React, { Component } from 'react'
import { render } from 'react-dom'

class App extends Component {
  onClick = e => {
    alert(window.scan)
  }

  render() {
    return (
      <div>
        <button onClick={this.onClick}>BUTTON1</button>
        <img id='myImage' src="" alt=""/>
      </div>
    )
  }
}

Meteor.startup(init)

function init() {
  const app = document.createElement('div')
  app.id = 'app'
  document.body.appendChild(app)
  render(<App />, app)
}
crapthings commented 5 years ago

okay the testing framework is meteor use this trick install 3x instead meteor npm i

meteor add cordova:cordova-plugin-document-scanner@https://github.com/NeutrinosPlatform/cordova-plugin-document-scanner/tarball/edc8a273594f0eb85eae97be8fa12bc7f56202d3