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

Firing receiveTransition if the app is started within a fence #26

Open
gleerman opened this issue Mar 8, 2015 · 9 comments
Open

Firing receiveTransition if the app is started within a fence #26

gleerman opened this issue Mar 8, 2015 · 9 comments

Comments

@gleerman
Copy link

gleerman commented Mar 8, 2015

Hi,

I noticed that when I start my app inside a fence, the receiveTransition is not fired for that fence. I suppose there are some valid arguments for this behaviour, since there is no real transition happening. However, there are cases where it is desirable to notify the app when it is inside a fence on startup.

For iOS, I found this thread. I'm proposing the approach where a check on initialization is implemented. We could provide an argument to the initialize method to toggle this behaviour. Let me know what you think.

Since I am only testing on iOS for now, I am not really aware of the behaviour on Android. I came accross the GEOFENCE_TRANSITION_DWELL transition type, but I am not entirely sure if that is what we are looking for. Anyone who knows more about this for Android or who is willing to test?

Please share your thoughts on this.

@gleerman
Copy link
Author

gleerman commented Mar 9, 2015

Just did an Android test myself. Turns out the receiveTransition is fired by default on startup. I adjusted the iOS code myself and will commit the fix.

@tsubik
Copy link
Member

tsubik commented Mar 11, 2015

Hmm, for me it was undesired behaviour. Maybe it would be better to introduce this as an option. People will have a choice if they want to get this very first notification if they already in the fence. Or just add requestStateForRegion as a new function to the plugin.

@gleerman
Copy link
Author

At first I would have agreed to introduce this as an option. However, since Android has this behaviour enabled by default, it looks like an inconsistency in the plugin. Since I don't think it's possible to disable this behaviour on Android, I'm not sure what the option should do on the Android side.

@tsubik
Copy link
Member

tsubik commented Mar 11, 2015

I could add some timestamp to geofence like created_at and just filter out the new ones while creating notification. I am not aware about function like requestStateForRegion for android, though.

@rlataguerra
Copy link
Contributor

looks interesting to me,
+1

@johnrobertcobbold
Copy link

+1

@tsubik
Copy link
Member

tsubik commented Oct 27, 2015

Thiniking about this again. Looks like guys from google added something like that into API. Just wondering about the scope, I think it would be better to have a possibility to set this for single geofence.

@johnrobertcobbold
Copy link

Just submitted the iOS check on geofence creation/edit here, based on the latest master version of this plugin @ #125

@mhfen
Copy link

mhfen commented Jul 19, 2016

The lack of this functionality is causing Android builds to Crash. #158

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

No branches or pull requests

5 participants