2184
Views
22
Comments
Solved
Detect Android or iOS
Question

How can I detect if a phone is android or iOS?  Seems like I've seen a method somewhere but I don't know where it is.


Thanks.

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

Hi Daniel,

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

Cheers,
Eduardo Jauch

2017-08-29 13-22-41
Daniel Brooks

Eduardo Jauch wrote:

Hi Daniel,

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

Cheers,
Eduardo Jauch

Thanks! I was looking at MobilePatterns.

Thanks again Mr. Jauch.


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

You're welcome, Mr. Daniel ;)

UserImage.jpg
H Verheijen

Can someone perhaps tell me in which module?   

BTW: Seems a bit odd naming: WebPatterns for a mobile OS. 

Hence the remark of "..was looking at MobilePatterns".

2017-08-29 13-22-41
Daniel Brooks

H Verheijen wrote:

Can someone perhaps tell me in which module?   

BTW: Seems a bit odd naming: WebPatterns for a mobile OS. 

Hence the remark of "..was looking at MobilePatterns".


UserImage.jpg
Anthony Phan

Hi, I was unable to fin the Web Patterns in forge. Has something changed since this was answered?

I raise this here again because its the first page that comes up when you ask google..

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

Hi Anthny.

Web Patterns is part of Silk UI (so, if you are working with Silk UI, it should be available from the start).
If you are using OutSystems UI new framework (O11), it is under OutSystemsWebUI:

Cheers.

UserImage.jpg
Leon Verster

Hi there,

I've tried to use the DeviceDetection components with PWA, but these do not seem to work with PWA? I had to revert to my own JS. Anyone else perhaps having the same issue?

2023-05-02 16-46-00
João Grazina

Have you tried updating OutSystems UI to the latest version?

Please note the screenshot you have is from OutSystems UI Web - which is not for PWA. You should be building a mobile application with OutSystems UI (not Web)

UserImage.jpg
Leon Verster

Grazina wrote:

Have you tried updating OutSystems UI to the latest version?

Please note the screenshot you have is from OutSystems UI Web - which is not for PWA. You should be building a mobile application with OutSystems UI (not Web)

Hi Grazina - thanks for your reply. That was the issue indeed - solved :)


UserImage.jpg
deddy effendi

Grazina wrote:

Have you tried updating OutSystems UI to the latest version?

Please note the screenshot you have is from OutSystems UI Web - which is not for PWA. You should be building a mobile application with OutSystems UI (not Web)

halo grazina, i want to ask something, if we want to validate the mobile operating system we can used getOS, am i right ? so if we use that, there is variable User agent inside of it. how to fill the user agent ? coz i still cannot define Os whether is android or IOS ?


UserImage.jpg
Leon Verster

deddy effendi wrote:

Grazina wrote:

Have you tried updating OutSystems UI to the latest version?

Please note the screenshot you have is from OutSystems UI Web - which is not for PWA. You should be building a mobile application with OutSystems UI (not Web)

halo grazina, i want to ask something, if we want to validate the mobile operating system we can used getOS, am i right ? so if we use that, there is variable User agent inside of it. how to fill the user agent ? coz i still cannot define Os whether is android or IOS ?


I tested on PWA and also do not get the OS value returned. Have you tried USerAgent = ""? Are you doing this in a native Mobile App or PWA? (GetDeviceType works in PWA though... :)

UserImage.jpg
deddy effendi

Leon Verster wrote:

deddy effendi wrote:

Grazina wrote:

Have you tried updating OutSystems UI to the latest version?

Please note the screenshot you have is from OutSystems UI Web - which is not for PWA. You should be building a mobile application with OutSystems UI (not Web)

halo grazina, i want to ask something, if we want to validate the mobile operating system we can used getOS, am i right ? so if we use that, there is variable User agent inside of it. how to fill the user agent ? coz i still cannot define Os whether is android or IOS ?


I tested on PWA and also do not get the OS value returned. Have you tried USerAgent = ""? Are you doing this in a native Mobile App or PWA? (GetDeviceType works in PWA though... :)


i'm doing this on native mobile, i thought if i add it, i can get type of android OS. i've tried USerAgent = "" but it didn't work. thnks for your advise :)

2021-08-12 11-00-27
Nordin Ahdi
 
MVP

Hi Deddy,

For Native Mobile you could use the GetPlatform action from the CommonPlugin. It should return whether the platform is iOS or Android.

Regards,

Nordin

UserImage.jpg
deddy effendi

Nordin Ahdi wrote:

Hi Deddy,

For Native Mobile you could use the GetPlatform action from the CommonPlugin. It should return whether the platform is iOS or Android.

Regards,

Nordin

thnks.. i try it first..


UserImage.jpg
Leon Verster

Hi Nordin - I tried both 'GetPlatform' and 'GetOperatingSystem' (Commonplugin) in PWA but this does not return results. Must be a PWA limitation? 

Deddi - would be good to hear if this works in Native Mobile?

Thx for your replies :)

Leon

 

UserImage.jpg
Hubert

Hi, I am trying to use these device detection client actions from OutsystemsUI in a reactive web app, but they do not return a value. I am putting "" into the UserAgent parameter, because I have no clue what else to input.

I have OutSystemsUI version 2.5.8

2020-06-24 16-15-30
Rui Mendes
Staff

Hello.

Please do the following:

Hope this helps.

Best regards.

UserImage.jpg
Hubert

Rui Mendes wrote:

Hello.

To get the userAgent, you have a simple JS node with the following structure:

Hope this helps.

Best regards.

 Thanks Rui. I also found a solution via this question.

Regards,

Hubert.

 

2020-06-24 16-15-30
Rui Mendes
Staff

Hi Hubert.

Please check my previous reply, I did an edit.

It's pretty simple.

Cheers

UserImage.jpg
Hubert

Rui Mendes wrote:

Hi Hubert.

Please check my previous reply, I did an edit.

It's pretty simple.

Cheers

 Thanks and yes, the same solution!

 

UserImage.jpg
mathew jone

I've attempted to utilize the DeviceDetection segments with PWA, yet these don't appear to work with PWA? I needed to return to my own JS. Any other person maybe having a similar issue?

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.