Page 1 of 1

Can Methods Have Mobile-Only Logic

Posted: January 26th, 2022, 6:35 pm
by JefferyD
Is there any way in a method to determine if the current user is using a mobile device?

Re: Can Methods Have Mobile-Only Logic

Posted: January 27th, 2022, 10:41 am
by SteveCap
There is a service in Context Services named Get Context.
GetContext.png
GetContext
GetContext.png (6.15 KiB) Viewed 1095 times
GetContext
GetContext
GetContext.png (6.15 KiB) Viewed 1095 times
This service takes no input and returns the following output.

Code: Select all

<GetContext>
	<Output>
		<Result>
			<Application>
				<Name/>
				<Description/>
				<ApplicationId/>
				<SecurityApplicationId/>
			</Application>
			<Environment>
				<Name/>
			</Environment>
			<Page>
				<Name/>
				<PageDescription/>
				<DeviceType/>
			</Page>
		</Result>
	</Output>
</GetContext>
You can then use a binary decision on

Code: Select all

WorkData/GetContext/Output/Result/Page/DeviceType
which will return Desktop or Phone