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

Add handled transition #57

Closed
wants to merge 8 commits into from
Closed

Add handled transition #57

wants to merge 8 commits into from

Conversation

andiCR
Copy link
Contributor

@andiCR andiCR commented May 27, 2015

I added a "handledTransition" property to be able to determine, for each geofence, the transition that was handled on the onTransition event (ENTER or EXIT). Might not be the best way to implement it, but it's working on iOS and Android

if let geo = store.findById(region.identifier) {
if let notification = geo["notification"].asDictionary {
notifyAbout(geo)
}

NSNotificationCenter.defaultCenter().postNotificationName("handleTransition", object: geo.description)
var d = geo.description
d = d.substringToIndex(advance(d.startIndex, count(d) - 1)) + ",\"handledTransition\":\(type)}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be better to just change fetched geofence object transitionType like geo["transitionType"] = type

@tsubik
Copy link
Member

tsubik commented Jun 2, 2015

Hey, I like the way @jgcaruso has proposed here #49. Changing transitionType of passed object.

@andiCR
Copy link
Contributor Author

andiCR commented Jun 2, 2015

I like it as well @tsubik , I didn't want to modify any existing data but i'm this is way more elegant than my solution. That said, we would have to change the json class on ios to enable modification of json variables.

@tsubik
Copy link
Member

tsubik commented Jun 3, 2015

Ohh it is immutable. Duh

@tsubik
Copy link
Member

tsubik commented Sep 2, 2015

It's better to leave those promises, you can use plugin as you like whether with promise or callback way.

@tsubik tsubik closed this Sep 2, 2015
@johnrobertcobbold
Copy link

What this feature given up on ?

@tsubik
Copy link
Member

tsubik commented Nov 8, 2015

Merged in #97

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

Successfully merging this pull request may close these issues.

3 participants