The Device API allows the UI Extension to retrieve device information including the device name and ID.
The name of the device
The string ID of the device
Whether the device is a tablet
The Device API allows the UI Extension to retrieve device information including the device name and ID.
import React, { useState } from 'react';
import {
Tile,
useApi,
reactExtension,
} from '@shopify/ui-extensions-react/point-of-sale';
const SmartGridTile = () => {
const api = useApi<'pos.home.tile.render'>();
return (
<Tile
title='My App'
subtitle={api.device.name}
enabled
/>
);
};
export default reactExtension('pos.home.tile.render', () => <SmartGridTile />);
import {
Tile,
Screen,
Navigator,
extension,
} from '@shopify/ui-extensions/point-of-sale';
export default extension('pos.home.tile.render', (root, api) => {
const tile = root.createComponent(Tile, {
title: 'My App',
subtitle: api.device.name,
enabled: true,
});
root.append(tile);
});
import React, { useState } from 'react';
import {
Tile,
useApi,
reactExtension,
} from '@shopify/ui-extensions-react/point-of-sale';
const SmartGridTile = () => {
const api = useApi<'pos.home.tile.render'>();
return (
<Tile
title='My App'
subtitle={api.device.name}
enabled
/>
);
};
export default reactExtension('pos.home.tile.render', () => <SmartGridTile />);
import {
Tile,
Screen,
Navigator,
extension,
} from '@shopify/ui-extensions/point-of-sale';
export default extension('pos.home.tile.render', (root, api) => {
const tile = root.createComponent(Tile, {
title: 'My App',
subtitle: api.device.name,
enabled: true,
});
root.append(tile);
});
import React, { useState } from 'react';
import {
Tile,
useApi,
reactExtension,
} from '@shopify/ui-extensions-react/point-of-sale';
const SmartGridTile = () => {
const api = useApi<'pos.home.tile.render'>();
return (
<Tile
title='My App'
subtitle={api.device.getDeviceId()}
enabled
/>
);
};
export default reactExtension('pos.home.tile.render', () => <SmartGridTile />);
import {
Tile,
Screen,
Navigator,
extension,
} from '@shopify/ui-extensions/point-of-sale';
export default extension('pos.home.tile.render', (root, api) => {
const tile = root.createComponent(Tile, {
title: 'My App',
subtitle: api.device.getDeviceId(),
enabled: true,
});
root.append(tile);
});
import React, { useState } from 'react';
import {
Tile,
useApi,
reactExtension,
} from '@shopify/ui-extensions-react/point-of-sale';
const SmartGridTile = () => {
const api = useApi<'pos.home.tile.render'>();
return (
<Tile
title='My App'
subtitle={api.device.getDeviceId()}
enabled
/>
);
};
export default reactExtension('pos.home.tile.render', () => <SmartGridTile />);
import {
Tile,
Screen,
Navigator,
extension,
} from '@shopify/ui-extensions/point-of-sale';
export default extension('pos.home.tile.render', (root, api) => {
const tile = root.createComponent(Tile, {
title: 'My App',
subtitle: api.device.getDeviceId(),
enabled: true,
});
root.append(tile);
});
import React, { useState } from 'react';
import {
Tile,
useApi,
reactExtension,
} from '@shopify/ui-extensions-react/point-of-sale';
const SmartGridTile = () => {
const api = useApi<'pos.home.tile.render'>();
return (
<Tile
title='My App'
enabled={api.device.isTablet()}
/>
);
};
export default reactExtension('pos.home.tile.render', () => <SmartGridTile />);
import {
Tile,
Screen,
Navigator,
extension,
} from '@shopify/ui-extensions/point-of-sale';
export default extension('pos.home.tile.render', (root, api) => {
const tile = root.createComponent(Tile, {
title: 'My App',
enabled: api.device.isTablet(),
});
root.append(tile);
});
import React, { useState } from 'react';
import {
Tile,
useApi,
reactExtension,
} from '@shopify/ui-extensions-react/point-of-sale';
const SmartGridTile = () => {
const api = useApi<'pos.home.tile.render'>();
return (
<Tile
title='My App'
enabled={api.device.isTablet()}
/>
);
};
export default reactExtension('pos.home.tile.render', () => <SmartGridTile />);
import {
Tile,
Screen,
Navigator,
extension,
} from '@shopify/ui-extensions/point-of-sale';
export default extension('pos.home.tile.render', (root, api) => {
const tile = root.createComponent(Tile, {
title: 'My App',
enabled: api.device.isTablet(),
});
root.append(tile);
});