Skip to content

Commit 358da2a

Browse files
authored
Feature/notifications (#87)
* Notifications in place on Native only, changed styling + metro config * Notifications in place on Native only, changed styling + metro config * firebase module change * firebase multi env tslint rollback
1 parent c3537f0 commit 358da2a

File tree

15 files changed

+2962
-3622
lines changed

15 files changed

+2962
-3622
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ yarn-error.*
3636
*.tsbuildinfo
3737

3838
# environmental
39-
/google-services.json
39+
4040
/serviceaccount-key.json
4141
/simple-fast.keystore
4242
/@thomaslennon__simplefast.jks

App.tsx

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import React from 'react';
1+
import * as Notifications from 'expo-notifications';
2+
import React, { useEffect, useRef } from 'react';
23

34
import { AppProvider } from './src/context/AppContext';
45
import { AuthProvider } from './src/context/AuthContext';
@@ -11,6 +12,30 @@ if (typeof window !== 'undefined') {
1112
}
1213

1314
export default function App() {
15+
const notificationListener = useRef<{ remove: () => void } | null>(null);
16+
const responseListener = useRef<{ remove: () => void } | null>(null);
17+
18+
useEffect(() => {
19+
// Set up notification listeners
20+
notificationListener.current = Notifications.addNotificationReceivedListener(notification => {
21+
console.log('Notification received:', notification);
22+
});
23+
24+
responseListener.current = Notifications.addNotificationResponseReceivedListener(response => {
25+
console.log('Notification response:', response);
26+
// Handle notification taps here
27+
});
28+
29+
return () => {
30+
if (notificationListener.current) {
31+
notificationListener.current.remove();
32+
}
33+
if (responseListener.current) {
34+
responseListener.current.remove();
35+
}
36+
};
37+
}, []);
38+
1439
return (
1540
<AppProvider>
1641
<AuthProvider>

app.json

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"expo": {
33
"name": "SimpleFastApp",
44
"slug": "simplefast",
5-
"version": "0.0.7",
5+
"version": "0.0.8",
66
"orientation": "portrait",
77
"icon": "./assets/icon.png",
88
"userInterfaceStyle": "light",
@@ -16,11 +16,12 @@
1616
"supportsTablet": true
1717
},
1818
"android": {
19-
"package": "com.simplefast.app",
19+
"package": "com.tl.simplefast",
2020
"adaptiveIcon": {
2121
"foregroundImage": "./assets/adaptive-icon.png",
2222
"backgroundColor": "#ffffff"
23-
}
23+
},
24+
"googleServicesFile": "./google-services.json"
2425
},
2526
"web": {
2627
"favicon": "./assets/favicon.png"
@@ -31,9 +32,12 @@
3132
}
3233
},
3334
"owner": "thomaslennon",
34-
"runtimeVersion": "0.0.6",
35+
"runtimeVersion": "0.0.7",
3536
"updates": {
3637
"url": "https://u.expo.dev/cc4fda45-3e1f-4ec3-a23a-f57bbfc1be34"
37-
}
38+
},
39+
"plugins": [
40+
"@react-native-firebase/app"
41+
]
3842
}
3943
}

google-services.json

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
{
2+
"project_info": {
3+
"project_number": "32426588093",
4+
"project_id": "simplefast-4428e",
5+
"storage_bucket": "simplefast-4428e.firebasestorage.app"
6+
},
7+
"client": [
8+
{
9+
"client_info": {
10+
"mobilesdk_app_id": "1:32426588093:android:b0247be93fc315fb1a44d4",
11+
"android_client_info": {
12+
"package_name": "com.tl.simplefast"
13+
}
14+
},
15+
"oauth_client": [
16+
{
17+
"client_id": "32426588093-c6m0gj9k36u08bmf162d5jk6khn2khqh.apps.googleusercontent.com",
18+
"client_type": 1,
19+
"android_info": {
20+
"package_name": "com.tl.simplefast",
21+
"certificate_hash": "5e8f16062ea3cd2c4a0d547876baa6f38cabf625"
22+
}
23+
},
24+
{
25+
"client_id": "32426588093-slf2cpstk3m5nulgg8o6bm159u8stado.apps.googleusercontent.com",
26+
"client_type": 1,
27+
"android_info": {
28+
"package_name": "com.tl.simplefast",
29+
"certificate_hash": "981330a6bc2b41bb0cac33469f86b30e85e2b6b2"
30+
}
31+
},
32+
{
33+
"client_id": "32426588093-c2nq8erqrmou1gts2esmm3hgdde8hh11.apps.googleusercontent.com",
34+
"client_type": 3
35+
}
36+
],
37+
"api_key": [
38+
{
39+
"current_key": "AIzaSyAxOU8P32DUrSHgxrF-IaUTAZ5SSAEYYyw"
40+
}
41+
],
42+
"services": {
43+
"appinvite_service": {
44+
"other_platform_oauth_client": [
45+
{
46+
"client_id": "32426588093-c2nq8erqrmou1gts2esmm3hgdde8hh11.apps.googleusercontent.com",
47+
"client_type": 3
48+
}
49+
]
50+
}
51+
}
52+
}
53+
],
54+
"configuration_version": "1"
55+
}

metro.config.cjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@ config.transformer.assetPlugins = ['expo-asset/tools/hashAssetFiles'];
77
config.transformer.babelTransformerPath = require.resolve('react-native-svg-transformer');
88
config.resolver.assetExts = config.resolver.assetExts.filter(ext => ext !== 'svg');
99
config.resolver.sourceExts.push('svg');
10+
config.resolver.unstable_enablePackageExports = false;
1011

1112
module.exports = config;

0 commit comments

Comments
 (0)