Skip to content
This repository has been archived by the owner on Dec 5, 2019. It is now read-only.

new OTP demo ionic based #19

Closed
wants to merge 1 commit into from
Closed

Conversation

edewit
Copy link
Contributor

@edewit edewit commented Apr 8, 2015

No description provided.

@edewit
Copy link
Contributor Author

edewit commented Apr 10, 2015

@abstractj care to review?

@abstractj
Copy link
Contributor

@edewit sure, will do next week if it's ok for you.

@abstractj
Copy link
Contributor

@edewit sorry for the long delay, I finally got the chance to look at it.

I'm not sure if I'm doing something wrong, but I'm running Cordova 4.2.0 with Node v0.12.2. This is all I got:

$ cordova -v && node -v && bower install && cordova restore plugins --experimental && cordova plugin add org.jboss.aerogear.cordova.otp
4.2.0
v0.12.2

Fetching plugin "org.jboss.aerogear.cordova.otp" via plugin registry
Installing "org.jboss.aerogear.cordova.otp" for ios
Fetching plugin "https://github.com/wildabeast/BarcodeScanner.git" via git clone
Plugin "https://github.com/wildabeast/BarcodeScanner.git" checked out to git ref "HEAD".
Installing "com.phonegap.plugins.barcodescanner" for ios
Failed to install 'org.jboss.aerogear.cordova.otp':Error: "/Users/abstractj/hd2/opensource/aerogear/cordova/aerogear-cordova-cookbook/otp-demo/platforms/Podfile" not located within project!
    at Object.module.exports.common.copyFile (/Users/abstractj/.nvm/v0.12.2/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/platforms/common.js:55:19)
    at Object.module.exports.common.asset.install (/Users/abstractj/.nvm/v0.12.2/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/platforms/common.js:116:20)
    at /Users/abstractj/.nvm/v0.12.2/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/prepare.js:117:26
    at Array.forEach (native)
    at /Users/abstractj/.nvm/v0.12.2/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/prepare.js:116:16
    at Array.forEach (native)
    at Object.handlePrepare (/Users/abstractj/.nvm/v0.12.2/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/prepare.js:81:24)
    at /Users/abstractj/.nvm/v0.12.2/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:599:28
    at _fulfilled (/Users/abstractj/.nvm/v0.12.2/lib/node_modules/cordova/node_modules/q/q.js:787:54)
    at self.promiseDispatch.done (/Users/abstractj/.nvm/v0.12.2/lib/node_modules/cordova/node_modules/q/q.js:816:30)
Error: "/Users/abstractj/hd2/opensource/aerogear/cordova/aerogear-cordova-cookbook/otp-demo/platforms/Podfile" not located within project!
    at Object.module.exports.common.copyFile (/Users/abstractj/.nvm/v0.12.2/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/platforms/common.js:55:19)
    at Object.module.exports.common.asset.install (/Users/abstractj/.nvm/v0.12.2/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/platforms/common.js:116:20)
    at /Users/abstractj/.nvm/v0.12.2/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/prepare.js:117:26
    at Array.forEach (native)
    at /Users/abstractj/.nvm/v0.12.2/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/prepare.js:116:16
    at Array.forEach (native)
    at Object.handlePrepare (/Users/abstractj/.nvm/v0.12.2/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/prepare.js:81:24)
    at /Users/abstractj/.nvm/v0.12.2/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:599:28
    at _fulfilled (/Users/abstractj/.nvm/v0.12.2/lib/node_modules/cordova/node_modules/q/q.js:787:54)
    at self.promiseDispatch.done (/Users/abstractj/.nvm/v0.12.2/lib/node_modules/cordova/node_modules/q/q.js:816:30)

If I try to run the following command:

$ cordova run ios --device
ERROR running one or more of the platforms: Error: "/Users/abstractj/hd2/opensource/aerogear/cordova/aerogear-cordova-cookbook/otp-demo/platforms/Podfile" not located within project!
You may not have the required environment or OS to run this project

@danielpassos when you get the chance, could you please double check?

@edewit
Copy link
Contributor Author

edewit commented Apr 24, 2015

That is definitely a bug, seems that the old Podfile workaround is still being used, we just need to release a new version.

@abstractj
Copy link
Contributor

