Skip to content

Commit 84ef055

Browse files
authored
Merge pull request #159 from Resgrid/develop
Develop
2 parents 2d204d0 + 2fe373e commit 84ef055

File tree

15 files changed

+1107
-184
lines changed

15 files changed

+1107
-184
lines changed

.DS_Store

0 Bytes
Binary file not shown.

__mocks__/react-native-callkeep.ts

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export default {
1+
const mockMethods = {
22
setup: jest.fn().mockResolvedValue(undefined),
33
startCall: jest.fn().mockResolvedValue(undefined),
44
reportConnectingOutgoingCallWithUUID: jest.fn().mockResolvedValue(undefined),
@@ -12,6 +12,17 @@ export default {
1212
backToForeground: jest.fn(),
1313
};
1414

15-
export const AudioSessionCategoryOption = {};
16-
export const AudioSessionMode = {};
15+
export default mockMethods;
16+
17+
export const AudioSessionCategoryOption = {
18+
allowAirPlay: 1,
19+
allowBluetooth: 2,
20+
allowBluetoothA2DP: 4,
21+
defaultToSpeaker: 8,
22+
};
23+
24+
export const AudioSessionMode = {
25+
voiceChat: 1,
26+
};
27+
1728
export const CONSTANTS = {};

app.config.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,15 @@ export default ({ config }: ConfigContext): ExpoConfig => ({
4747
infoPlist: {
4848
UIBackgroundModes: ['remote-notification', 'audio', 'bluetooth-central', 'voip'],
4949
ITSAppUsesNonExemptEncryption: false,
50+
UIViewControllerBasedStatusBarAppearance: false,
5051
NSBluetoothAlwaysUsageDescription: 'Allow Resgrid Unit to connect to bluetooth devices for PTT.',
5152
},
53+
entitlements: {
54+
...((Env.APP_ENV === 'production' || Env.APP_ENV === 'internal') && {
55+
'com.apple.developer.usernotifications.critical-alerts': true,
56+
'com.apple.developer.usernotifications.time-sensitive': true,
57+
}),
58+
},
5259
},
5360
experiments: {
5461
typedRoutes: true,

src/app/_layout.tsx

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ import { GluestackUIProvider } from '@/components/ui/gluestack-ui-provider';
2626
import { loadKeepAliveState } from '@/lib/hooks/use-keep-alive';
2727
import { loadSelectedTheme } from '@/lib/hooks/use-selected-theme';
2828
import { logger } from '@/lib/logging';
29-
import { getDeviceUuid } from '@/lib/storage/app';
30-
import { setDeviceUuid } from '@/lib/storage/app';
29+
import { getDeviceUuid, setDeviceUuid } from '@/lib/storage/app';
3130
import { loadBackgroundGeolocationState } from '@/lib/storage/background-geolocation';
3231
import { uuidv4 } from '@/lib/utils';
32+
import { appInitializationService } from '@/services/app-initialization.service';
3333

3434
export { ErrorBoundary } from 'expo-router';
3535
export const navigationRef = createNavigationContainerRef();
@@ -141,6 +141,21 @@ function RootLayout() {
141141
context: { error },
142142
});
143143
});
144+
145+
// Initialize global app services (including CallKeep for iOS)
146+
appInitializationService
147+
.initialize()
148+
.then(() => {
149+
logger.info({
150+
message: 'Global app services initialized successfully',
151+
});
152+
})
153+
.catch((error) => {
154+
logger.error({
155+
message: 'Failed to initialize global app services',
156+
context: { error },
157+
});
158+
});
144159
}, [ref]);
145160

146161
return (

src/app/login/login-form.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export type LoginFormProps = {
4242
onServerUrlPress?: () => void;
4343
};
4444

45-
export const LoginForm = ({ onSubmit = () => { }, isLoading = false, error = undefined, onServerUrlPress }: LoginFormProps) => {
45+
export const LoginForm = ({ onSubmit = () => {}, isLoading = false, error = undefined, onServerUrlPress }: LoginFormProps) => {
4646
const { colorScheme } = useColorScheme();
4747
const { t } = useTranslation();
4848
const {

0 commit comments

Comments
 (0)