Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[KEPLR-354, Mobile] Add keplr mobile document about deep link #1157

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 24 additions & 19 deletions docs/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ module.exports = {
title: "Keplr wallet",
locales: {
"/": {
lang: "en-US",
},
lang: "en-US"
}
},
base: process.env.VUEPRESS_BASE || "/",
head: [
Expand All @@ -17,14 +17,14 @@ module.exports = {
{
property: "og:description",
content:
"Keplr is a non-custodial blockchain wallets for webpages that allow users to interact with blockchain applications.",
},
"Keplr is a non-custodial blockchain wallets for webpages that allow users to interact with blockchain applications."
}
],
[
"meta",
{ property: "og:image", content: "https://docs.keplr.app/og-image.png" },
{ property: "og:image", content: "https://docs.keplr.app/og-image.png" }
],
["meta", { name: "twitter:card", content: "summary_large_image" }],
["meta", { name: "twitter:card", content: "summary_large_image" }]
],
themeConfig: {
custom: true,
Expand All @@ -33,10 +33,10 @@ module.exports = {
docsRepo: "chainapsis/keplr-wallet",
docsDir: "docs",
logo: {
src: "/Keplr_Black.png",
src: "/Keplr_Black.png"
},
topbar: {
banner: false,
banner: false
},
sidebar: {
auto: false,
Expand All @@ -47,24 +47,29 @@ module.exports = {
{
title: "Keplr API",
directory: true,
path: "/api",
path: "/api"
},
],
},
],
},
{
title: "Keplr Mobile API",
directory: true,
path: "/mobile-api"
}
]
}
]
}
},
plugins: [
[
"sitemap",
{
hostname: "https://docs.keplr.app",
},
],
hostname: "https://docs.keplr.app"
}
]
],
markdown: {
extendMarkdown: (md) => {
extendMarkdown: md => {
md.use(require("markdown-it-container"), "suggest-chain-example-table");
},
},
}
}
};
3 changes: 3 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,6 @@ Keplr is a non-custodial blockchain wallets for webpages that allow users to int
[Use with secretjs](./api/secretjs.md) describes how to use secretjs with Keplr if you need to use secret-wasm feature.

[Suggest chain](./api/suggest-chain.md) describes how to suggest the chain to Keplr if the chain is not supported natively in Keplr.

[Use Deep Links](./mobile-api/deep-links.md) describes how to use deep links, which are requests from external sources, to navigate to a specific page in Keplr Mobile and execute particular actions.

76 changes: 76 additions & 0 deletions docs/mobile-api/deep-links.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
---
title: Use Deep Links
order: 1
---

# How to use Deep Link

::: danger
:point_up_2: This feature is available in **Keplr Mobile v2.0.47 or later**.
Please update to the latest version to use this feature.
:::

This page outlines how to use deep links, which are requests from external sources, to navigate to a specific page in Keplr Mobile and execute particular actions.

### DeepLink Scheme

- Android
```
intent://{Deep Link Path}?{Deep Link Parameter}#Intent;package=com.chainapsis.keplr;scheme=keplrwallet;end;
```

- iOS
```
keplrwallet://{Deep Link Path}?{Deep Link Parameter}
```

### Path of Deep Links supported(more coming)

- `web-browser`

Go to the Browser tab at the bottom of Keplr Mobile app and navigate to the URL you received from the external source.

| Parameter | Type | Description |
| --- | --- | --- |
| url | string | The URL you need to navigate to in the Keplr Mobile internal browser |

### Using Examples

Create a deep link by combining the Scheme and Path mentioned above.

- web page

```html
<html>
<body>
<!-- iOS should be "keplrwallet://web-browser?url=app.osmosis.zone" -->
<!-- Below is an example for Android. -->
<a href="intent://web-browser?url=app.osmosis.zone#Intent;package=com.chainapsis.keplr;scheme=keplrwallet;end;">
<h1>Go to Swap</h1>
</a>

</body>

</html>
```

- react native

```javascript
<Button
title={'Linking'}
onPress={() => {
// iOS should be "keplrwallet://web-browser?url=app.osmosis.zone"
// Below is an example for Android.
const url =
'intent://web-browser?url=app.osmosis.zone#Intent;package=com.chainapsis.keplr;scheme=keplrwallet;end;';
Linking.canOpenURL(url).then(supported => {
if (supported) {
Linking.openURL(url);
} else {
console.log("Don't know how to open URI: " + url);
}
});
}}
/>
```
Loading