Skip to content
This repository has been archived by the owner on Jan 30, 2024. It is now read-only.

Commit

Permalink
(KW-188) Support kolektivo:// native url scheme deep links (#72)
Browse files Browse the repository at this point in the history
* feat: open kolektivo native links instead of celo

* chore: replace celo:// with kolektivo://

Co-authored-by: Matthew Abraham <wasteofintel@gmail.com>
  • Loading branch information
shottah and shottah authored Oct 9, 2022
1 parent ff17794 commit db7938f
Show file tree
Hide file tree
Showing 22 changed files with 203 additions and 195 deletions.
16 changes: 13 additions & 3 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,36 @@
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<!-- Handle native url schemes from koleketivo://wallet/pay?{...} -->
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="celo" android:host="wallet" />
<data android:scheme="kolektivo" android:host="wallet" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="wc" />
</intent-filter>
<!-- Handle universal links from https://kolektivo.app/wallet/pay -->
<!-- This filter may not handle https://www.kolektivo.app/wallet/pay -->
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" android:host="valoraapp.com" />
<data android:scheme="https" android:host="kolektivo.app" />
<data android:pathPrefix="/wallet" />
<data android:path="/pay" />
</intent-filter>
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" android:host="kolektivo.app" />
<data android:pathPrefix="/wc" />
<data android:path="/plaid-oauth-redirect" />
<data android:scheme="http" />
</intent-filter>
</activity>

Expand Down
6 changes: 3 additions & 3 deletions docs/deeplinks.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ There are three different types of deeplinks that we support:

You can create a deeplink that will prompt the user to make a payment to an address.

The deeplink will look like this `celo://wallet/pay?{...queryParams}`
The deeplink will look like this `kolektivo://wallet/pay?{...queryParams}`
where the query parameters can be:
- `address` (required): The address that will be the recipient of the payment.
- `displayName` (optional): The URL-encoded name of the recipient. If you leave this empty the address will be shown instead.
Expand All @@ -23,11 +23,11 @@ To URL encode a text you can use the [encodeURI](https://developer.mozilla.org/e

Example payment deeplink:

`celo://wallet/pay?address=0x4b371df8d05abd2954564b54faf10b8c8f1bc3a2&displayName=Example%20name&amount=9.50&comment=Burger%20with%20fries&token=cUSD&currencyCode=USD`
`kolektivo://wallet/pay?address=0x4b371df8d05abd2954564b54faf10b8c8f1bc3a2&displayName=Example%20name&amount=9.50&comment=Burger%20with%20fries&token=cUSD&currencyCode=USD`

Smallest possible payment deeplink:

`celo://wallet/pay?address=0x4b371df8d05abd2954564b54faf10b8c8f1bc3a2`
`kolektivo://wallet/pay?address=0x4b371df8d05abd2954564b54faf10b8c8f1bc3a2`

## DAppKit

Expand Down
2 changes: 1 addition & 1 deletion e2e/src/usecases/HandleDeepLinkDappkit.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { enterPinUiIfNecessary, quote, sleep } from '../utils/utils'

export default HandleDeepLinkDappkit = () => {
const DAPPKIT_URL = quote(
'celo://wallet/dappkit?type=sign_tx&requestId=beneficiaryclaim&callback=impactmarket%3A%2F%2F&dappName=impactmarket&txs=W3sidHhEYXRhIjoiMHg0ZTcxZDkyZCIsImVzdGltYXRlZEdhcyI6MTIxMTI3LCJmcm9tIjoiMHhhY2FGQjRGMWQ5RERGMTQwNWViZEJGZWM5NTlBNzI4MTk0QjAyMzhhIiwidG8iOiIweDc0ZTVDNDA1RURFNEUzN2U3ODBEQjk2NTI1NDE1MzhkZDhBNzlBN2QiLCJub25jZSI6MjYsImZlZUN1cnJlbmN5QWRkcmVzcyI6IjB4NzY1REU4MTY4NDU4NjFlNzVBMjVmQ0ExMjJiYjY4OThCOEIxMjgyYSIsInZhbHVlIjoiMCJ9XQ%3D%3D'
'kolektivo://wallet/dappkit?type=sign_tx&requestId=beneficiaryclaim&callback=impactmarket%3A%2F%2F&dappName=impactmarket&txs=W3sidHhEYXRhIjoiMHg0ZTcxZDkyZCIsImVzdGltYXRlZEdhcyI6MTIxMTI3LCJmcm9tIjoiMHhhY2FGQjRGMWQ5RERGMTQwNWViZEJGZWM5NTlBNzI4MTk0QjAyMzhhIiwidG8iOiIweDc0ZTVDNDA1RURFNEUzN2U3ODBEQjk2NTI1NDE1MzhkZDhBNzlBN2QiLCJub25jZSI6MjYsImZlZUN1cnJlbmN5QWRkcmVzcyI6IjB4NzY1REU4MTY4NDU4NjFlNzVBMjVmQ0ExMjJiYjY4OThCOEIxMjgyYSIsInZhbHVlIjoiMCJ9XQ%3D%3D'
)

it('Launch app with dappkit deep link', async () => {
Expand Down
6 changes: 3 additions & 3 deletions e2e/src/usecases/HandleDeepLinkSend.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import { inputNumberKeypad, quote } from '../utils/utils'

const deepLinks = {
withAll:
'celo://wallet/pay?address=0xC0509a7dcc69a0B28c7Ca73feD2FF06b9d59E5b9&amount=0.1&currencyCode=USD&token=cUSD&displayName=TestFaucet&comment=sending+usd:+0.1+to+my+wallet',
'kolektivo://wallet/pay?address=0xC0509a7dcc69a0B28c7Ca73feD2FF06b9d59E5b9&amount=0.1&currencyCode=USD&token=cUSD&displayName=TestFaucet&comment=sending+usd:+0.1+to+my+wallet',
withoutAmount:
'celo://wallet/pay?address=0xC0509a7dcc69a0B28c7Ca73feD2FF06b9d59E5b9&currencyCode=USD&token=cUSD&displayName=TestFaucet&comment=sending+usd:+0.1+to+my+wallet',
'kolektivo://wallet/pay?address=0xC0509a7dcc69a0B28c7Ca73feD2FF06b9d59E5b9&currencyCode=USD&token=cUSD&displayName=TestFaucet&comment=sending+usd:+0.1+to+my+wallet',
withoutAddress:
'celo://wallet/pay?amount=0.1&currencyCode=USD&token=cUSD&displayName=TestFaucet&comment=sending+usd:+0.1+to+my+wallet',
'kolektivo://wallet/pay?amount=0.1&currencyCode=USD&token=cUSD&displayName=TestFaucet&comment=sending+usd:+0.1+to+my+wallet',
}

// Helper functions
Expand Down
Loading

0 comments on commit db7938f

Please sign in to comment.