Skip to content
This repository has been archived by the owner on Apr 1, 2023. It is now read-only.
/ udid-fetcher Public archive

An ExpressJS middleware for retrieving iOS device information

Notifications You must be signed in to change notification settings

S0n1cArchives/udid-fetcher

Repository files navigation

udid-fetcher

udid-fetcher is an ExpressJS middleware for retrieving iOS device information such as:

  • UDID
  • Model
  • iOS Version
  • etc.

Install

Add to your project:

$ yarn add udid-fetcher

Usage

import express from 'express';
import UDIDFetcher from 'udid-fetcher';

let app = express();
let port = process.env.PORT;

app.get('/', (req, res) => {
	return res.send('visit /enroll to fetch UDID.');
});

app.use(
	'/',
	new UDIDFetcher({
		name: 'Profile Name',
		description: 'Profile Description',
		identifier: 'com.example.udid_fetcher',
		organization: 'Developer Name',
		apiURL: `https://example.com/`,
		query: {
			id: 'foobar',
		},
		done: (req, res) => {
			console.log(req.query.id); // "foobar"
			console.log(req.device); // The recieved device is found in req.device.
			return res.redirect('/');
		},
	}).router,
);

app.listen(port, () => {
	console.log(`Live at port ${port}`);
});

Note: You are required to have a callback URL that is secure (https).

Build from source

$ git clone https://github.com/itss0n1c/udid-fetcher.git
$ cd udid-fetcher/
$ yarn run build

Testing

Make sure to have a .env file with the content below:

API_URL=https://example.com
PORT=5000

Then run:

$ yarn run dev

About

An ExpressJS middleware for retrieving iOS device information

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published