cowbell / cordova-plugin-geofence

Geofencing plugin for cordova
Apache License 2.0
264 stars 318 forks source link

Phonegap window.geofence is undefined but defined on browser [help wanted] #282

Open Hummelpups opened 5 years ago

Hummelpups commented 5 years ago

Hey there, pretty much as my title says, when i deploy the app on an Android phone via PhoneGap, it states that window.geofence is undefined.

Can anyone help? Phonegap 7.1.1

Thank you. Michael

config.xml `

` index.js crop `...var app = { // Application Constructor initialize: function() { document.addEventListener('deviceready', this.onDeviceReady, false); }, // deviceready Event Handler // // The scope of 'this' is the event. In order to call the 'receivedEvent' // function, we must explicitly call 'app.receivedEvent(...);' onDeviceReady: function() { try{ window.geofence.initialize(); // error window.geofence is undefined } catch(err){ alert(err); }...`
Hummelpups commented 5 years ago

I saw the object is undefined when testing on an android because the phonegap developer app is not transferring the plugin. When i build it via APB and deploy the APK everything's fine. Thanks!