Divide desktop and pos view on pos embedded app

Hoken
New Member
4 0 0

I'm developing a shopify pos-embedded app, i need to view different page when opening the app on desktop and pos. I mean, I've to view a sort of configuration page from the desktop admin panel which won't be visible on the normal app on pos. It is possible?

0 Likes
SBD_
Shopify Staff
Shopify Staff
1043 141 183

Hey @Hoken,

 

What's different on the POS vs desktop app? Have you tried experimenting with media queries?

0 Likes
Hoken
New Member
4 0 0

Hi Scotty,
I  saw media query but I meant to have 2 different pages not just on aesthetics . I saw that when you open the link on pos app, for example in "order complete" section, you can redirect the user on any page of your application, so I thought it would be possible to let admin's user configurate some parameters in a configuration page on desktop myshopify.com/admin and redirect normal users from pos to real app. It is possible?

0 Likes
policenauts1
Trailblazer
173 13 32

I'd also love to hear how others achieve this. In App Bridge, I use app.getState() which has data and pos objects which can be helpful in telling you if they're opening your app in POS or not. 

0 Likes
Trish_Ta
Shopify Staff
Shopify Staff
56 13 20

Hi all,

There are several utilities from `@shopify/app-bridge-utils` you can use to see which platform the app is running on.

The docs will be published to the Developer site soon.

  • `isShopifyMobile` will return true if the app is running on Shopify Mobile.
  • `isShopifyPOS` will return true for Shopify POS
  • `isShopifyPing` returns true for Shopify Ping
  • `isMobile` returns true if of the previous 3 returns `true`

 

 

import {isShopifyPOS} from '@shopify/app-bridge-utils';

if (isShopifyPOS()) {
// app is running on Shopify POS
}

 

policenauts1
Trailblazer
173 13 32

Thanks @Trish_Ta ! Would it be difficult to add a flag for Classic vs. new Shopify POS? 

0 Likes