Skip to content

Commit 261f659

Browse files
authored
Merge pull request #45 from ansari-project/app-update-bug-fix
Update App Store linking protocol, restrict update popup to app mode
2 parents 0c77309 + b10f960 commit 261f659

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/app/_layout.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ const RootLayout = () => {
9393
let appVersion = '1.0.0'
9494
let buildVersion = '1'
9595

96-
if (Platform.OS === 'ios' || Platform.OS === 'android') {
96+
const appMode = Platform.OS === 'ios' || Platform.OS === 'android'
97+
if (appMode) {
9798
appVersion = Application.nativeApplicationVersion!
9899
buildVersion = Application.nativeBuildVersion!
99100
}
@@ -106,7 +107,7 @@ const RootLayout = () => {
106107

107108
setAppVersionStatus(appVersionCheckResults)
108109
setAppUpdatePopupVisible(
109-
appVersionCheckResults.force_update_required || appVersionCheckResults.update_available,
110+
appMode && (appVersionCheckResults.force_update_required || appVersionCheckResults.update_available),
110111
)
111112
} catch (error) {
112113
console.error('Failed to check app version:', error)

src/components/AppUpdatePopup.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const AppUpdatePopup: React.FC<AppUpdatePopupProps> = ({ isForced, visible, onDi
3030

3131
const openAppStore = useCallback(async (appId: string) => {
3232
try {
33-
await Linking.openURL(`itms://itunes.apple.com/app/id${appId}`)
33+
await Linking.openURL(`itms-apps://itunes.apple.com/app/id${appId}`)
3434
} catch (error) {
3535
console.error('Error opening App Store:', error)
3636
await Linking.openURL(`https://apps.apple.com/app/id${appId}`)

0 commit comments

Comments
 (0)