BlinkID / blinkid-cordova

ID scanning for cross-platform apps built with Cordova and Phonegap.
48 stars 34 forks source link

Package as NPM downloadable library to support Ionic Pro #27

Closed vetikent closed 6 years ago

vetikent commented 7 years ago

Ionic Pro, the latest offering from the Ionic team, does not support Git LFS on their internal Gitlab server. This poses a problem for using the BlinkID Phonegap plugin since the plugin is 115 MB in size. After contacting the Ionic support I was told they have no plans to add LFS support to their Pro offering.

Can we get the BlinkID Phonegap plugin posted to NPM so we can download it as a part of the build process? If you need help in this area I can definitely pitch in.

i1E commented 7 years ago

Hi @veti-io,

the plugin is huge because our native BlinkID library for iOS is placed in the plugin itself, and that is why submodule is needed. We had the same configuration for Android and then we decided to use maven integration for our native library. We can do the same for the iOS part of the plugin and then the plugin size will be about 2 MB and dependencies will be downloaded in the project generation step. In this way you won't have problems with using our plugin with Ionic Pro. We will try to do this ASAP, probably during the next week.

vetikent commented 7 years ago

Wonderful! Your efforts are much appreciated. This change will make the difference for me. I'll test it out as soon as the change is available and will report back here with my results.

vetikent commented 6 years ago

Following the steps in the repository I get an SSH Permission denied (publickey) error when running initIOSFramework.sh when it was trying to clone the repository named git@github.com:BlinkID/blinkid-ios.git

I put the HTTPS repository https://github.com/BlinkID/blinkid-ios.git in the script and everything worked.

When I try adding the plugin to my project with ionic cordova plugin add ../cordova-plugins/BlinkID then I get an error on plugin for "zone.js"

$ ionic cordova plugin add ../cordova-plugins/BlinkID
> cordova plugin add ../cordova-plugins/BlinkID --save
Error: Cannot find plugin.xml for plugin "zone.js". Please try adding it again.

[ERROR] An error occurred while running cordova plugin add ../cordova-plugins/BlinkID --save (exit code 1).

What could be the cause of this? zone.js is the last dependency in my dependencies section of my package.json. Is there something going on where Cordova is trying to interpret it as a plugin?

Here is my package.json

