337
Views
4
Comments
Solved
distinguishing android or ios
Question

Is there anyway to see by code is it is an android native app or ios?

2020-02-28 09-46-54
Eduardo Jauch
Solution

Hi Filipe,

In the CommonPlugin, there are some actions you can use to find information about the device:

Cheers.

2018-08-27 08-29-35
Fábio Vaz


Filipe,

In the WebPatterns you can use the action CurrentOS to identify the device OS

2021-03-24 17-29-38
Frederico Sousa
Champion

CurrentOS is currently not done to mobile , but its very easily to make it work on offline, just open  a clone of webpatterns, enter the CurrentOS action, and copy paste it into a client action, since it's all ifs and assigns, it will convert all of them to offline ones.

Silk team is already aware of this and will come in a future version (if it's not already, I haven't really seen latest release notes) but you can do this workaround for now.

2015-04-10 17-57-05
Pedro Coelho
 
MVP

You can also do something like this in a Javascript node in a mobile app:

Code: 


var isMobile = { 
   Android: function() { 
      return navigator.userAgent.match(/Android/i); 
   }, iOS: function() { 
      return navigator.userAgent.match(/iPhone|iPad|iPod/i); 
   } 
}; 
if(isMobile.Android()) { 
   // Do stuff 
} else if(isMobile.iOS()) { 
   // Do stuff 
}
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.