-
Notifications
You must be signed in to change notification settings - Fork 316
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
Conversation
…ransition" so we know what kind of transition it is.
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)}" |
There was a problem hiding this comment.
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
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. |
Ohh it is immutable. Duh |
It's better to leave those promises, you can use plugin as you like whether with promise or callback way. |
What this feature given up on ? |
Merged in #97 |
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