Skip to content

Commit

Permalink
Merge pull request #191 from 0xPolygonID/univeral-links
Browse files Browse the repository at this point in the history
Minor Fixes to documentation
  • Loading branch information
0xpulkit authored Oct 23, 2024
2 parents b6ffc5b + d8858f5 commit 73bf8b9
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 9 deletions.
31 changes: 22 additions & 9 deletions docs/wallet/universal-links.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ The fragment of the URL (specs after `#`) should consist of a protocol message (

:::note
The `i_m` request must be Base64 encoded while `request_uri`, `back_url` and `finish_url` must be URI encoded before adding them to the fragment of the URL.
URI encoding the params will translate characters like ?, =, /, and & into their encoded equivalents so that they don’t interfere with the outer URL's query parameters.
URI encoding ensures that special characters such as ?, =, /, and & are converted to their percent-encoded equivalents, preventing conflicts with the URL's query parameters. URLs should always use percent-encoded rather than unicode escape sequences for special characters.
:::

Standard query string delimiters (=, &, )should be used for the params.
Expand Down Expand Up @@ -269,19 +269,32 @@ const finishUrl = encodeURIComponent("https://my-app.org/finish");
// Base64 encode the verification request
const base64EncodedRequest = btoa(JSON.stringify(request));

// URL encode the verification request with the parameters
const encodedRequestWithParams =(`i_m=${base64EncodedRequest}&back_url=${backUrl}&finish_url=${finishUrl}`);

// Open the Web Wallet URL with the encoded request
window.open(`https://wallet-dev.privado.id/#${encodedRequestWithParams}`);
// Configure the Wallet URL (universal link)
walletUrlWithMessage = `https://wallet.privado.id/#i_m=${base64EncodedRequest}&back_url=${backUrl}&finish_url=${finishUrl}`;

//Note:
// Open the Wallet URL to start the verification process
window.open(walletUrlWithMessage);


/*
Note
=================================================
// You can also use the `request_uri` parameter instead of `i_m`.
// For that, first define the URL containing the request, and URI encode it.
// You can also use the `request_uri` param instead of `i_m`, For that first define the Url containing the request.
const requestUrl = encodeURIComponent("https://raw.githubusercontent.com/0xpulkit/Examples_Privado-ID/main/KYCV3.json");
// Configure the Web Wallet URL
walletUrlWithRequestUri = `https://wallet-dev.privado.id/#request_uri=${requestUrl}&back_url=${backUrl}&finish_url=${finishUrl}`);
// Configure the Wallet URL (universal link) using `request_uri` instead of `i_m`
walletUrlWithRequestUri = `https://wallet.privado.id/#request_uri=${requestUrl}&back_url=${backUrl}&finish_url=${finishUrl}`);
// Open the Wallet URL with the `request_uri`
window.open(walletUrlWithRequestUri);
==================================================
*/

```


Expand Down
4 changes: 4 additions & 0 deletions docs/wallet/web-wallet.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ The Web Wallet can be seamlessly integrated into the credential issuance flow by

You can experience a demo of the Web Wallet integration [here](https://web-wallet-demo.privado.id/).

:::caution
The prior method of integrating the Web Wallet using `https://wallet.privado.id/#base64EncodedData` is now deprecated and will no longer be supported after Release 9.
:::




Expand Down

0 comments on commit 73bf8b9

Please sign in to comment.