Skip to content

Commit d3e8bd3

Browse files
authored
[APP-547] Universal links & deeplinking (#555)
* added ios scheme and intentFilters for deep linking * added intentFilters for android deep linking * add .env files to .gitignore * add autoVerify for android deep links
1 parent c8af784 commit d3e8bd3

File tree

4 files changed

+26
-4
lines changed

4 files changed

+26
-4
lines changed

.gitignore

+5-1
Original file line numberDiff line numberDiff line change
@@ -92,4 +92,8 @@ web-build/
9292

9393
# Android & iOS folders
9494
android/
95-
ios/
95+
ios/
96+
97+
# environment variables
98+
.env
99+
.env.*

app.json

+17-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"expo": {
33
"name": "Bluesky",
44
"slug": "bluesky",
5+
"scheme": "bluesky",
56
"owner": "blueskysocial",
67
"version": "1.27.0",
78
"orientation": "portrait",
@@ -31,7 +32,8 @@
3132
"NSMicrophoneUsageDescription": "Used for posts and other kinds of content.",
3233
"NSPhotoLibraryAddUsageDescription": "Used to save images to your library.",
3334
"NSPhotoLibraryUsageDescription": "Used for profile pictures, posts, and other kinds of content"
34-
}
35+
},
36+
"associatedDomains": ["applinks:bsky.app", "applinks:staging.bsky.app"]
3537
},
3638
"androidStatusBar": {
3739
"barStyle": "dark-content",
@@ -43,7 +45,20 @@
4345
"foregroundImage": "./assets/adaptive-icon.png",
4446
"backgroundColor": "#ffffff"
4547
},
46-
"package": "xyz.blueskyweb.app"
48+
"package": "xyz.blueskyweb.app",
49+
"intentFilters": [
50+
{
51+
"action": "VIEW",
52+
"autoVerify": true,
53+
"data": [
54+
{
55+
"scheme": "https",
56+
"host": "bsky.app"
57+
}
58+
],
59+
"category": ["BROWSABLE", "DEFAULT"]
60+
}
61+
]
4762
},
4863
"web": {
4964
"favicon": "./assets/favicon.png"

eas.json

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"developmentClient": true,
99
"distribution": "internal",
1010
"ios": {
11+
"simulator": true,
1112
"resourceClass": "medium"
1213
},
1314
"channel": "development",

src/Navigation.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,9 @@ function navigate<K extends keyof AllNavigatorParams>(
299299
function resetToTab(tabName: 'HomeTab' | 'SearchTab' | 'NotificationsTab') {
300300
if (navigationRef.isReady()) {
301301
navigate(tabName)
302-
navigationRef.dispatch(StackActions.popToTop())
302+
if (navigationRef.canGoBack()) {
303+
navigationRef.dispatch(StackActions.popToTop()) //we need to check .canGoBack() before calling it
304+
}
303305
}
304306
}
305307

0 commit comments

Comments
 (0)