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

feature(links, wallet-mobile): Deeplinks #3160

Merged
merged 14 commits into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from 9 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
4 changes: 2 additions & 2 deletions .github/actions/wallet-mobile/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ inputs:
node-version:
description: "Node.js version to use"
required: true
default: "16.19.0"
default: "18.19.1"
stackchain marked this conversation as resolved.
Show resolved Hide resolved

runs:
using: "composite"
Expand All @@ -18,7 +18,7 @@ runs:
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
shell: bash
- uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
Expand Down
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
nodejs 18.0.0
nodejs 18.19.1
rust 1.69.0
stackchain marked this conversation as resolved.
Show resolved Hide resolved
java adoptopenjdk-17.0.10+7
ruby 3.2.2
Expand Down
2 changes: 1 addition & 1 deletion apps/wallet-mobile/.tool-versions
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
nodejs 18.0.0
nodejs 18.19.1
rust 1.69.0
java adoptopenjdk-17.0.10+7
ruby 3.2.2
Expand Down
3 changes: 3 additions & 0 deletions apps/wallet-mobile/scripts/request-ada-with-link-android.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/zsh

adb shell am start -W -a android.intent.action.VIEW -d "yoroi://yoroi-wallet.com/w1/transfer/request/ada-with-link?link=web%252Bcardano%253Aaddr_test1qzp3w455j8hdusjyv38rkr3cas9hyydfkr3tpwsz2yt8mqxr3y3kdut55a40jff00qmg74686vz44v6k363md06qkq0qgvjva0%253Famount%253D10\&isSandbox=true\&isTestnet=false\&appId=yoroi\&message=hi+there\&walletId=c4832ba5-c03e-4bd8-93ee-52536f1b1747\&authorization=ac0692d3-bf34-44e2-b57d-53e4ce47666b\&signature=4B7C8DB8B485D176D426980EE8A0D8A600B305AE2D7DC835B537657E2DAE110A6F7C0A641EAA623A8C43568BFC9DDCED5CBEA5AD6768BDE89F084EEDDBEBA36A\&redirectTo=https%253A%252F%252Fyoroi-wallet.com"
4 changes: 4 additions & 0 deletions apps/wallet-mobile/scripts/request-ada-with-link-ios.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/zsh

xcrun simctl openurl booted "yoroi://yoroi-wallet.com/w1/transfer/request/ada-with-link?link=web%252Bcardano%253Aaddr_test1qzp3w455j8hdusjyv38rkr3cas9hyydfkr3tpwsz2yt8mqxr3y3kdut55a40jff00qmg74686vz44v6k363md06qkq0qgvjva0%253Famount%253D10&isSandbox=true&isTestnet=false&appId=yoroi&message=hi+there&walletId=c4832ba5-c03e-4bd8-93ee-52536f1b1747&authorization=ac0692d3-bf34-44e2-b57d-53e4ce47666b&signature=4B7C8DB8B485D176D426980EE8A0D8A600B305AE2D7DC835B537657E2DAE110A6F7C0A641EAA623A8C43568BFC9DDCED5CBEA5AD6768BDE89F084EEDDBEBA36A&redirectTo=https%253A%252F%252Fyoroi-wallet.com"

5 changes: 4 additions & 1 deletion apps/wallet-mobile/src/AppNavigator.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {NavigationContainer, NavigationContainerRef} from '@react-navigation/native'
import {createStackNavigator} from '@react-navigation/stack'
import {isString} from '@yoroi/common'
import {TransferProvider} from '@yoroi/transfer'
import * as React from 'react'
import {defineMessages, useIntl} from 'react-intl'
import {Alert, AppState, AppStateStatus, InteractionManager, Platform} from 'react-native'
Expand Down Expand Up @@ -136,7 +137,9 @@ export const AppNavigator = () => {
<Stack.Screen name="app-root">
{() => (
<SearchProvider>
<WalletNavigator />
<TransferProvider>
stackchain marked this conversation as resolved.
Show resolved Hide resolved
<WalletNavigator />
</TransferProvider>
</SearchProvider>
)}
</Stack.Screen>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {useStatusBar} from '../../components/hooks/useStatusBar'
import {Icon} from '../../components/Icon'
import {PleaseWaitModal} from '../../components/PleaseWaitModal'
import {showErrorDialog} from '../../dialogs'
import {useLinksRequestWallet} from '../../features/Links/common/useLinksRequestWallet'
import globalMessages, {errorMessages} from '../../i18n/global-messages'
import {isNightly} from '../../legacy/config'
import {useMetrics} from '../../metrics/metricsManager'
Expand All @@ -27,6 +28,7 @@ import {useSetSelectedWallet, useSetSelectedWalletMeta} from '../Context'
import {WalletListItem} from './WalletListItem'

export const WalletSelectionScreen = () => {
useLinksRequestWallet()
const strings = useStrings()
const {navigateToTxHistory} = useWalletNavigation()
const walletManager = useWalletManager()
Expand All @@ -48,14 +50,7 @@ export const WalletSelectionScreen = () => {
onSuccess: ([wallet, walletMeta]) => {
selectWalletMeta(walletMeta)
selectWallet(wallet)

// fixes modal issue
stackchain marked this conversation as resolved.
Show resolved Hide resolved
// https://github.com/facebook/react-native/issues/32329
// https://github.com/facebook/react-native/issues/33733
// https://github.com/facebook/react-native/issues/29319
InteractionManager.runAfterInteractions(() => {
navigateToTxHistory()
})
navigateToTxHistory()
},
onError: (error) => {
InteractionManager.runAfterInteractions(() => {
Expand Down
Loading
Loading