Authentication
Before exchanging data, it’s recommended to authenticate the connected mobile application. A Lens can request the SHA-256 digest of the app and verify it against a known trusted value.
// The "app://digest" request is handled internally,
// not forwarded to the mobile app.
// It retrieves the SHA-256 digest of the connected mobile application,
// allowing the Lens to verify whether the app is trusted.
try {
const response = await session.sendRequest('app://digest')
// Validate the received digest against the expected value.
print(`Digest: ${response}`)
} catch (error) {
print(`Error: ${error}`)
}
Was this page helpful?