-
-
Save ChandraGillellamudi/fec9061629743e307c5a18057968ac87 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let estimoteCloudCredentials = CloudCredentials(appID: "MYAPPID", appToken: "MYAPPTOKEN") | |
proximityObserver = ProximityObserver(credentials: estimoteCloudCredentials, onError: { error in | |
print("ProximityObserver error: \(error)") | |
}) | |
let zone = ProximityZone(tag: "Tag1", range: ProximityRange(desiredMeanTriggerDistance: 10.0)!) | |
zone.onEnter = { zoneContext in | |
self.appdelegate.window?.makeToast("near \(zoneContext.tag)", duration: 3.0) | |
} | |
zone.onExit = { zoneContext in | |
self.appdelegate.window?.makeToast("left \(zoneContext.tag)", duration: 3.0) | |
} | |
let zone1 = ProximityZone(tag: "Tag2", range: ProximityRange(desiredMeanTriggerDistance: 10.0)!) | |
zone1.onEnter = { zoneContext in | |
self.appdelegate.window?.makeToast("near \(zoneContext.tag)", duration: 3.0) | |
} | |
zone1.onExit = { zoneContext in | |
self.appdelegate.window?.makeToast("left \(zoneContext.tag)", duration: 3.0) | |
} | |
proximityObserver.startObserving([zone,zone1]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment