Hello,
my App works almost perfectly on Android devices. It has acceptable (normal) performance.
But on iOS devices, even on an iPhone XS Max, the plugins are really slow.
I am checking if bluetooth, internet connection and gps are on and I have a spinner while all of this is being checked. Well, the spinner doesn’t even animate, it looks like a static image.
Also, on Xcode I am getting warning such as " THREAD WARNING: [‘Diagnostic_Location’] took ‘395.238037’ ms. Plugin should use a background thread.
I don’t know if the problem is when checking this stuff but this is my code incase this could be causing this performance issue:
private checkPreconditions(): void {
this.platform.ready().then(() => {
this.requestGPSPermissions();
if (this.network.type == "none") {
this.hasInternet = false;
let connection = this.network.onConnect().subscribe(() => {
this.hasInternet = true;
if (!this.positioning) if (!this.positioning) {
this.events.publish("precondition:set");
this.events.publish("preconditioninit:set");
}
if (!(this.detector as ViewRef).destroyed) this.detector.detectChanges();
connection.unsubscribe();
});
} else {
this.hasInternet = true;
if (!this.positioning) {
this.events.publish("precondition:set");
this.events.publish("preconditioninit:set");
}
}
bluetoothSerial.isEnabled(() => {
this.isBluetoothOn = true;
if (!this.positioning) {
this.events.publish("precondition:set");
this.events.publish("preconditioninit:set");
}
if (!(this.detector as ViewRef).destroyed) this.detector.detectChanges();
}, () => this.enableBluetooth());
this.checkPreconditionsRunTime(true);
});
}
public requestGPSPermissions(): void {
this.platform.ready().then(() => {
this.permissionsService.checkLocationPermissions().then(permissions => {
this.hasGPSPermission = permissions;
if (permissions) {
if (!this.positioning) {
this.events.publish("precondition:set");
this.events.publish("preconditioninit:set");
}
this.diagnostic.isLocationEnabled().then(on => {
this.isGPSOn = on;
if (on) {
if (!this.positioning) {
this.events.publish("precondition:set");
this.events.publish("preconditioninit:set");
}
}
else this.turnGPSOn();
})
}
if (!(this.detector as ViewRef).destroyed) this.detector.detectChanges();
})
})
}
Is there any way to solve this? The way this is now my App is pretty useless