kevinmcisaac
Posts: 37
Joined: Mon Oct 05, 2020 8:27 am

How do I check which platform the code is executing on ?

How do I check which platform the code is executing on , i.e., web browers, vs Android APK, vs iPhone?

I want to be able to use this in my Typescript or in an element property, i.e., [[hidden]

kevinmcisaac
Posts: 37
Joined: Mon Oct 05, 2020 8:27 am

Re: How do I check which platform the code is executing on ?

I ended up using the ionic Platform (https://ionicframework.com/docs/angular/platform) service .

As its already in Appery all I had to in the screen I want to check the platfrom is:

  • add Platform to the "Internal includes", i.e., code/includes

  • add the variable "platform", type Platform and checked DI

  • call this.platform.platforms().includes('cordova')

Return to “Issues”