Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sample app code doesn't work #125

Open
subhanengg opened this issue Feb 11, 2020 · 8 comments
Open

Sample app code doesn't work #125

subhanengg opened this issue Feb 11, 2020 · 8 comments

Comments

@subhanengg
Copy link

Hi, I am trying to follow your sample app code to run in debug mode with below configurations but it fails everytime

Cordova - 9.0
cordova-ios: 5.1.0
Node: 10.16.X

Kindly guide me as I want to use this plugin in one of my project for background geofencing.

@christocracy
Copy link
Member

Define "fails every time".

@subhanengg
Copy link
Author

Everytime I try to register with github username and organization, it doesn't take and always prompt me to enter it again. But it doesn't accept it. -- In real devices
No errors reported in logs either.

When I run it in android emulators, textboxes aren't clickable and it doesn't allow me to type username and organization in the fields.

@christocracy
Copy link
Member

I don’t know. I need logs.

I have the SampleApp running on 11 Android devices without issue.

  • Nexus 4 @ 4.4.4
  • Nexus 5 @ 6.0.1
  • Motorola Moto G @ 6.0.0
  • Google Pixel @ 10
  • Google Pixel 3a @ 10
  • Samsung J @ 6.0.1
  • Samsung A510 @ 8.0.0
  • Huawei P20 Lite (ANE-LX3) @ 8.0.0
  • XIAOMI MI A2 Lite @ 9.0.0
  • Nokia TA-1027 @ 8.0.0
  • OnePlus A5010 @ 8.0.0

@subhanengg
Copy link
Author

I don’t know. I need logs.

I have the SampleApp running on 11 Android devices without issue.

  • Nexus 4 @ 4.4.4
  • Nexus 5 @ 6.0.1
  • Motorola Moto G @ 6.0.0
  • Google Pixel @ 10
  • Google Pixel 3a @ 10
  • Samsung J @ 6.0.1
  • Samsung A510 @ 8.0.0
  • Huawei P20 Lite (ANE-LX3) @ 8.0.0
  • XIAOMI MI A2 Lite @ 9.0.0
  • Nokia TA-1027 @ 8.0.0
  • OnePlus A5010 @ 8.0.0

I will try to get the logs and share it here

@subhanengg
Copy link
Author

Finally I was able to get the logs from logcat and chrome's web inspector. This time I was able to type my Github username and org names.
Below are the logs from Chrome's web inspector

