- Created .gitignore to exclude sensitive files and directories. - Added API documentation in API_DOCUMENTATION.md. - Included deployment instructions in DEPLOYMENT.md. - Established project structure documentation in PROJECT_STRUCTURE.md. - Updated README.md with project status and team information. - Added recommendations and status tracking documents. - Introduced testing guidelines in TESTING.md. - Set up CI workflow in .github/workflows/ci.yml. - Created Dockerfile for backend and frontend setups. - Added various service and utility files for backend functionality. - Implemented frontend components and pages for user interface. - Included mobile app structure and services. - Established scripts for deployment across multiple chains.
53 lines
1.3 KiB
TypeScript
53 lines
1.3 KiB
TypeScript
import PushNotification from 'react-native-push-notification';
|
|
|
|
export class NotificationService {
|
|
static initialize() {
|
|
PushNotification.configure({
|
|
onRegister: function (token) {
|
|
console.log('TOKEN:', token);
|
|
},
|
|
onNotification: function (notification) {
|
|
console.log('NOTIFICATION:', notification);
|
|
},
|
|
permissions: {
|
|
alert: true,
|
|
badge: true,
|
|
sound: true,
|
|
},
|
|
popInitialNotification: true,
|
|
requestPermissions: true,
|
|
});
|
|
|
|
PushNotification.createChannel(
|
|
{
|
|
channelId: 'asle-default',
|
|
channelName: 'ASLE Notifications',
|
|
channelDescription: 'Notifications for ASLE platform',
|
|
playSound: true,
|
|
soundName: 'default',
|
|
importance: 4,
|
|
vibrate: true,
|
|
},
|
|
(created) => console.log(`Channel created: ${created}`)
|
|
);
|
|
}
|
|
|
|
static scheduleLocalNotification(title: string, message: string, date: Date) {
|
|
PushNotification.localNotificationSchedule({
|
|
channelId: 'asle-default',
|
|
title,
|
|
message,
|
|
date,
|
|
});
|
|
}
|
|
|
|
static sendLocalNotification(title: string, message: string) {
|
|
PushNotification.localNotification({
|
|
channelId: 'asle-default',
|
|
title,
|
|
message,
|
|
});
|
|
}
|
|
}
|
|
|