Skip to content

Commit c2b2ed7

Browse files
committed
fix: modified universal link
1 parent 5e581e9 commit c2b2ed7

File tree

6 files changed

+48
-58
lines changed

6 files changed

+48
-58
lines changed
Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1 @@
1-
{
2-
"applinks": {
3-
"apps": [],
4-
"details": [
5-
{
6-
"appIDs": [
7-
"VHB67HRSZG.com.appflowy.appflowy.flutter"
8-
],
9-
"paths": [
10-
"*"
11-
],
12-
"components": [
13-
{
14-
"/": "/*"
15-
}
16-
]
17-
}
18-
]
19-
},
20-
"webcredentials": {
21-
"apps": [
22-
"VHB67HRSZG.com.appflowy.appflowy.flutter"
23-
]
24-
}
25-
}
1+
{"applinks":{"apps":[],"details":[{"appIDs":["VHB67HRSZG.com.appflowy.appflowy.flutter"],"paths":["/download","/download/*"],"components":[{"/":"/download","comment":"Matches any URL whose path starts with /download"},{"/":"/download/*","comment":"Matches any URL whose path starts with /download/"}]}]},"webcredentials":{"apps":["VHB67HRSZG.com.appflowy.appflowy.flutter"]}}

frontend/appflowy_web_app/public/.well-known/assetlinks.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
"package_name": "io.appflowy.appflowy",
99
"sha256_cert_fingerprints": [
1010
"19:13:85:33:DB:B3:A2:FD:65:2F:61:D7:F2:35:95:79:FE:6E:CC:B5:AC:94:AA:02:9E:BE:E7:0E:02:6B:45:FF"
11-
]
11+
],
12+
"path_prefix": "/download"
1213
}
1314
}
1415
]

frontend/appflowy_web_app/src/components/login/Login.tsx

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import React from 'react';
55
import { ReactComponent as Logo } from '@/assets/logo.svg';
66
import { useTranslation } from 'react-i18next';
77

