Skip to content

Running the service

Rolling out phones

Enrolment links, finding ContactMesh from your company's domain, and setting phones up through Intune or Workspace ONE.

Three ways bring the ContactMesh app to your instance without anybody typing its address: a link, your company’s own domain, and your MDM. Each ends in the same enrolment code, so a phone still waits for approval wherever its group asks for it. Device groups, codes and approval are on Phones.

Everything here needs phones switched on (DEVICE_API_ENABLED=true). Behind a DMZ proxy, its allowlist passes /enrol/ and the three addresses under /.well-known/ named below; the one in deploy/nginx does.

Every code has a link, https://<instance>/enrol/<code>, shown beside its QR code when it is issued. Tapped on a phone, it opens a small page from ContactMesh itself:

  • at the top, Connect this phone, and under it a wide button, Open the ContactMesh app, which opens the app with the address and the code filled in;
  • under Or type it in the app, a box with the Address, your instance’s host name, and the Code in large letters;
  • under No app yet?, where to get the app on an iPhone and on Android.

The page is in German when the browser prefers German, and in English otherwise. It answers alike for any code and never checks one, so it says nothing about which codes exist: whether a code is right, expired or used up, the app says when it enrols. It runs no script, loads nothing from elsewhere and is never cached.

Opening the app without the page. A link opens the app straight away only where the phone knows the app belongs to that address. ContactMesh serves the two files phones check for this, /.well-known/apple-app-site-association and /.well-known/assetlinks.json, once .env names the app:

SettingWhat
DEVICE_APP_APPLE_TEAM_ID, DEVICE_APP_APPLE_BUNDLE_IDThe app publisher’s Apple team id and the app’s bundle id, together
DEVICE_APP_ANDROID_PACKAGE, DEVICE_APP_ANDROID_SHA256The app’s package and its signing certificate’s SHA-256 fingerprint, together

Without them both files answer 404, and the page’s button opens the app. An iPhone also needs your domain declared for the app, which an MDM does for a managed app; Android opens the app directly only for the domains its build names.

Somebody who knows their work e-mail address but not ContactMesh’s can be found by your company’s domain. The app looks for https://<your domain>/.well-known/contactmesh, and ContactMesh answers the same address on its own host:

{"instance":"https://contactmesh.example.ch","apiVersion":1}

That is all it says: the address and the version of the phones’ interface, and no organisation, product version or count. Publish it on your company’s website (example.ch) in one of two ways:

  • A redirect to ContactMesh’s own answer, which then always stays right. In nginx: location = /.well-known/contactmesh { return 302 https://contactmesh.example.ch/.well-known/contactmesh; }; in Apache: Redirect 302 /.well-known/contactmesh https://contactmesh.example.ch/.well-known/contactmesh.
  • A copy: save ContactMesh’s answer as the file /.well-known/contactmesh on the website, served as application/json. It only changes if ContactMesh moves.

Both over HTTPS, at the domain itself and not under a path.

On Phones, a device group’s … menu has Download configuration, which opens three choices: Intune (iOS), Intune (Android) and Workspace ONE. Each saves the group’s managed app configuration in the form that console takes: your instance’s address and the group’s MDM code. A phone the MDM gives it enrols the first time the app starts, with nobody typing, and the app sends the details the MDM fills in.

KeyWhatIntune (iOS)Intune (Android)Workspace ONE
instanceUrlYour instance’s addressIn the fileIn the fileIn the file
enrolmentCodeThe group’s MDM codeIn the fileIn the fileIn the file
deviceLabelThe phone’s name on Phones–Designer: Device name{DeviceFriendlyName}
serialNumberIts serial number{{serialnumber}}Designer: Serial number{DeviceSerialNumber}
assetTagYour inventory number––{DeviceAssetNumber}
assignedToWho has it{{username}}Designer: User name{EnrollmentUser}

The group’s first download issues its MDM code: up to 10,000 phones, valid for a year, waiting for approval as the group’s codes do. Every later download, for any of the three, carries the same code. The group’s page lists it among its codes with an MDM badge, and the licence’s phone limit applies to it as to any code.

Revoke stops new phones enrolling with it; the phones it enrolled stay. The next download then issues a new code, and the configuration has to be uploaded again. A code that has expired, run out or locked after wrong tries is replaced at the next download the same way.

The file holds a code that enrols phones: keep it as you would a password, and delete it once uploaded. Downloading needs enrolment-codes.issue and confirming it’s you, and every download is on the audit trail with the MDM it was for.

  1. In the Intune admin center, Apps › Configuration › Create › Managed devices.
  2. On Basics, a name, iOS/iPadOS as the platform, and ContactMesh as the Targeted app.
  3. On Settings, Configuration settings format › Enter XML data, and paste the downloaded file. The editor shows a <dict> with the four keys.
  4. On Assignments, the same groups ContactMesh itself is assigned to.
  1. Apps › Configuration › Create › Managed devices, Android Enterprise as the platform, and ContactMesh from Managed Google Play as the Targeted app.
  2. On Settings, Configuration settings format › Enter JSON data, and paste the downloaded file. It names the app’s package and the two keys.
  3. To send the phone’s name, serial number and who has it too, choose Use configuration designer instead: add ContactMesh address and Enrolment code with the file’s two values, then Device name, Serial number and Assigned to with Intune’s variables of the same meaning (User name for the last).
  1. Resources › Apps › Native, ContactMesh, Assign, and in the assignment Application Configuration.
  2. Switch Send Configuration on, and add one row for each row of the downloaded table: its Configuration Key, String as its Value Type, and its Configuration Value. On Android the keys are offered by their names, ContactMesh address, Enrolment code and so on.
  3. The values in braces are Workspace ONE’s lookup values, which it fills in for each phone.

Revoking a phone on Phones tells it to wipe. For a phone your MDM manages, its own selective wipe is the instant path; see Phones. A phone revoked or that left does not enrol itself again with the MDM’s code: the app fills the form and waits for a press.