Skip to content

Bug Report #202

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
NiccoloCase opened this issue May 10, 2023 · 3 comments
Open

Bug Report #202

NiccoloCase opened this issue May 10, 2023 · 3 comments
Labels
verify New bug report that has not yet been verified

Comments

@NiccoloCase
Copy link

Context: ReactNative App with a swift module

How to reproduce:

1)Call start first time

2)Call stop

3)Call start again.

It scan nothing without errors

what I expect:

To connect again to the device near me. How I can reset without close the app?

@objc
func start(_ message: String){
DispatchQueue.main.async {
NotificationCenter.default.addObserver(forName: UIApplication.didBecomeActiveNotification, object: nil, queue: .main) { _ in
self.active = true
}
NotificationCenter.default.addObserver(forName: UIApplication.didEnterBackgroundNotification, object: nil, queue: .main) { _ in
self.active = false
}
}

//discoverer.startDiscovery()
print("PARTITO")
print(self.Messages)
//advertiser.startAdvertising(using: message.data(using: .utf8)!)
payloadDataSupplier = MySupplier(message: message)
self.sensor = SensorArray(payloadDataSupplier!)
self.sensor?.add(delegate: self)
self.sensor?.start()


locationManager.pausesLocationUpdatesAutomatically = false
locationManager.desiredAccuracy = kCLLocationAccuracyThreeKilometers
locationManager.distanceFilter = 3000.0
locationManager.showsBackgroundLocationIndicator = true;
if #available(iOS 9.0, *) {
  locationManager.allowsBackgroundLocationUpdates = true
} else {
  // not needed on earlier versions
}
// start updating location at beginning just to give us unlimited background running time
self.locationManager.startUpdatingLocation()

//periodicallySendScreenOnNotifications(message:message)
extendBackgroundRunningTime()


self.sendEvent(withName: EventType.onActivityStart.rawValue, body: "Success")

}

@objc(stop)
func stop(){
self.Messages = Array();
self.locationManager.stopUpdatingLocation();
self.threadShouldExit = true
self.active = false
UIApplication.shared.endBackgroundTask(self.backgroundTask)
//advertiser.stopAdvertising()
self.sensor?.stop()
payloadDataSupplier = MySupplier(message: "")
self.sensor = SensorArray(payloadDataSupplier!)
//discoverer.stopDiscovery()
self.sendEvent(withName: EventType.onActivityStop.rawValue, body: "Success")
}

@NiccoloCase NiccoloCase added the verify New bug report that has not yet been verified label May 10, 2023
@Romoli-Gabriele
Copy link

Same problem

@NiccoloCase
Copy link
Author

no activity?

@Romoli-Gabriele
Copy link

When I restart the sensor I have this error
Screenshot 2023-07-09 alle 18 56 22

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
verify New bug report that has not yet been verified
Projects
None yet
Development

No branches or pull requests

2 participants