8-
export function Login({ redirectTo }: { redirectTo: string }) {
8+
export function Login ({ redirectTo }: { redirectTo: string }) {
99
const { t } = useTranslation();
1010

1111
return (
@@ -27,11 +27,19 @@ export function Login({ redirectTo }: { redirectTo: string }) {
2727
}
2828
>
2929
<span>{t('web.signInAgreement')} </span>
30-
<a href={'https://appflowy.io/terms'} target={'_blank'} className={'text-fill-default underline'}>
30+
<a
31+
href={'https://appflowy.io/terms'}
32+
target={'_blank'}
33+
className={'text-fill-default underline'}
34+
>
3135
{t('web.termOfUse')}
3236
</a>{' '}
3337
{t('web.and')}{' '}
34-
<a href={'https://appflowy.io/privacy'} target={'_blank'} className={'text-fill-default underline'}>
38+
<a
39+
href={'https://appflowy.io/privacy'}
40+
target={'_blank'}
41+
className={'text-fill-default underline'}
42+
>
3543
{t('web.privacyPolicy')}
3644
</a>
3745
.

frontend/appflowy_web_app/src/components/main/App.tsx

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,35 +20,35 @@ const AppMain = withAppWrapper(() => {
2020
<Routes>
2121
<Route
2222
path={'/:namespace/:publishName'}
23-
element={<PublishPage/>}
23+
element={<PublishPage />}
2424
/>
2525
<Route
2626
path={'/login'}
27-
element={<Suspense><LoginPage/></Suspense>}
27+
element={<Suspense><LoginPage /></Suspense>}
2828
/>
2929
<Route
3030
path={AUTH_CALLBACK_PATH}
31-
element={<LoginAuth/>}
31+
element={<LoginAuth />}
3232
/>
3333
<Route
3434
path="/404"
35-
element={<NotFound/>}
35+
element={<NotFound />}
3636
/>
3737
<Route
3838
path="/after-payment"
39-
element={<Suspense><AfterPaymentPage/></Suspense>}
39+
element={<Suspense><AfterPaymentPage /></Suspense>}
4040
/>
4141
<Route
4242
path="/as-template"
43-
element={<Suspense><AsTemplatePage/></Suspense>}
43+
element={<Suspense><AsTemplatePage /></Suspense>}
4444
/>
4545
<Route
4646
path="/accept-invitation"
47-
element={<Suspense><AcceptInvitationPage/></Suspense>}
47+
element={<Suspense><AcceptInvitationPage /></Suspense>}
4848
/>
4949
<Route
5050
path={'/import'}
51-
element={<Suspense><ImportPage/></Suspense>}
51+
element={<Suspense><ImportPage /></Suspense>}
5252
/>
5353
<Route
5454
path="/"
@@ -61,28 +61,23 @@ const AppMain = withAppWrapper(() => {
6161
path="/app/*"
6262
element={
6363
<Suspense>
64-
<AppRouter/>
64+
<AppRouter />
6565
</Suspense>
6666
}
6767
/>
6868
<Route
6969
path="*"
70-
element={<NotFound/>}
70+
element={<NotFound />}
7171
/>
7272
</Routes>
7373
);
7474
});
7575

76-
function App() {
77-
const path = window.location.pathname;
78-
79-
if (path.startsWith('/.well-known')) {
80-
return null;
81-
}
76+
function App () {
8277

8378
return (
8479
<BrowserRouter>
85-
<AppMain/>
80+
<AppMain />
8681
</BrowserRouter>
8782
);
8883
}

frontend/appflowy_web_app/src/utils/open_schema.ts

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { androidDownloadLink, desktopDownloadLink, iosDownloadLink, openAppFlowySchema } from '@/utils/url';
1+
import { androidDownloadLink, desktopDownloadLink, openAppFlowySchema } from '@/utils/url';
22

33
type OS = 'ios' | 'android' | 'other';
44

@@ -101,20 +101,30 @@ export const openAppOrDownload = (config: AppConfig): void => {
101101
};
102102
};
103103

104-
export function openOnly(schema?: string) {
104+
export function openOnly (schema?: string) {
105105

106106
return openAppOrDownload({
107107
appScheme: schema || openAppFlowySchema,
108108
});
109109
}
110110

111-
export function openOrDownload(schema?: string) {
111+
export function openOrDownload (schema?: string) {
112112
const os = getOS();
113-
114-
const downloadUrl = os === 'ios' ? iosDownloadLink : os === 'android' ? androidDownloadLink : desktopDownloadLink;
113+
114+
if (os === 'ios' || os === 'android') {
115+
const universalLink = 'https://appflowy.io/download';
116+
const intentUrl = `intent://appflowy.io/download#Intent;` +
117+
'scheme=https;' +
118+
'package=io.appflowy.app;' +
119+
`S.browser_fallback_url=${encodeURIComponent(androidDownloadLink)};` +
120+
'end';
121+
122+
window.location.href = os === 'ios' ? universalLink : intentUrl;
123+
return;
124+
}
115125

116126
return openAppOrDownload({
117127
appScheme: schema || openAppFlowySchema,
118-
downloadUrl,
128+
downloadUrl: desktopDownloadLink,
119129
});
120130
}

frontend/resources/translations/en.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2960,16 +2960,16 @@
29602960
"emails": "Email"
29612961
},
29622962
"quickNote": {
2963-
"label": "Quick note",
2964-
"quickNotes": "Quick notes",
2965-
"search": "Search quick notes",
2963+
"label": "Quick Note",
2964+
"quickNotes": "Quick Notes",
2965+
"search": "Search Quick Notes",
29662966
"collapseFullView": "Collapse full view",
29672967
"expandFullView": "Expand full view",
2968-
"createFailed": "Failed to create quick note",
2969-
"quickNotesEmpty": "No quick notes",
2968+
"createFailed": "Failed to create Quick Note",
2969+
"quickNotesEmpty": "No Quick Notes",
29702970
"emptyNote": "Empty note",
29712971
"deleteNotePrompt": "The selected note will be deleted permanently. Are you sure you want to delete it?",
2972-
"addNote": "New note",
2972+
"addNote": "New Note",
29732973
"noAdditionalText": "No additional text"
29742974
},
29752975
"subscribe": {

0 commit comments

Comments
 (0)