@edewit +1 on a new release, thanks for the heads up.

@abstractj
Copy link
Contributor

@edewit I think the interface looks gorgeous, and I have few considerations.

I'm testing on Moto X 2nd with Android 5.0

  1. When you click to add a new OTP, the screen goes in landscape mode (not sure if it's expected)

  1. If you attempt to scan an invalid QR Code like http://qrcode.meetheed.com/qrcode_examples.php. The app crashes with no error messages. If you try to open it again, it keeps crashing.
  2. We have a button to add, but I couldn't find anyone to delete

I would like to invite @cvasilak and @danielpassos to review if possible. I didn't get the chance to test on iOS because my certificate has expired.

@cvasilak
Copy link

tested on iOS where:

  1. Opening the camera worked in portrait mode, didn't switch to landscape and stayed there (as in Android)(attached a screenshot)
  2. Didn't experience a crash when scanning an invalid OTP, as in Android, the phone gave me some number and continue on

In all cases, tested the OTP generated and worked correctly.

OTP2

@edewit
Copy link
Contributor Author

edewit commented Apr 30, 2015

@abstractj yeah it switches to landscape mode on android, didn't notice that when I was testing, seems a bug / feature of the barcode scanner that we use.

For the invalid QR code I've created an issue, this has to be solved in the OTP plugin AGCORDOVA-93

With regards to remove, well you can only add one and if you need another one you can add it again. I did that to keep it simple, don't want to recreate the google authenticator. Does that make sense?

@danielpassos
Copy link
Contributor

@abstractj yeah it switches to landscape mode on android, didn't notice that when I was testing, seems a bug / feature of the barcode scanner that we use.

Switch to landscape is not a bug. It's normal on Android land.

@danielpassos
Copy link
Contributor

👀

@danielpassos
Copy link
Contributor

Android

[passos]: ~/Development/Projects/AeroGear/aerogear-cordova-cookbook/otp-demo [git:pr/19]  
→ cordova platform add android
npm http GET https://registry.npmjs.org/cordova-android/4.0.0
npm http 200 https://registry.npmjs.org/cordova-android/4.0.0
npm http GET https://registry.npmjs.org/cordova-android/-/cordova-android-4.0.0.tgz
npm http 200 https://registry.npmjs.org/cordova-android/-/cordova-android-4.0.0.tgz
Adding android project...
Creating Cordova project for the Android platform:
    Path: platforms/android
    Package: org.jboss.aerogear.cordova.otp.demo
    Name: OTP
    Activity: MainActivity
    Android target: android-22
Copying template files...
Android project created with cordova-android@4.0.0
Running command: /Users/passos/Development/Projects/AeroGear/aerogear-cordova-cookbook/otp-demo/hooks/after_prepare/010_add_platform_class.js /Users/passos/Development/Projects/AeroGear/aerogear-cordova-cookbook/otp-demo
Error: spawn EACCES
    at exports._errnoException (util.js:746:11)
    at ChildProcess.spawn (child_process.js:1162:11)
    at Object.exports.spawn (child_process.js:995:9)
    at Object.exports.spawn (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:100:31)
    at runScriptViaChildProcessSpawn (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:189:23)
    at runScript (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:132:16)
    at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:115:20
    at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:787:54)
    at self.promiseDispatch.done (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:816:30)
    at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:749:13)

[passos]: ~/Development/Projects/AeroGear/aerogear-cordova-cookbook/otp-demo [git:pr/19]  
→ cordova run android --device
Running command: /Users/passos/Development/Projects/AeroGear/aerogear-cordova-cookbook/otp-demo/hooks/after_prepare/010_add_platform_class.js /Users/passos/Development/Projects/AeroGear/aerogear-cordova-cookbook/otp-demo
ERROR running one or more of the platforms: Error: spawn EACCES
You may not have the required environment or OS to run this project

iOS

