i'm trying to get working method $ionicPlatform.isIOS, to get boolean value by the used platform where is app running.
I tried it on Android device and In Chrome Browser, but without any success result.
$scope.getDeviceInfo = function() {
$scope.isIOS = $ionicPlatform.isIOS();
alert($ionicPlatform.isIOS());
}
Code above is returning following exception:
Uncaught TypeError: undefined is not a function
What i'm doing wrong please?
The $ionicPlatform
service provider does not contain a function isIOS()
. You can see it in this documentation.
What you can do though to check if it is iOS, is using the following function:
$scope.isIOS = ionic.Platform.isIOS();
Found in this documentation.