Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified .DS_Store
Binary file not shown.
17 changes: 14 additions & 3 deletions __mocks__/react-native-callkeep.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default {
const mockMethods = {
setup: jest.fn().mockResolvedValue(undefined),
startCall: jest.fn().mockResolvedValue(undefined),
reportConnectingOutgoingCallWithUUID: jest.fn().mockResolvedValue(undefined),
Expand All @@ -12,6 +12,17 @@ export default {
backToForeground: jest.fn(),
};

export const AudioSessionCategoryOption = {};
export const AudioSessionMode = {};
export default mockMethods;

export const AudioSessionCategoryOption = {
allowAirPlay: 1,
allowBluetooth: 2,
allowBluetoothA2DP: 4,
defaultToSpeaker: 8,
};

export const AudioSessionMode = {
voiceChat: 1,
};

export const CONSTANTS = {};
6 changes: 6 additions & 0 deletions app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ export default ({ config }: ConfigContext): ExpoConfig => ({
ITSAppUsesNonExemptEncryption: false,
NSBluetoothAlwaysUsageDescription: 'Allow Resgrid Unit to connect to bluetooth devices for PTT.',
},
entitlements: {
...((Env.APP_ENV === 'production' || Env.APP_ENV === 'internal') && {
'com.apple.developer.usernotifications.critical-alerts': true,
'com.apple.developer.usernotifications.time-sensitive': true,
}),
},
},
experiments: {
typedRoutes: true,
Expand Down
19 changes: 17 additions & 2 deletions src/app/_layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ import { GluestackUIProvider } from '@/components/ui/gluestack-ui-provider';
import { loadKeepAliveState } from '@/lib/hooks/use-keep-alive';
import { loadSelectedTheme } from '@/lib/hooks/use-selected-theme';
import { logger } from '@/lib/logging';
import { getDeviceUuid } from '@/lib/storage/app';
import { setDeviceUuid } from '@/lib/storage/app';
import { getDeviceUuid, setDeviceUuid } from '@/lib/storage/app';
import { loadBackgroundGeolocationState } from '@/lib/storage/background-geolocation';
import { uuidv4 } from '@/lib/utils';
import { appInitializationService } from '@/services/app-initialization.service';

export { ErrorBoundary } from 'expo-router';
export const navigationRef = createNavigationContainerRef();
Expand Down Expand Up @@ -141,6 +141,21 @@ function RootLayout() {
context: { error },
});
});

// Initialize global app services (including CallKeep for iOS)
appInitializationService
.initialize()
.then(() => {
logger.info({
message: 'Global app services initialized successfully',
});
})
.catch((error) => {
logger.error({
message: 'Failed to initialize global app services',
context: { error },
});
});
}, [ref]);

return (
Expand Down
2 changes: 1 addition & 1 deletion src/app/login/login-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export type LoginFormProps = {
onServerUrlPress?: () => void;
};

export const LoginForm = ({ onSubmit = () => { }, isLoading = false, error = undefined, onServerUrlPress }: LoginFormProps) => {
export const LoginForm = ({ onSubmit = () => {}, isLoading = false, error = undefined, onServerUrlPress }: LoginFormProps) => {
const { colorScheme } = useColorScheme();
const { t } = useTranslation();
const {
Expand Down
Loading
Loading