Skip to content

Commit

Permalink
fix: deeplinking if wallet is open ios (#251)
Browse files Browse the repository at this point in the history
Signed-off-by: Timo Glastra <[email protected]>
  • Loading branch information
TimoGlastra authored Nov 27, 2024
1 parent 1d89b48 commit dd926c8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion apps/easypid/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,6 @@ The following standards and specifications were implemented.
## Known Bugs

- Entering incorrect PIN during presentation sharing will get stuck on the PIN loading screen (it does show correct PIN invalid toast).
- The navigation when re-opening the app is broken. And also deeplinking does not work when the app is already open. This is quite impactful as it means you have to force close the app sometimes.
- You have to force close the app when you use BLE for the first time after enabling location permission because the permission popup does not go away.

## Changelog
Expand All @@ -392,6 +391,7 @@ The following standards and specifications were implemented.

**Wallet**
- Fixed an issue with the app locking in the background [commit](https://github.com/animo/paradym-wallet/commit/6d5e2f176d32328e834b293c3389780fd9ca3d91)
- Fixed an issue where deeplinking didn't work on iOS if the wallet is already unlocked [commit](https://github.com/animo/paradym-wallet/commit/db12085d4c67e6688aa2f975d05783253eb06b5d)

### Phase 1

Expand Down
6 changes: 2 additions & 4 deletions apps/easypid/src/app/+native-intent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { parseInvitationUrl } from '@package/agent'
import { deeplinkSchemes } from '@package/app'
import * as Haptics from 'expo-haptics'
import { router } from 'expo-router'
import { Platform } from 'react-native'

export async function redirectSystemPath({ path, initial }: { path: string; initial: boolean }) {
const isRecognizedDeeplink = deeplinkSchemes.some((scheme) => path.startsWith(scheme))
Expand All @@ -13,7 +12,6 @@ export async function redirectSystemPath({ path, initial }: { path: string; init
try {
const parseResult = await parseInvitationUrl(path)
if (!parseResult.success) {
void Haptics.notificationAsync(Haptics.NotificationFeedbackType.Error)
return '/'
}

Expand All @@ -32,10 +30,10 @@ export async function redirectSystemPath({ path, initial }: { path: string; init
}

if (redirectPath) {
// NOTE: on android it somehow doesn't handle the intent if the app is already open
// NOTE: it somehow doesn't handle the intent if the app is already open
// so we replace the router to the path. I think it can break easily though if e.g.
// the wallet is locked in the background. Not sure how to proceed, this is best effort fix
if (Platform.OS === 'android' && !initial) {
if (!initial) {
router.replace(redirectPath)
return null
}
Expand Down

0 comments on commit dd926c8

Please sign in to comment.