Class OS
has a method get_name()
which returns a string identifying the current platform. However, it counts HTML5 as a platform, so this won't work for your use case.
Instead you could use get_model_name()
. It returns the model name on Android and iOS, but returns "GenericDevice" on unsupported (i.e. PC) platforms.