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.

Solution

Hi Daniel,

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

Cheers,
Eduardo Jauch

Solution

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.


You're welcome, Mr. Daniel ;)

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".

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".


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..

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.

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?

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)

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 :)


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 ?


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... :)

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 :)

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

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..


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

 

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

Hello.

Please do the following:

Hope this helps.

Best regards.

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.

 

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?

Hi Hubert.

Please check my previous reply, I did an edit.

It's pretty simple.

Cheers

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!