I am using device platform library in angular which works fine but for ios 13+ it does not detect if it is ios or not. It will give me result as false.
Code :
import { Injectable } from '@angular/core';
import platform from 'platform';
@Injectable({
providedIn: 'root'
})
export class DeviceService {
get isAndroid(): boolean {
if (navigator.userAgent.match(/Android/i)) {
return true;
}
return false;
}
get isIOS(): boolean {
return platform.os.family === 'iOS';
}
get isMobile(): boolean {
return this.isAndroid || this.isIOS;
}
get isSidebarEnabled(): boolean {
return !this.isMobile;
}
get isMobileDevice(): boolean {
return this.isMobile;
}
}
How do we fix this for ios 13+. So i have an ipad with the OS version as ios 13.5.1 and in that i always get isIos as false. What could be the reason for this. Other versions it works fine.