ionic-framework icon indicating copy to clipboard operation
ionic-framework copied to clipboard

ionic.Platform.is() unexpected behavior

Open JonathanHindi opened this issue 12 years ago • 3 comments

From forums

I think there is something wrong with ionic.Platform.is(), org.apache.cordova.core.device is installed. I tried the following ionic.Platform.platforms => ["cordova", "ios", "ios7", "ios7"] Then ionic.Platform.is('cordova'); => false, Also note that ios7 is duplicated in the platform array, only ionic.Platform.is('ios') returns true. P.S: The above was run using weiner's console connected to a real iPhone 4. I am also facing some problems with ionic.Platform.ready() but I will check it separately and report back.

JonathanHindi avatar Feb 14 '14 08:02 JonathanHindi

Could you describe what you expect the ionic.Platform.is() to do?

These are the tests we currently have setup for the function: https://github.com/driftyco/ionic/blob/master/js/ext/angular/test/service/ionicPlatform.unit.js

adamdbradley avatar Feb 23 '14 04:02 adamdbradley

I was expecting that it returns true on the cordova too, as it's available in the platforms array. Also note the duplicate in the array for ios7.

JonathanHindi avatar Feb 23 '14 08:02 JonathanHindi

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

ionitron-bot[bot] avatar Sep 06 '18 04:09 ionitron-bot[bot]