Can Methods Have Mobile-Only Logic

This forum allows users to post and respond to "How Do I Do ....." questions. The information contained in this forum has not been validated by K-Rise Systems and, as such, K-Rise Systems cannot guarantee the accuracy of the information.
Post Reply
JefferyD
Posts: 178
Joined: August 31st, 2021, 11:37 am
Contact:

Can Methods Have Mobile-Only Logic

Unread post by JefferyD »

Is there any way in a method to determine if the current user is using a mobile device?
Last edited by JefferyD on March 15th, 2022, 5:19 pm, edited 1 time in total. word count: 18

Tags:
SteveCap
Posts: 329
Joined: August 26th, 2021, 9:18 am
Contact:

Re: Can Methods Have Mobile-Only Logic

Unread post by SteveCap »

There is a service in Context Services named Get Context.
GetContext.png
GetContext
GetContext.png (6.15 KiB) Viewed 1086 times
GetContext
GetContext
GetContext.png (6.15 KiB) Viewed 1086 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
word count: 83
Post Reply