[passos]: ~/Development/Projects/AeroGear/aerogear-cordova-cookbook/otp-demo [git:pr/19]  
→ cordova platform add ios
npm http GET https://registry.npmjs.org/cordova-ios/3.8.0
npm http 200 https://registry.npmjs.org/cordova-ios/3.8.0
npm http GET https://registry.npmjs.org/cordova-ios/-/cordova-ios-3.8.0.tgz
npm http 200 https://registry.npmjs.org/cordova-ios/-/cordova-ios-3.8.0.tgz
Adding ios project...
iOS project created with cordova-ios@3.8.0
Running command: /Users/passos/Development/Projects/AeroGear/aerogear-cordova-cookbook/otp-demo/hooks/after_prepare/010_add_platform_class.js /Users/passos/Development/Projects/AeroGear/aerogear-cordova-cookbook/otp-demo
Error: spawn EACCES
    at exports._errnoException (util.js:746:11)
    at ChildProcess.spawn (child_process.js:1162:11)
    at Object.exports.spawn (child_process.js:995:9)
    at Object.exports.spawn (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:100:31)
    at runScriptViaChildProcessSpawn (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:189:23)
    at runScript (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:132:16)
    at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:115:20
    at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:787:54)
    at self.promiseDispatch.done (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:816:30)
    at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:749:13)

[passos]: ~/Development/Projects/AeroGear/aerogear-cordova-cookbook/otp-demo [git:pr/19]  
→ cordova run ios --device
Running command: /Users/passos/Development/Projects/AeroGear/aerogear-cordova-cookbook/otp-demo/hooks/after_prepare/010_add_platform_class.js /Users/passos/Development/Projects/AeroGear/aerogear-cordova-cookbook/otp-demo
ERROR running one or more of the platforms: Error: spawn EACCES
You may not have the required environment or OS to run this project

@abstractj
Copy link
Contributor

@danielpassos I had the same issue, it seems like a permission issue with the filesystem and the lovely Cordova. Try chmod 777 hooks/after_prepare/*

@danielpassos
Copy link
Contributor

@abstractj Fixed. Thanks!

@danielpassos
Copy link
Contributor

Android

screenshot_2015-05-05-09-31-19

iOS

[passos]: ~/Development/Projects/AeroGear/aerogear-cordova-cookbook/otp-demo [git:pr/19] * 
→ cordova platform add ios
Adding ios project...
iOS project created with cordova-ios@3.8.0
Running command: /Users/passos/Development/Projects/AeroGear/aerogear-cordova-cookbook/otp-demo/hooks/after_prepare/010_add_platform_class.js /Users/passos/Development/Projects/AeroGear/aerogear-cordova-cookbook/otp-demo
add to body class: platform-ios
Installing "com.phonegap.plugins.barcodescanner" for ios
Installing "org.jboss.aerogear.cordova.otp" for ios

[passos]: ~/Development/Projects/AeroGear/aerogear-cordova-cookbook/otp-demo [git:pr/19] * 
→ cordova run ios --device
Running command: /Users/passos/Development/Projects/AeroGear/aerogear-cordova-cookbook/otp-demo/hooks/after_prepare/010_add_platform_class.js /Users/passos/Development/Projects/AeroGear/aerogear-cordova-cookbook/otp-demo
add to body class: platform-ios
Running command: /Users/passos/Development/Projects/AeroGear/aerogear-cordova-cookbook/otp-demo/platforms/ios/cordova/run --device

ERROR running one or more of the platforms: Error: /Users/passos/Development/Projects/AeroGear/aerogear-cordova-cookbook/otp-demo/platforms/ios/cordova/run: Command failed with exit code 2
You may not have the required environment or OS to run this project

@danielpassos
Copy link
Contributor

@cvasilak Have you had that problem?

@edewit
Copy link
Contributor Author

edewit commented May 5, 2015

@danielpassos do you have updated ios command line tools?

xcodebuild -version

should output Xcode 6.3

@cvasilak
Copy link

cvasilak commented May 5, 2015

@danielpassos I didn't, not sure if it helps kill emulator/device and restart from scratch, have some weird issues in the past with cordova failing to find device/emulator running..

Xcode running:

➜  xcodebuild -version
  Xcode 6.3.1
  Build version 6D1002

@danielpassos
Copy link
Contributor

@danielpassos do you have updated ios command line tools?

→ xcodebuild -version
Xcode 6.3.1
Build version 6D1002

@danielpassos
Copy link
Contributor

👍

After install ios-sim and ios-deploy I could run it. For more info see: ionic-team/ionic-cli#282 (comment)

@danielpassos
Copy link
Contributor

Landed at 2ffb902

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
4 participants