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

Android - checking sample app #75

Open
dda-vasavi-yerapotula opened this issue May 23, 2017 · 15 comments
Open

Android - checking sample app #75

dda-vasavi-yerapotula opened this issue May 23, 2017 · 15 comments

Comments

@dda-vasavi-yerapotula
Copy link

I took a test drive and added some fences in the sample app and noticed different color circles. what does green circle, light grey circle and light pink circle means in Android?

@christocracy
Copy link
Member

Green = no transistion event fired yet
Grey = transition event fired
Pink = stop point (not a geofence)

The geofence event callback interacts with google maps API to change the color. That proves the JavaScript event callback fired.

@dda-vasavi-yerapotula
Copy link
Author

Ok thanks for the explanation.

I tested the below scenarios in samsung (added fence from point A to Point B)

  1. tested when app is running in foreground - able to see grey circles (transition fired)
  2. when app is killed in android and after I reached point B - I see only green circles

what does this indicate?

@christocracy
Copy link
Member

It's important to understand that when you terminate the app, you terminate ALL JavaScript.

When you boot the app again, all the circles are redrawn in their initial state (green).

@dda-vasavi-yerapotula
Copy link
Author

Ok Thanks for the information. How will I know it crossed the fence when app is killed in the background as I don't get any additional notification in android and I see only green circles when application open

@christocracy
Copy link
Member

The plugin's database still contains all those recorded locations and geofence events.

If I wanted to, I could re-apply the geofence transition states of by querying the plugin database (assuming those locations hadn't been synced to server yet)

@christocracy
Copy link
Member

With debug: true, you will hear "beep-beep-beep"

That location associated with the geofence event has been persisted to the plugin's database.

If an URL is configured and the server reachable, the plugin could immediately post each geofence event to the server.

@dda-vasavi-yerapotula
Copy link
Author

Oh I see. Any idea why android doesn't notify when fence exits/enters where as I get nice notifications in IOS

@christocracy
Copy link
Member

Because I chose not to. You will hear sound fx

@dda-vasavi-yerapotula
Copy link
Author

Yes I do hear some sounds. we are still having trouble getting it to work in Android when our app is killed and I am trying to test if sample app works fine in Android. Thanks for your help

@christocracy
Copy link
Member

Getting what to work? You understand that all your JavaScript will not run when app is terminated, right?

If you're hoping to show a notification from geofence event when app is terminated, you can't do that with JavaScript.

In sample App, try setting forceReloadOnGeofence: true then terminate the app.

Drive into a geofence. App will launch.

@dda-vasavi-yerapotula
Copy link
Author

Ok I will try this in sample app and see tomorrow. Thanks

@christocracy
Copy link
Member

If I were you, I would forget about local notifications and send push notifications from the server instead, whenever the plugin uploads a geofence event to the server.

@dda-vasavi-yerapotula
Copy link
Author

Chris, we are sending notifications from server side only using AWS SNS.

@christocracy
Copy link
Member

Ah, great then. Simply give the plugin an URL to your server. When you hear beep-beep-beep, you can be sure that geofence event has been posted to your server.

@dda-vasavi-yerapotula
Copy link
Author

My team was saying it is not firing the geofence event after adding all the options. I will first try with sample app in android and will add some logging from our app itself. For some reason the same code has different behavior with Android and IOS

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