Estimote Proximity SDK crashes iOS App

Hello Estimote Team,

We have implemented estimote proximity sdk v0.12.0 in our current iOS app.When our app is running in background or even app is in active state,the app is crashes again & again due to [EPXTimerAnalyticsHeartbeatGenerator startGeneratingHeartbeatForIdentifier:]_block_invoke + 88
As per crash logs.I have also attached crash report for your reference.

This things happens again & again so we won’t continue other functionality of the app, so kindly request you to help us asap to sort out.

Let me know if you need any information from us to sort out this urgent issue.

crashReport.txt (73.9 KB)

Thanks,
Deep

Thanks for sharing! See my comment on this issue here:

Xcode 9.3 with EstimoteProximitySDK (0.12.0) error Thread 1: EXC_BAD_ACCESS (code=1, address=0x10) · Issue #12 · Estimote/iOS-Proximity-SDK · GitHub

I’ve just run into the same problem, and I believe this happens when your ProximityObserver gets released/deallocated without you calling stopObservingZones first.

We’ll look into that, but as a workaround, just make sure you always call stopObservingZones before the ProximityObserver gets deallocated in your app. (If you post your code, we can give you some more hints how to do that.)

Hello @heypiotr here is my code snippet which gets crashed when i run, Please check it out & let me know.

self.proximityObserver.stopObservingZones()
        var ary_Zone : [EPXProximityZone] = []
        for index in 0..<self.muary_BeaconData.count {
            
            let dict = self.muary_BeaconData.object(at: index) as! [String: Any]
            let ary_BeaconRule : NSArray = NSArray(array: dict["beacon_rules"] as! NSArray)
            
            if DataChecker.init(dict: dict, key: "beacon_identifier") != "" {
                
                for index_b in 0..<ary_BeaconRule.count {
                    
                    let data = ary_BeaconRule.object(at: index_b) as! [String: Any]
                    
                    let key = DataChecker.init(dict: data, key: "beacon_key") //+ String(format: ",%@-%@", DataChecker.init(dict: dict, key: "beacon_major"), DataChecker.init(dict: dict, key: "beacon_minor"))
                    let value = String(format: "%@-%@", DataChecker.init(dict: dict, key: "beacon_major"), DataChecker.init(dict: dict, key: "beacon_minor"))
                    
                    let dist : Double = Double(DataChecker.init(dict: data, key:"beacon_distance"))!
                    let check: Double = 0.0
                    
                    if dist > check {
                        
                        let zone = EPXProximityZone(range: EPXProximityRange.custom(desiredMeanTriggerDistance: dist)!, attachmentKey: key, attachmentValue: value)
                        zone.onEnterAction = { attachment in
                            
                            print("Enter", zone.attachmentKey, zone.attachmentValue)
                            let ary = zone.attachmentValue.components(separatedBy: "-")
                            if zone.attachmentKey == "entry" && ary.count > 1 {
                                
                            }
                        }
                        zone.onExitAction = { attachment in
                            
                            print("Exit", zone.attachmentKey, zone.attachmentValue)
                            let ary = zone.attachmentValue.components(separatedBy: "-")
                            if zone.attachmentKey != "entry" && ary.count > 1 {
                                
                            }
                        }
                        
                        ary_Zone.append(zone)
                    }
                }
            }
        }
        
        self.proximityObserver.startObserving(ary_Zone)