vendor.js:4373 Angular is running in the development mode. Call enableProdMode() to enable the production mode.
3.js:123 ionViewDidLoad HomePage
main.js:183 [registerTransistorAuthorizationListener]
vendor.js:2134 ERROR Error: Uncaught (in promise): TypeError: Cannot read property 'onHttp' of undefined
TypeError: Cannot read property 'onHttp' of undefined
at Function.BackgroundGeolocation.onHttp (vendor.js:128470)
at main.js:228
at step (main.js:139)
at Object.next (main.js:120)
at main.js:114
at new t (polyfills.js:3)
at webpackJsonp.341.__awaiter (main.js:110)
at registerTransistorAuthorizationListener (main.js:179)
at main.js:371
at t.invoke (polyfills.js:3)
at Function.BackgroundGeolocation.onHttp (vendor.js:128470)
at main.js:228
at step (main.js:139)
at Object.next (main.js:120)
at main.js:114
at new t (polyfills.js:3)
at webpackJsonp.341.__awaiter (main.js:110)
at registerTransistorAuthorizationListener (main.js:179)
at main.js:371
at t.invoke (polyfills.js:3)
at c (polyfills.js:3)
at new t (polyfills.js:3)
at webpackJsonp.341.__awaiter (main.js:110)
at registerTransistorAuthorizationListener (main.js:179)
at main.js:371
at t.invoke (polyfills.js:3)
at Object.onInvoke (vendor.js:5445)
at t.invoke (polyfills.js:3)
at r.run (polyfills.js:3)
at polyfills.js:3
defaultErrorLogger @ vendor.js:2134
vendor.js:2134 ERROR Error: Uncaught (in promise): TypeError: Cannot read property 'stop' of undefined
TypeError: Cannot read property 'stop' of undefined
at Function.BackgroundGeolocation.stop (vendor.js:128542)
at HomePage.webpackJsonp.693.HomePage.onDeviceReady (3.js:129)
at t.invoke (polyfills.js:3)
at Object.onInvoke (vendor.js:5445)
at t.invoke (polyfills.js:3)
at r.run (polyfills.js:3)
at polyfills.js:3
at t.invokeTask (polyfills.js:3)
at Object.onInvokeTask (vendor.js:5436)
at t.invokeTask (polyfills.js:3)
at Function.BackgroundGeolocation.stop (vendor.js:128542)
at HomePage.webpackJsonp.693.HomePage.onDeviceReady (3.js:129)
at t.invoke (polyfills.js:3)
at Object.onInvoke (vendor.js:5445)
at t.invoke (polyfills.js:3)
at r.run (polyfills.js:3)
at polyfills.js:3
at t.invokeTask (polyfills.js:3)
at Object.onInvokeTask (vendor.js:5436)
at t.invokeTask (polyfills.js:3)
at c (polyfills.js:3)
at polyfills.js:3
at t.invokeTask (polyfills.js:3)
at Object.onInvokeTask (vendor.js:5436)
at t.invokeTask (polyfills.js:3)
at r.runTask (polyfills.js:3)
at o (polyfills.js:3)
defaultErrorLogger @ vendor.js:2134
util.js:232 Google Maps JavaScript API warning: NoApiKeys https://developers.google.com/maps/documentation/javascript/error-messages#no-api-keys
ez.j @ util.js:232
util.js:232 Google Maps JavaScript API warning: InvalidKey https://developers.google.com/maps/documentation/javascript/error-messages#invalid-key
ez.j @ util.js:232
2.js:115 ionViewDidLoad RegistrationPage
vendor.js:2134 ERROR Error: Uncaught (in promise): TypeError: Cannot read property 'getDeviceInfo' of undefined
TypeError: Cannot read property 'getDeviceInfo' of undefined
at Function.BackgroundGeolocation.getDeviceInfo (vendor.js:128679)
at RegistrationPage. (2.js:123)
at step (2.js:90)
at Object.next (2.js:71)
at 2.js:65
at new t (polyfills.js:3)
at webpackJsonp.695.__awaiter (2.js:61)
at RegistrationPage.webpackJsonp.695.RegistrationPage.onReady (2.js:119)
at t.invoke (polyfills.js:3)
at Object.onInvoke (vendor.js:5445)
at Function.BackgroundGeolocation.getDeviceInfo (vendor.js:128679)
at RegistrationPage. (2.js:123)
at step (2.js:90)
at Object.next (2.js:71)
at 2.js:65
at new t (polyfills.js:3)
at webpackJsonp.695.__awaiter (2.js:61)
at RegistrationPage.webpackJsonp.695.RegistrationPage.onReady (2.js:119)
at t.invoke (polyfills.js:3)
at Object.onInvoke (vendor.js:5445)
at c (polyfills.js:3)
at c (polyfills.js:3)
at polyfills.js:3
at t.invokeTask (polyfills.js:3)
at Object.onInvokeTask (vendor.js:5436)
at t.invokeTask (polyfills.js:3)
at r.runTask (polyfills.js:3)
at o (polyfills.js:3)
defaultErrorLogger @ vendor.js:2134
vendor.js:2134 ERROR Error: Uncaught (in promise): TypeError: Cannot read property 'destroyTransistorAuthorizationToken' of undefined
TypeError: Cannot read property 'destroyTransistorAuthorizationToken' of undefined
at Function.BackgroundGeolocation.destroyTransistorAuthorizationToken (vendor.js:128695)
at RegistrationPage. (2.js:158)
at step (2.js:90)
at Object.next (2.js:71)
at 2.js:65
at new t (polyfills.js:3)
at webpackJsonp.695.__awaiter (2.js:61)
at RegistrationPage.webpackJsonp.695.RegistrationPage.onClickRegister (2.js:137)
at Object.eval [as handleEvent] (RegistrationPage.html:48)
at handleEvent (vendor.js:14274)
at Function.BackgroundGeolocation.destroyTransistorAuthorizationToken (vendor.js:128695)
at RegistrationPage. (2.js:158)
at step (2.js:90)
at Object.next (2.js:71)
at 2.js:65
at new t (polyfills.js:3)
at webpackJsonp.695.__awaiter (2.js:61)
at RegistrationPage.webpackJsonp.695.RegistrationPage.onClickRegister (2.js:137)
at Object.eval [as handleEvent] (RegistrationPage.html:48)
at handleEvent (vendor.js:14274)
at c (polyfills.js:3)
at new t (polyfills.js:3)
at webpackJsonp.695.__awaiter (2.js:61)
at RegistrationPage.webpackJsonp.695.RegistrationPage.onClickRegister (2.js:137)
at Object.eval [as handleEvent] (RegistrationPage.html:48)
at handleEvent (vendor.js:14274)
at callWithDebugContext (vendor.js:15783)
at Object.debugHandleEvent [as handleEvent] (vendor.js:15370)
at dispatchEvent (vendor.js:10689)
at vendor.js:11314
defaultErrorLogger @ vendor.js:2134
ErrorHandler.handleError @ vendor.js:2195
IonicErrorHandler.handleError @ vendor.js:144524
next @ vendor.js:6193
schedulerFn @ vendor.js:5027
SafeSubscriber.__tryOrUnsub @ vendor.js:20899
SafeSubscriber.next @ vendor.js:20846
Subscriber._next @ vendor.js:20786
Subscriber.next @ vendor.js:20750
Subject.next @ vendor.js:23238
EventEmitter.emit @ vendor.js:5007
(anonymous) @ vendor.js:5467
t.invoke @ polyfills.js:3
r.run @ polyfills.js:3
NgZone.runOutsideAngular @ vendor.js:5393
onHandleError @ vendor.js:5467
t.handleError @ polyfills.js:3
r.runGuarded @ polyfills.js:3
(anonymous) @ polyfills.js:3
n.microtaskDrainDone @ polyfills.js:3
o @ polyfills.js:3
e.invokeTask @ polyfills.js:3
p @ polyfills.js:2
v @ polyfills.js:2

