我有一个用于Android和iOS的离子应用程序,该应用在特定操作发生时显示消息。
,但我意识到,如果iOS OS高于11或小于10,则此操作有所不同。
。所以我想检测iOS的版本,如果它少于10显示此消息,并且如果它更高,则不显示它。
我是离子的新手,那么我该如何实现?
代码:
function (err) {
if (err == "has no access to assets") {
_this.presentAlert('no access');
}
else if (err == "no image selected") {
_this.presentAlert('nothing selected');
}
});
第一个IF是我要检查设备的OS版本的位置,如果小于11,则显示消息。
如何做?
版本: const currentPlatformVersion = ionic.Platform.version();
如果是iOS设备const isIOS = ionic.Platform.isIOS();
即使此 const deviceInformation = ionic.Platform.device();
也返回一个使用离子应用程序的设备。