简单的演示接近事件 iOS 应用程序不工作(Estimote 信标)
Simple demo proximity events iOS app not working (Estimote beacons)
您好,我按照文档 https://developer.estimote.com/proximity/ios-tutorial/ 在 Swift 中构建了一个简单的应用程序,但是当 运行 没有检测到信标时
下载您的示例并检测到信标没有问题,复制并粘贴每个配置和部分代码,但仍然没有检测到任何东西,
任何阻止我检测信标的跳跃步骤或配置?
例子是这样的:https://github.com/Estimote/iOS-Proximity-SDK/tree/master/Examples/Swift/DeskObserver
ViewController
MyAppID 已更改 post :D
import UIKit
import EstimoteProximitySDK
class LugarActualViewController: UIViewController {
var proximityObserver: EPXProximityObserver!
override func viewDidLoad() {
super.viewDidLoad()
let cloudCredentials = EPXCloudCredentials(appID: "My AppID",appToken: "MYAPPTOKEN")
self.proximityObserver = EPXProximityObserver(
credentials: cloudCredentials,
errorBlock: { error in
print("proximity observer error: \(error)")
})
let blueberryZone = EPXProximityZone(range: EPXProximityRange.custom(desiredMeanTriggerDistance: 0.5)!,
attachmentKey: "floor",
attachmentValue: "1st")
blueberryZone.onEnterAction = { attachment in
print("Enter blueberry (close range)")
}
blueberryZone.onExitAction = { attachment in
print("Exit blueberry (close range)")
}
// Do any additional setup after loading the view.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
info.plis
能力
我没有看到对 startObservingZones
的调用(:
对于您的情况,您可以在 viewDidLoad
的底部添加此行:
self.proximityObserver.startObserving([blueberryZone])
您好,我按照文档 https://developer.estimote.com/proximity/ios-tutorial/ 在 Swift 中构建了一个简单的应用程序,但是当 运行 没有检测到信标时
下载您的示例并检测到信标没有问题,复制并粘贴每个配置和部分代码,但仍然没有检测到任何东西,
任何阻止我检测信标的跳跃步骤或配置?
例子是这样的:https://github.com/Estimote/iOS-Proximity-SDK/tree/master/Examples/Swift/DeskObserver
ViewController
MyAppID 已更改 post :D
import UIKit
import EstimoteProximitySDK
class LugarActualViewController: UIViewController {
var proximityObserver: EPXProximityObserver!
override func viewDidLoad() {
super.viewDidLoad()
let cloudCredentials = EPXCloudCredentials(appID: "My AppID",appToken: "MYAPPTOKEN")
self.proximityObserver = EPXProximityObserver(
credentials: cloudCredentials,
errorBlock: { error in
print("proximity observer error: \(error)")
})
let blueberryZone = EPXProximityZone(range: EPXProximityRange.custom(desiredMeanTriggerDistance: 0.5)!,
attachmentKey: "floor",
attachmentValue: "1st")
blueberryZone.onEnterAction = { attachment in
print("Enter blueberry (close range)")
}
blueberryZone.onExitAction = { attachment in
print("Exit blueberry (close range)")
}
// Do any additional setup after loading the view.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
info.plis
能力
我没有看到对 startObservingZones
的调用(:
对于您的情况,您可以在 viewDidLoad
的底部添加此行:
self.proximityObserver.startObserving([blueberryZone])