Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Get user device info

Avatar

Avatar
Validate 1
Level 1
parag_dalal
Level 1

Likes

2 likes

Total Posts

20 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
Applaud 5
View profile

Avatar
Validate 1
Level 1
parag_dalal
Level 1

Likes

2 likes

Total Posts

20 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
Applaud 5
View profile
parag_dalal
Level 1

07-03-2021

Hello, guys, how are you?

I am wondering, is there a way I can get informations about the device the user is using to navigate the site, perhaps from the request object?
Namely, I'd be interested in informations such as the device group to which the user device belongs, and - ideally - informations about the screen size.

I did try adapting the request object to the Device.class, as well as retrieving (successfully so) an instance of the DeviceMapper and then calling the method deviceMapper.getDeviceInstance(request), but I have had zero luck obtaining a non-null instance of the Device class.

In general, I am dubious whether it is even possible to infer informations about the user's device e device's size while working server-side.

 

I would be very grateful if any of you had any considerations and were willing to illuminate me.

Thank you so much,

Parag.

View Entire Topic

Avatar

Avatar
Establish
MVP
Anudeep_Garnepudi
MVP

Likes

271 likes

Total Posts

320 posts

Correct Reply

87 solutions
Top badges earned
Establish
Ignite 1
Give Back 5
Give Back 3
Give Back 10
View profile

Avatar
Establish
MVP
Anudeep_Garnepudi
MVP

Likes

271 likes

Total Posts

320 posts

Correct Reply

87 solutions
Top badges earned
Establish
Ignite 1
Give Back 5
Give Back 3
Give Back 10
View profile
Anudeep_Garnepudi
MVP

08-03-2021

@parag_dalal 

If you are doing it in server side, consider that the page will be cached and will always give the device info of the first requested device.