- App.tsx: full navigation (Auth stack + Main tabs with 5 screens) - Auth: LoginScreen, RegisterScreen, ForgotPasswordScreen - HomeScreen: dashboard with IoT metrics, weather widget, alerts, quick actions, sensors - MapScreen: interactive map with layer toggles (6 layers) - MarketplaceScreen: categories (6), products (5), search - ChatScreen: AI chat with quick prompts (4), bot responses - ProfileScreen: user info, stats, menu (9 items), logout - AlertsScreen: alert list with severity, acknowledge - SensorsScreen: sensor list with type filters (6 types), search - ZonesScreen: zone cards with stats - SettingsScreen: language picker (FR/EN/ES/DE), privacy, about - Stores: iotStore (sensors, zones, alerts), notificationStore, uiStore + i18n - Hooks: useSensors, useAlerts, useNotifications, useLocation - Components: Card, Button, LoadingSpinner, ErrorBoundary, Header - Services: iotService, notificationService (with axios API client) - Utils: formatters (temp, AQI, noise, dates), validators (email, password, IBAN) - Theme: colors.ts with full design system (Blue Ocean palette) - Ditto: fixed MongoDB connection, new JWT secrets, official gateway image
59 lines
2.6 KiB
JavaScript
59 lines
2.6 KiB
JavaScript
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.setNotificationSounds = exports.withNotificationSounds = exports.withNotificationsIOS = void 0;
|
|
const config_plugins_1 = require("expo/config-plugins");
|
|
const fs_1 = require("fs");
|
|
const path_1 = require("path");
|
|
const ERROR_MSG_PREFIX = 'An error occurred while configuring iOS notifications. ';
|
|
const withNotificationsIOS = (config, { mode = 'development', sounds = [] }) => {
|
|
config = (0, config_plugins_1.withEntitlementsPlist)(config, (config) => {
|
|
config.modResults['aps-environment'] = mode;
|
|
return config;
|
|
});
|
|
config = (0, exports.withNotificationSounds)(config, { sounds });
|
|
return config;
|
|
};
|
|
exports.withNotificationsIOS = withNotificationsIOS;
|
|
const withNotificationSounds = (config, { sounds }) => {
|
|
return (0, config_plugins_1.withXcodeProject)(config, (config) => {
|
|
setNotificationSounds(config.modRequest.projectRoot, {
|
|
sounds,
|
|
project: config.modResults,
|
|
projectName: config.modRequest.projectName,
|
|
});
|
|
return config;
|
|
});
|
|
};
|
|
exports.withNotificationSounds = withNotificationSounds;
|
|
/**
|
|
* Save sound files to the Xcode project root and add them to the Xcode project.
|
|
*/
|
|
function setNotificationSounds(projectRoot, { sounds, project, projectName, }) {
|
|
if (!projectName) {
|
|
throw new Error(ERROR_MSG_PREFIX + `Unable to find iOS project name.`);
|
|
}
|
|
if (!Array.isArray(sounds)) {
|
|
throw new Error(ERROR_MSG_PREFIX +
|
|
`Must provide an array of sound files in your app config, found ${typeof sounds}.`);
|
|
}
|
|
const sourceRoot = config_plugins_1.IOSConfig.Paths.getSourceRoot(projectRoot);
|
|
for (const soundFileRelativePath of sounds) {
|
|
const fileName = (0, path_1.basename)(soundFileRelativePath);
|
|
const sourceFilepath = (0, path_1.resolve)(projectRoot, soundFileRelativePath);
|
|
const destinationFilepath = (0, path_1.resolve)(sourceRoot, fileName);
|
|
// Since it's possible that the filename is the same, but the
|
|
// file itself id different, let's copy it regardless
|
|
(0, fs_1.copyFileSync)(sourceFilepath, destinationFilepath);
|
|
if (!project.hasFile(`${projectName}/${fileName}`)) {
|
|
project = config_plugins_1.IOSConfig.XcodeUtils.addResourceFileToGroup({
|
|
filepath: `${projectName}/${fileName}`,
|
|
groupName: projectName,
|
|
isBuildFile: true,
|
|
project,
|
|
});
|
|
}
|
|
}
|
|
return project;
|
|
}
|
|
exports.setNotificationSounds = setNotificationSounds;
|