diff --git a/components/pages/settings/CalendarSettingsPage.tsx b/components/pages/settings/CalendarSettingsPage.tsx
index 9cdf553..62a7fa2 100644
--- a/components/pages/settings/CalendarSettingsPage.tsx
+++ b/components/pages/settings/CalendarSettingsPage.tsx
@@ -6,6 +6,7 @@ import { colorMap } from "@/contexts/SettingsContext";
import { TouchableOpacity } from "react-native-gesture-handler";
import { fetchGoogleCalendarEvents } from "@/calendar-integration/google-calendar-utils";
import { useCreateEvent } from "@/hooks/firebase/useCreateEvent";
+import { GoogleSignin } from "@react-native-google-signin/google-signin";
const CalendarSettingsPage = (props: {
setSelectedPage: (page: number) => void;
@@ -28,6 +29,14 @@ const CalendarSettingsPage = (props: {
await createEvent(item);
}
+ // Note: Right key
+ GoogleSignin.configure({
+ webClientId:
+ "406146460310-81gld1b58ujsoe6a2t3ht0haprv5pa69.apps.googleusercontent.com",
+ scopes: ["profile", "email", "calendar"],
+ offlineAccess: true,
+ });
+
return (
props.setSelectedPage(0)}>
@@ -110,6 +119,32 @@ const CalendarSettingsPage = (props: {
+
+ Add Calendar
+
+
+
Calendars
{/** Note: Should check for the user if it has connected calendars **/}
@@ -141,6 +176,17 @@ const CalendarSettingsPage = (props: {
);
};
+const signInGoogle = async () => {
+ try {
+ await GoogleSignin.hasPlayServices();
+ let userInfo = await GoogleSignin.signIn();
+ console.log(userInfo);
+ } catch (error) {
+ console.log(error);
+ console.log(error.code);
+ }
+};
+
const styles = StyleSheet.create({
backBtn: {
backgroundColor: "red",
diff --git a/package-lock.json b/package-lock.json
index 002f13f..b8b9d48 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -16,6 +16,7 @@
"@react-native-firebase/crashlytics": "^20.3.0",
"@react-native-firebase/firestore": "^20.4.0",
"@react-native-firebase/functions": "^20.4.0",
+ "@react-native-google-signin/google-signin": "^13.1.0",
"@react-navigation/drawer": "^6.7.2",
"@react-navigation/native": "^6.0.2",
"date-fns": "^3.6.0",
@@ -7233,6 +7234,25 @@
"@react-native-firebase/app": "20.4.0"
}
},
+ "node_modules/@react-native-google-signin/google-signin": {
+ "version": "13.1.0",
+ "resolved": "https://registry.npmjs.org/@react-native-google-signin/google-signin/-/google-signin-13.1.0.tgz",
+ "integrity": "sha512-C2/sqb0/s0c+Dwc/mykASZsRuHxGqn7SFrCxCY9D8p8IOQO05haInhCc7lzraJshRixGva5c/4usQZ71HMYSEQ==",
+ "peerDependencies": {
+ "expo": ">=50.0.0",
+ "react": "*",
+ "react-dom": "*",
+ "react-native": "*"
+ },
+ "peerDependenciesMeta": {
+ "expo": {
+ "optional": true
+ },
+ "react-dom": {
+ "optional": true
+ }
+ }
+ },
"node_modules/@react-native/assets-registry": {
"version": "0.74.85",
"resolved": "https://registry.npmjs.org/@react-native/assets-registry/-/assets-registry-0.74.85.tgz",
diff --git a/package.json b/package.json
index 80451f1..455b2fc 100644
--- a/package.json
+++ b/package.json
@@ -35,6 +35,7 @@
"@react-native-firebase/crashlytics": "^20.3.0",
"@react-native-firebase/firestore": "^20.4.0",
"@react-native-firebase/functions": "^20.4.0",
+ "@react-native-google-signin/google-signin": "^13.1.0",
"@react-navigation/drawer": "^6.7.2",
"@react-navigation/native": "^6.0.2",
"date-fns": "^3.6.0",