{
    "name": "myapp",
    "version": "0.1.3",
    "author": "Kent",
    "homepage": "http://my.page/",
    "private": true,
    "scripts": {
        "clean": "ionic-app-scripts clean",
        "build": "ionic-app-scripts build",
        "lint": "ionic-app-scripts lint",
        "ionic:build": "ionic-app-scripts build",
        "ionic:serve": "ionic-app-scripts serve",
        "test": "karma start ./test-config/karma.conf.js",
        "test-ci": "karma start ./test-config/karma.conf.js --single-run",
        "test-coverage": "karma start ./test-config/karma.conf.js --coverage",
        "e2e": "npm run e2e-update && npm run e2e-test",
        "e2e-test": "protractor ./test-config/protractor.conf.js",
        "e2e-update": "webdriver-manager update --standalone false --gecko false"
    },
    "dependencies": {
        "@angular/common": "4.1.2",
        "@angular/compiler": "4.1.2",
        "@angular/compiler-cli": "4.1.2",
        "@angular/core": "4.1.2",
        "@angular/forms": "4.1.2",
        "@angular/http": "4.1.2",
        "@angular/platform-browser": "4.1.2",
        "@angular/platform-browser-dynamic": "4.1.2",
        "@ionic-native/core": "^3.12.1",
        "@ionic-native/in-app-browser": "^3.12.1",
        "@ionic-native/splash-screen": "^3.12.1",
        "@ionic-native/status-bar": "^3.12.1",
        "@ionic/cloud-angular": "^0.12.0",
        "@ionic/storage": "^2.0.1",
        "@types/lodash": "^4.14.76",
        "angular2-jwt": "^0.2.3",
        "blinkid": "file:../cordova-plugins/BlinkID",
        "cordova-android": "^6.2.3",
        "cordova-ios": "^4.4.0",
        "cordova-plugin-console": "^1.0.5",
        "cordova-plugin-crosswalk-webview": "^2.3.0",
        "cordova-plugin-device": "^1.1.4",
        "cordova-plugin-inappbrowser": "^1.7.1",
        "cordova-plugin-splashscreen": "^4.0.3",
        "cordova-plugin-statusbar": "^2.2.2",
        "cordova-plugin-whitelist": "^1.3.1",
        "cordova-plugin-wkwebview-engine": "git+https://github.com/driftyco/cordova-plugin-wkwebview-engine.git",
        "ionic-angular": "3.3.0",
        "ionic-plugin-deploy": "^0.6.7",
        "ionic-plugin-keyboard": "^2.2.1",
        "ionicons": "3.0.0",
        "lodash": "^4.17.4",
        "rxjs": "5.1.1",
        "sw-toolbox": "3.6.0",
        "zone.js": "0.8.11"
    },
    "devDependencies": {
        "@ionic/app-scripts": "1.3.7",
        "@types/jasmine": "^2.6.0",
        "@types/node": "^8.0.31",
        "angular2-template-loader": "^0.6.2",
        "html-loader": "^0.5.1",
        "ionic": "3.16.0",
        "istanbul-instrumenter-loader": "^3.0.0",
        "jasmine": "^2.8.0",
        "jasmine-spec-reporter": "^4.2.1",
        "karma": "^1.7.1",
        "karma-chrome-launcher": "^2.2.0",
        "karma-coverage-istanbul-reporter": "^1.3.0",
        "karma-jasmine": "^1.1.0",
        "karma-jasmine-html-reporter": "^0.2.2",
        "karma-sourcemap-loader": "^0.3.7",
        "karma-webpack": "^2.0.4",
        "null-loader": "^0.1.1",
        "protractor": "^5.1.2",
        "ts-loader": "^2.3.7",
        "ts-node": "^3.3.0",
        "typescript": "2.3.3",
        "webpack-merge": "^4.1.0"
    },
    "description": "Connect with your community and take action!",
    "cordova": {
        "plugins": {
            "cordova-plugin-console": {},
            "cordova-plugin-crosswalk-webview": {
                "XWALK_VERSION": "23+",
                "XWALK_LITEVERSION": "xwalk_core_library_canary:17+",
                "XWALK_COMMANDLINE": "--disable-pull-to-refresh-effect",
                "XWALK_MODE": "embedded",
                "XWALK_MULTIPLEAPK": "true"
            },
            "cordova-plugin-device": {},
            "cordova-plugin-inappbrowser": {},
            "cordova-plugin-splashscreen": {},
            "cordova-plugin-statusbar": {},
            "cordova-plugin-whitelist": {},
            "cordova-plugin-wkwebview-engine": {},
            "ionic-plugin-keyboard": {},
            "ionic-plugin-deploy": {}
        },
        "platforms": [
            "android",
            "ios"
        ]
    }
}
vetikent commented 6 years ago

I received a similar error when adding the ionic-deploy-plugin and believe the problem may be with that plugin instead of yours.

On another note, I find I have to commit the entire 59MB blinkID plugin to my Git repository in some local plugins directory in order for Ionic Pro's build server to be able to build my app. Is there any way to reduce the size of the plugin? The plugin has a compressed size of 59MB of which the largest files are Microblink.framework/MicroBlink and then some of the bundles.

It would be nice if there was a way to use only the PDF417 module and exclude all unneeded bundles from the packaged plugin. Is there any effort at present to further reduce the size of the plugin?

juraskrlec commented 6 years ago

Hi @veti-io

There is no support for now for reducing framework size for blinkid-phonegap. For PDF417 we have pdf417-phonegap support so check that out and please let us know if that solves the problem.

Best, Jura

Cerovec commented 6 years ago

Hi @veti-io,

to summarize:

1) The first issue was with url to git repository. You solved it by using https link

2) The second issue is regarding "zone.js". Is this still open? Is it connected with BlinkID?

3) The third one is related to the size of the binary. 59M is minimum for BlinkID - we cannot reduce it because we support bitcode. Using pdf417 might reduce that for you.

vetikent commented 6 years ago

I am looking into using the pdf417 library. I don't think the zone.js issue is connected with BlinkID any longer since I think I have narrowed the issue down to the ionic-deploy plugin.

Thanks for your help!

Edit 2017-11-12: Actually, the issue was with the crosswalk browser plugin I was using. I removed crosswalk and everything started working.