iosswiftsdkibeaconestimote

Simple demo proximity events iOS app not working (Estimote beacons)


Hi I build a simple App in Swift following the documentation https://developer.estimote.com/proximity/ios-tutorial/ but when running does not detect a beacon

download your example and detect the beacons without problems, copy and paste each configuration, and part of the code and still does not detect anything,

Any step that is jumping or configuration that prevents me from detecting beacons?

the example is this: https://github.com/Estimote/iOS-Proximity-SDK/tree/master/Examples/Swift/DeskObserver

ViewController

MyAppID was changed for the 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

enter image description here

Capabilities

enter image description here


Solution

  • I don't see a call to startObservingZones (:

    In your case, you could add this line at the bottom of viewDidLoad:

    self.proximityObserver.startObserving([blueberryZone])