Skip to content

Commit c27d7fa

Browse files
authored
chore: Remove notifications + remove ios folder + other small cleanup (#1596)
1 parent d7e54c2 commit c27d7fa

File tree

156 files changed

+269
-6551
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

156 files changed

+269
-6551
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ ios/Converse.xcworkspace/xcshareddata/swiftpm/Package.resolved
3636
# Android
3737
/android/
3838

39+
# iOS
40+
/ios/
41+
3942
# System files
4043
.DS_Store
4144
*.log

.nvmrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v20.18.0
1+
v20.18.0

.ruby-version

-1
This file was deleted.

App.tsx

+3-4
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,15 @@ import {
4747
useAccountsStore,
4848
} from "./data/store/accountsStore";
4949
import { setAuthStatus } from "./data/store/authStore";
50-
import "./features/notifications/utils";
5150
import Main from "./screens/Main";
5251
import { registerBackgroundFetchTask } from "./utils/background";
5352
import { privySecureStorage } from "./utils/keychain/helpers";
5453
import { initSentry } from "./utils/sentry";
5554
import { saveApiURI } from "./utils/sharedData";
56-
import "./utils/splash/splash";
55+
import { preventSplashScreenAutoHide } from "./utils/splash/splash";
5756
import { setupStreamingSubscriptions } from "@/features/streams/streams";
58-
import { setupTopicNotificationsSubscriptions } from "@/features/notifications/utils/accountTopicSubscription";
57+
58+
preventSplashScreenAutoHide();
5959

6060
LogBox.ignoreLogs([
6161
"Privy: Expected status code 200, received 400", // Privy
@@ -105,7 +105,6 @@ const App = () => {
105105
useEffect(() => {
106106
setupAppAttest();
107107
setupStreamingSubscriptions();
108-
setupTopicNotificationsSubscriptions();
109108
}, []);
110109

111110
useCoinbaseWalletListener(true, coinbaseUrl);

app.config.ts

+65-37
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ type EnvironmentConfig = {
1010
appDomainGetConverse: string;
1111
appName: string;
1212
icon: string;
13-
googleServicesFile: string;
1413
ios: {
1514
bundleIdentifier: string;
15+
associatedDomains: string[];
16+
googleServicesFile: string;
1617
};
1718
android: {
1819
package: string;
@@ -25,52 +26,64 @@ const settings: Record<Environment, EnvironmentConfig> = {
2526
scheme: "converse-dev",
2627
ios: {
2728
bundleIdentifier: "com.converse.dev",
29+
associatedDomains: [
30+
"applinks:dev.converse.xyz",
31+
"applinks:dev.getconverse.app",
32+
"webcredentials:dev.converse.xyz",
33+
],
34+
googleServicesFile: "./google-services/ios/development.plist",
2835
},
2936
android: {
3037
package: "com.converse.dev",
31-
googleServicesFile: "./scripts/build/android/google-services/dev.json",
38+
googleServicesFile: "./google-services/android/development.json",
3239
},
3340
androidPackage: "com.converse.dev",
3441
appDomainConverse: "dev.converse.xyz",
3542
appDomainGetConverse: "dev.getconverse.app",
3643
appName: "Converse DEV",
3744
icon: "./assets/icon-preview.png",
38-
googleServicesFile: "./scripts/build/android/google-services/dev.json",
3945
},
4046
preview: {
4147
scheme: "converse-preview",
4248
ios: {
4349
bundleIdentifier: "com.converse.preview",
50+
associatedDomains: [
51+
"applinks:preview.converse.xyz",
52+
"applinks:preview.getconverse.app",
53+
"webcredentials:preview.converse.xyz",
54+
],
55+
googleServicesFile: "./google-services/ios/preview.plist",
4456
},
4557
android: {
4658
package: "com.converse.preview",
47-
googleServicesFile:
48-
"./scripts/build/android/google-services/preview.json",
59+
googleServicesFile: "./google-services/android/preview.json",
4960
},
5061
androidPackage: "com.converse.preview",
5162
appDomainConverse: "preview.converse.xyz",
5263
appDomainGetConverse: "preview.getconverse.app",
5364
appName: "Converse PREVIEW",
5465
icon: "./assets/icon-preview.png",
55-
googleServicesFile: "./scripts/build/android/google-services/preview.json",
5666
},
5767
production: {
5868
scheme: "converse",
5969
ios: {
6070
bundleIdentifier: "com.converse.native",
71+
associatedDomains: [
72+
"applinks:converse.xyz",
73+
"applinks:getconverse.app",
74+
"webcredentials:converse.xyz",
75+
],
76+
googleServicesFile: "./google-services/ios/production.plist",
6177
},
6278
android: {
6379
package: "com.converse.prod",
64-
googleServicesFile:
65-
"./scripts/build/android/google-services/production.json",
80+
googleServicesFile: "./google-services/android/production.json",
6681
},
6782
androidPackage: "com.converse.prod",
6883
appDomainConverse: "converse.xyz",
6984
appDomainGetConverse: "getconverse.app",
7085
appName: "Converse",
7186
icon: "./assets/icon.png",
72-
googleServicesFile:
73-
"./scripts/build/android/google-services/production.json",
7487
},
7588
};
7689

@@ -89,42 +102,42 @@ export default (): ExpoConfig => {
89102
userInterfaceStyle: "automatic",
90103
version: version,
91104
assetBundlePatterns: ["**/*"],
105+
runtimeVersion: version,
92106
updates: {
93107
fallbackToCacheTimeout: 0,
94108
url: "https://u.expo.dev/49a65fae-3895-4487-8e8a-5bd8bee3a401",
95109
},
96-
runtimeVersion: version,
110+
extra: {
111+
expoEnv,
112+
eas: {
113+
projectId: "49a65fae-3895-4487-8e8a-5bd8bee3a401",
114+
},
115+
},
97116
ios: {
98-
// bundleIdentifier: config.ios.bundleIdentifier, // Not needed since we have ios folder already specifying it
117+
bundleIdentifier: config.ios.bundleIdentifier,
99118
supportsTablet: true,
100119
config: {
101120
usesNonExemptEncryption: false,
102121
},
103-
},
104-
extra: {
105-
expoEnv,
106-
eas: {
107-
projectId: "49a65fae-3895-4487-8e8a-5bd8bee3a401",
122+
associatedDomains: config.ios.associatedDomains,
123+
googleServicesFile: config.ios.googleServicesFile,
124+
infoPlist: {
125+
LSApplicationQueriesSchemes: [
126+
"cbwallet",
127+
"ledgerlive",
128+
"rainbow",
129+
"metamask",
130+
"trust",
131+
"uniswap",
132+
"zerion",
133+
"exodus",
134+
"oneinch",
135+
],
108136
},
109137
},
110138
android: {
111139
package: config.android.package,
112140
googleServicesFile: config.android.googleServicesFile,
113-
permissions: [
114-
"INTERNET",
115-
"READ_EXTERNAL_STORAGE",
116-
"SYSTEM_ALERT_WINDOW",
117-
"VIBRATE",
118-
"POST_NOTIFICATIONS",
119-
"READ_CONTACTS",
120-
"RECEIVE_BOOT_COMPLETED",
121-
"WRITE_EXTERNAL_STORAGE",
122-
"WAKE_LOCK",
123-
"USE_FINGERPRINT",
124-
"USE_BIOMETRIC",
125-
"READ_MEDIA_IMAGES",
126-
"READ_MEDIA_VIDEO",
127-
],
128141
intentFilters: [
129142
{
130143
action: "VIEW",
@@ -191,9 +204,19 @@ export default (): ExpoConfig => {
191204
],
192205
},
193206
plugins: [
207+
["expo-notifications"],
208+
["expo-local-authentication"],
194209
[
195210
"expo-build-properties",
196211
{
212+
ios: {
213+
// To fix error "The Swift pod `FirebaseCoreInternal` depends upon `GoogleUtilities`,
214+
// which does not define modules. To opt into those targets generating module maps
215+
// (which is necessary to import them from Swift when building as static libraries),
216+
// you may set `use_modular_headers!` globally in your Podfile,
217+
// or specify `:modular_headers => true` for particular dependencies"
218+
useFrameworks: "static",
219+
},
197220
android: {
198221
compileSdkVersion: 35,
199222
targetSdkVersion: 34,
@@ -273,6 +296,15 @@ export default (): ExpoConfig => {
273296
},
274297
},
275298
],
299+
[
300+
"expo-image-picker",
301+
{
302+
photosPermission:
303+
"We need this so that you can share photos from your library.",
304+
cameraPermission:
305+
"We need this so that you can take photos to share.",
306+
},
307+
],
276308
"expo-secure-store",
277309
[
278310
"expo-splash-screen",
@@ -283,10 +315,8 @@ export default (): ExpoConfig => {
283315
image: "./assets/splash-dark.png",
284316
backgroundColor: "#000000",
285317
},
286-
imageWidth: 300,
287318
},
288319
],
289-
"expo-secure-store",
290320
[
291321
"@sentry/react-native/expo",
292322
{
@@ -295,10 +325,8 @@ export default (): ExpoConfig => {
295325
url: "https://sentry.io/",
296326
},
297327
],
328+
["@react-native-firebase/app"],
298329
["@react-native-firebase/app-check"],
299-
"./scripts/build/android/notifeeExpoPlugin.js", // See https://github.com/invertase/notifee/issues/350
300-
"./scripts/build/android/androidDependenciesExpoPlugin.js", // Handle some conflicting dependencies manually
301-
"./scripts/build/android/buildGradleProperties.js", // Increase memory for building android in EAS
302330
],
303331
};
304332
};

components/AccountSettingsButton.tsx

+1-29
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import {
88
textSecondaryColor,
99
} from "@styles/colors";
1010
import { PictoSizes } from "@styles/sizes";
11-
import * as Linking from "expo-linking";
1211
import React, { useCallback } from "react";
1312
import {
1413
Keyboard,
@@ -21,8 +20,6 @@ import { invalidateProfileSocialsQuery } from "@/queries/useProfileSocialsQuery"
2120
import { useAccountsStore } from "../data/store/accountsStore";
2221
import { useAppStore } from "../data/store/appStore";
2322
import { useSelect } from "../data/store/storeHelpers";
24-
import { NotificationPermissionStatus } from "../features/notifications/types/Notifications.types";
25-
import { requestPushNotificationsPermissions } from "../features/notifications/utils/requestPushNotificationsPermissions";
2623
import { useRouter } from "../navigation/useNavigation";
2724
import { navigate } from "../utils/navigation";
2825
import Picto from "./Picto/Picto";
@@ -72,31 +69,7 @@ export default function AccountSettingsButton({ account }: Props) {
7269
Clipboard.setString(account || "");
7370
},
7471
[translate("turn_on_notifications")]: () => {
75-
// @todo => move that to a helper because also used in Profile
76-
if (notificationsPermissionStatus === "denied") {
77-
if (Platform.OS === "android") {
78-
// Android 13 is always denied first so let's try to show
79-
requestPushNotificationsPermissions().then(
80-
(newStatus: NotificationPermissionStatus | undefined) => {
81-
if (newStatus === "denied") {
82-
Linking.openSettings();
83-
} else if (newStatus) {
84-
setNotificationsPermissionStatus(newStatus);
85-
}
86-
}
87-
);
88-
} else {
89-
Linking.openSettings();
90-
}
91-
} else if (notificationsPermissionStatus === "undetermined") {
92-
// Open popup
93-
requestPushNotificationsPermissions().then(
94-
(newStatus: NotificationPermissionStatus | undefined) => {
95-
if (!newStatus) return;
96-
setNotificationsPermissionStatus(newStatus);
97-
}
98-
);
99-
}
72+
// TODO
10073
},
10174
[translate("disconnect_this_account")]: () =>
10275
showDisconnectActionSheet(colorScheme),
@@ -148,7 +121,6 @@ export default function AccountSettingsButton({ account }: Props) {
148121
notificationsPermissionStatus,
149122
colorScheme,
150123
setCurrentAccount,
151-
setNotificationsPermissionStatus,
152124
showDisconnectActionSheet,
153125
]);
154126

components/StateHandlers/HydrationStateHandler.tsx

+1-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { subscribeToNotifications } from "@/features/notifications/utils/subscribeToNotifications";
21
import { prefetchConversationMetadataQuery } from "@/queries/conversation-metadata-query";
32
import { fetchAllowedConsentConversationsQuery } from "@/queries/conversations-allowed-consent-query";
43
import { ensureInboxId } from "@/queries/inbox-id-query";
@@ -35,9 +34,7 @@ export default function HydrationStateHandler() {
3534
})
3635
);
3736
} catch (error) {
38-
logger.debug(
39-
`[Hydration] Error during inboxId initialization: ${error.message}`
40-
);
37+
captureError(error);
4138
}
4239

4340
// Non critical queries
@@ -53,10 +50,6 @@ export default function HydrationStateHandler() {
5350
conversation.topic
5451
).catch(captureError);
5552
}
56-
subscribeToNotifications({
57-
conversations,
58-
account,
59-
});
6053
})
6154
.catch(captureError);
6255
}

config/config.types.ts

-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ export type IConfig = {
4444
xmtpEnv: IXmtpEnv;
4545
apiURI: string;
4646
bundleId: string;
47-
appleAppGroup: string;
4847
scheme: string;
4948
websiteDomain: string;
5049
usernameSuffix: string;

config/dev.ts config/development.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@ import { IConfig } from "@/config/config.types";
22
import { Platform } from "react-native";
33
import { shared } from "./shared";
44

5-
export const devConfig: IConfig = {
5+
export const developmentConfig: IConfig = {
66
...shared,
77
debugMenu: true,
88
bundleId: "com.converse.dev",
9-
appleAppGroup: "group.com.converse.dev",
109
scheme: "converse-dev",
1110
websiteDomain: "dev.converse.xyz",
1211
usernameSuffix: ".conversedev.eth",

config/index.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import { isDev, isPreview } from "@/utils/getEnv";
2-
import { devConfig } from "./dev";
3-
import { prodConfig } from "./prod";
2+
import { developmentConfig } from "./development";
3+
import { productionConfig } from "./production";
44
import { previewConfig } from "./preview";
55

66
export const getConfig = () => {
7-
if (isDev) return devConfig;
7+
if (isDev) return developmentConfig;
88
if (isPreview) return previewConfig;
9-
return prodConfig;
9+
return productionConfig;
1010
};
1111

1212
export const config = getConfig();

config/preview.ts

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ export const previewConfig: IConfig = {
55
...shared,
66
debugMenu: true,
77
bundleId: "com.converse.preview",
8-
appleAppGroup: "group.com.converse.preview",
98
scheme: "converse-preview",
109
websiteDomain: "preview.converse.xyz",
1110
usernameSuffix: ".conversedev.eth",

config/prod.ts config/production.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@ import { IConfig } from "@/config/config.types";
22
import { Platform } from "react-native";
33
import { shared } from "./shared";
44

5-
export const prodConfig: IConfig = {
5+
export const productionConfig: IConfig = {
66
...shared,
77
bundleId:
88
Platform.OS === "android" ? "com.converse.prod" : "com.converse.native",
9-
appleAppGroup: "group.com.converse.native",
109
scheme: "converse",
1110
websiteDomain: "converse.xyz",
1211
usernameSuffix: ".converse.xyz",

0 commit comments

Comments
 (0)