My machine's configuration if this helps
Ionic:

Ionic CLI : 5.4.14 (/usr/local/lib/node_modules/ionic)
Ionic Framework : ionic-angular 3.9.3
@ionic/app-scripts : 3.2.2

Cordova:

Cordova CLI : 9.0.0 ([email protected])
Cordova Platforms : android 6.1.2, ios 4.3.1
Cordova Plugins : cordova-plugin-ionic-webview 4.1.3, (and 7 other plugins)

Utility:

cordova-res (update available: 0.9.0) : 0.8.1
native-run : 0.3.0

System:

ios-sim : 8.0.2
NodeJS : v10.16.3 (/usr/local/bin/node)
npm : 6.11.3
OS : macOS Mojave
Xcode : Xcode 11.3.1 Build version 11C504

@christocracy
Copy link
Member

The plugin is not installed. Did follow the setup instructions in the README exactly?

@subhanengg
Copy link
Author

Yes I did follow the instructions and yes I do see the plugin installed in the list of plugins.

ionic cordova plugin ls

cordova plugin ls
cordova-background-geolocation-lt 3.4.2 "BackgroundGeolocation"
cordova-plugin-device 2.0.3 "Device"
cordova-plugin-dialogs 2.0.1 "Notification"
cordova-plugin-ionic-webview 4.1.3 "cordova-plugin-ionic-webview"
cordova-plugin-splashscreen 5.0.2 "Splashscreen"
cordova-plugin-statusbar 2.4.2 "StatusBar"
cordova-plugin-whitelist 1.3.3 "Whitelist"
ionic-plugin-keyboard 2.2.1 "Keyboard"

Please let me know if I am missing any step from below mentioned in readme
Step 1: Start by cloning this repo
$ git clone https://github.com/transistorsoft/cordova-background-geolocation-SampleApp.git
Step 2: Building and Running the Ionic 3 App
$ npm install

$ npm install -g cordova ionic # you should have ionic and cordova installed

$ ionic cordova prepare android
$ ionic cordova run android --device

$ ionic cordova prepare ios
$ ionic cordova run ios --emulator
// opens a web console which receives all your locations
$ npm run open

@subhanengg
Copy link
Author

@christocracy Could you please confirm if any step is missing by me? As I tried multiple times but still failing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants