2014-10-08 95 views
0

全部,ESTbeaconMangerDelegate無法在swift中調用函數

我添加了頭文件並在Swift中添加了用於估計信標的SDK。但是當我運行這個簡單的代碼func didRangeBeacons不會被調用。有任何想法嗎 ?

class ViewController: UIViewController, ESTBeaconManagerDelegate { 

    let BeaconManager : ESTBeaconManager = ESTBeaconManager() 

    override func viewDidLoad() { 
     super.viewDidLoad() 

    // set beacon manager delegate 
    BeaconManager.delegate = self 
    var beaconRegion : ESTBeaconRegion = ESTBeaconRegion(proximityUUID: NSUUID(UUIDString: "B9407F30-F5F8-466E-AFF9-25556B57FE6D"), identifier: "Icy Marshmallow") 
    BeaconManager.startRangingBeaconsInRegion(beaconRegion) 

    } 

    override func didReceiveMemoryWarning() { 
     super.didReceiveMemoryWarning() 
     // Dispose of any resources that can be recreated. 
    } 


    func beaconManager(manager: ESTBeaconManager, didRangeBeacons: [ESTBeacon], inRegion: ESTBeaconRegion) { 

     println("Found \(didRangeBeacons.count) in range"); 
    } 
+0

是否因爲藍牙沒有連接,因爲新的設置是藍牙?在Plist文件中? – Jason 2014-10-08 13:33:59

+0

如果您在IOS8中遇到此問題,請查看此https://community.estimote.com/hc/en-us/articles/203393036-Estimote-SDK-and-iOS-8-Location-Services – Jason 2014-10-08 13:37:22

回答

0

確保您使用estimotecloudmanager登錄estimotecloud。將登錄代碼放在AppDelegate Didlaunchwithoptin方法中。