A way to detect Platforms on Trigger.io

与世无争的帅哥 提交于 2020-01-15 17:38:58

问题


Is there a way to detect what platform the app is running on with Javascript in trigger.io? It looks like in the olden days there was an is.android and is.ios method that have since disappeared. We have some different behaviors we want to apply to the different browsers.


回答1:


Yes, the forge.is namespace allows you to detect the platform using JavaScript.

To detect if the app is running on an Android device call forge.is.android()

To detect if the app is running on an iOS device call forge.is.ios()

See the Platform Detection docs for more information.




回答2:


depending on your needs there are a few answers.

The isAndroid or isIOS can work for detecting simply the device but will not give you the version number, somtimes you need to detect versions of IOS or android.

To do that you should use the platform module

https://trigger.io/modules/platform/current/docs/index.html



来源:https://stackoverflow.com/questions/23965415/a-way-to-detect-platforms-on-trigger-io

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!