How to use the expo-constants.deviceId function in expo-constants

To help you get started, we’ve selected a few expo-constants examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github flow-typed / flow-typed / definitions / npm / expo-constants_v4.x.x / flow_v0.69.0-v0.103.x / test_expo-constants.js View on Github external
it('should raise an error when lead to an incompatible type', () => {
    // $ExpectError
    (Constants.deviceId: boolean);
    // $ExpectError
    (Constants.linkingUrl: boolean);
  });
});
github overthq / Auxilium / packages / app / src / api / Emergencies.ts View on Github external
const createEmergency = async (
	description: string,
	{ longitude, latitude }: EmergencyCoordinates
) => {
	try {
		const response = await fetch(`${env.apiUrl}emergencies/create`, {
			method: 'POST',
			headers: {
				Accept: 'application/json',
				'Content-Type': 'application/json'
			},
			body: JSON.stringify({
				deviceId: Constants.deviceId,
				description,
				coordinates: [longitude, latitude]
			})
		});
		await response.json();
	} catch (error) {
		console.log(error.message);
	}
};
github codepicks / CodePicks / App.js View on Github external
constructor(props) {
    super(props)

    this.state = {
      isLoadingComplete: false,
    }

    Analytics.init(Constants.deviceId)
  }
github codepicks / CodePicks / App.tsx View on Github external
constructor(props: Props) {
    super(props);

    this.state = {
      isLoadingComplete: false
    };

    Analytics.init(Constants.deviceId);
  }
github overthq / Auxilium / packages / app / src / api / Emergencies.ts View on Github external
const getUserHistory = async () => {
	try {
		const response = await fetch(
			`${env.apiUrl}emergencies/history?deviceId=${Constants.deviceId}`,
			{
				method: 'GET',
				headers: {
					Accept: 'application/json',
					'Content-Type': 'application/json'
				}
			}
		);
		const { emergencies }: { emergencies: Emergency[] } = await response.json();
		return emergencies;
	} catch (error) {
		return console.log(error.message);
	}
};
github ryanvanderpol / expo-analytics / analytics.js View on Github external
constructor(propertyId, additionalParameters = {}, options = defaultOptions){
        this.propertyId = propertyId;
        this.options = options;
        this.clientId = Constants.deviceId;

        this.promiseGetWebViewUserAgentAsync = getWebViewUserAgent(options)
            .then(userAgent => {
                this.userAgent = userAgent;

                this.parameters = { 
                    an: Constants.manifest.name, 
                    aid: Constants.manifest.slug, 
                    av: Constants.manifest.version,
                    sr: `${width}x${height}`,
                    ...additionalParameters
                };

                if(this.options.debug){
                    console.log(`[expo-analytics] UserAgent=${userAgent}`);
                    console.log(`[expo-analytics] Additional parameters=`, this.parameters);
github janaagaard75 / expo-and-typescript / src / constants / ConstantsScreen.tsx View on Github external
public render() {
    const navigate = this.props.navigation.navigate;

    return (