Skip to content

Commit

Permalink
Revert "working on notifications"
Browse files Browse the repository at this point in the history
This reverts commit 9a70596.
  • Loading branch information
avichaljadeja2002 committed Dec 15, 2024
1 parent 6d99d09 commit 8e04d45
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 160 deletions.
38 changes: 1 addition & 37 deletions app/index.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
// import { IPAddr } from './constants';
// import axios from 'axios';
import GenericMainPageForm from './mainPageTemplate';
import React, { useState, useCallback, useEffect } from 'react';
import React, { useState, useCallback } from 'react';
import { formatTime, IPAddr } from './constants';
import { Task } from '../components/Types';
import axios from 'axios';
import { useFocusEffect } from '@react-navigation/native';
import { cLog } from './log'
import * as Notifications from 'expo-notifications';
import { Platform } from 'react-native';

export default function TaskScreen() {
const [tasks, setTasks] = useState<Task[]>([]);
Expand Down Expand Up @@ -49,40 +47,6 @@ export default function TaskScreen() {
}, [])
);

useEffect(() => {
registerForPushNotificationsAsync();
}, []);

async function registerForPushNotificationsAsync() {
let token;
if (Platform.OS === 'android') {
await Notifications.setNotificationChannelAsync('default', {
name: 'default',
importance: Notifications.AndroidImportance.MAX,
vibrationPattern: [0, 250, 250, 250],
lightColor: '#FF231F7C',
});
}

const { status: existingStatus } = await Notifications.getPermissionsAsync();
let finalStatus = existingStatus;

if (existingStatus !== 'granted') {
const { status } = await Notifications.requestPermissionsAsync();
finalStatus = status;
}

if (finalStatus !== 'granted') {
alert('Failed to get push token for push notification!');
return;
}

token = (await Notifications.getExpoPushTokenAsync()).data;
cLog('Expo Push Token: ' + token);

return token;
}

return (
<GenericMainPageForm
title='Home'
Expand Down
1 change: 0 additions & 1 deletion backend/omniplanner/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ dependencies {
implementation 'com.google.api-client:google-api-client:2.0.0'
implementation 'com.google.oauth-client:google-oauth-client-jetty:1.34.1'
implementation 'com.google.apis:google-api-services-calendar:v3-rev20220715-2.0.0'
implementation 'org.json:json:20240303'

testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.mockito:mockito-core:5.3.1'
Expand Down

This file was deleted.

75 changes: 3 additions & 72 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
"expo-constants": "^17.0.3",
"expo-font": "^13.0.1",
"expo-linking": "^7.0.3",
"expo-notifications": "^0.29.11",
"expo-router": "^3.5.24",
"expo-splash-screen": "^0.29.18",
"expo-status-bar": "^2.0.0",
Expand Down

0 comments on commit 8e04d45

Please sign in to comment.