Skip to content

Commit 8ee495c

Browse files
committed
Update build configuration and enhance audio session handling
- Change Flutter build mode from debug to release - Update Flutter version code and build number - Modify audio service to configure audio session for notification mixing - Adjust paths in generated files for consistency - Update pubspec.yaml to include audio_session dependency
1 parent 816d96b commit 8ee495c

7 files changed

Lines changed: 45 additions & 14 deletions

File tree

.claude/settings.local.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
"Bash(flutter create:*)",
1515
"Bash(find:*)",
1616
"Bash(grep:*)",
17-
"Bash(flutter clean:*)"
17+
"Bash(flutter clean:*)",
18+
"WebFetch(domain:pub.dev)"
1819
]
1920
}
2021
}

android/local.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
sdk.dir=/opt/homebrew/share/android-commandlinetools
22
flutter.sdk=/opt/homebrew/share/flutter
3-
flutter.buildMode=debug
3+
flutter.buildMode=release
44
flutter.versionName=1.0.0
5-
flutter.versionCode=1
5+
flutter.versionCode=1769294572

ios/Flutter/Generated.xcconfig

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
FLUTTER_ROOT=/opt/homebrew/share/flutter
33
FLUTTER_APPLICATION_PATH=/Users/schnobbc/Documents/Github/MeshMapper_Flutter_App
44
COCOAPODS_PARALLEL_CODE_SIGN=true
5-
FLUTTER_TARGET=/Users/schnobbc/Documents/Github/MeshMapper_Flutter_App/lib/main.dart
5+
FLUTTER_TARGET=lib/main.dart
66
FLUTTER_BUILD_DIR=build
77
FLUTTER_BUILD_NAME=1.0.0
8-
FLUTTER_BUILD_NUMBER=1
8+
FLUTTER_BUILD_NUMBER=1769294572
99
EXCLUDED_ARCHS[sdk=iphonesimulator*]=i386
1010
EXCLUDED_ARCHS[sdk=iphoneos*]=armv7
11-
DART_DEFINES=RkxVVFRFUl9WRVJTSU9OPTMuMzguNw==,RkxVVFRFUl9DSEFOTkVMPXN0YWJsZQ==,RkxVVFRFUl9HSVRfVVJMPWh0dHBzOi8vZ2l0aHViLmNvbS9mbHV0dGVyL2ZsdXR0ZXIuZ2l0,RkxVVFRFUl9GUkFNRVdPUktfUkVWSVNJT049M2I2MmVmYzJhMw==,RkxVVFRFUl9FTkdJTkVfUkVWSVNJT049NzhmYzMwMTJlNA==,RkxVVFRFUl9EQVJUX1ZFUlNJT049My4xMC43
11+
DART_DEFINES=QVBQX1ZFUlNJT049QVBQLTE3NjkyOTQ1NzI=,RkxVVFRFUl9WRVJTSU9OPTMuMzguNw==,RkxVVFRFUl9DSEFOTkVMPXN0YWJsZQ==,RkxVVFRFUl9HSVRfVVJMPWh0dHBzOi8vZ2l0aHViLmNvbS9mbHV0dGVyL2ZsdXR0ZXIuZ2l0,RkxVVFRFUl9GUkFNRVdPUktfUkVWSVNJT049M2I2MmVmYzJhMw==,RkxVVFRFUl9FTkdJTkVfUkVWSVNJT049NzhmYzMwMTJlNA==,RkxVVFRFUl9EQVJUX1ZFUlNJT049My4xMC43
1212
DART_OBFUSCATION=false
13-
TRACK_WIDGET_CREATION=true
14-
TREE_SHAKE_ICONS=false
13+
TRACK_WIDGET_CREATION=false
14+
TREE_SHAKE_ICONS=true
1515
PACKAGE_CONFIG=/Users/schnobbc/Documents/Github/MeshMapper_Flutter_App/.dart_tool/package_config.json

ios/Flutter/flutter_export_environment.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
export "FLUTTER_ROOT=/opt/homebrew/share/flutter"
44
export "FLUTTER_APPLICATION_PATH=/Users/schnobbc/Documents/Github/MeshMapper_Flutter_App"
55
export "COCOAPODS_PARALLEL_CODE_SIGN=true"
6-
export "FLUTTER_TARGET=/Users/schnobbc/Documents/Github/MeshMapper_Flutter_App/lib/main.dart"
6+
export "FLUTTER_TARGET=lib/main.dart"
77
export "FLUTTER_BUILD_DIR=build"
88
export "FLUTTER_BUILD_NAME=1.0.0"
9-
export "FLUTTER_BUILD_NUMBER=1"
10-
export "DART_DEFINES=RkxVVFRFUl9WRVJTSU9OPTMuMzguNw==,RkxVVFRFUl9DSEFOTkVMPXN0YWJsZQ==,RkxVVFRFUl9HSVRfVVJMPWh0dHBzOi8vZ2l0aHViLmNvbS9mbHV0dGVyL2ZsdXR0ZXIuZ2l0,RkxVVFRFUl9GUkFNRVdPUktfUkVWSVNJT049M2I2MmVmYzJhMw==,RkxVVFRFUl9FTkdJTkVfUkVWSVNJT049NzhmYzMwMTJlNA==,RkxVVFRFUl9EQVJUX1ZFUlNJT049My4xMC43"
9+
export "FLUTTER_BUILD_NUMBER=1769294572"
10+
export "DART_DEFINES=QVBQX1ZFUlNJT049QVBQLTE3NjkyOTQ1NzI=,RkxVVFRFUl9WRVJTSU9OPTMuMzguNw==,RkxVVFRFUl9DSEFOTkVMPXN0YWJsZQ==,RkxVVFRFUl9HSVRfVVJMPWh0dHBzOi8vZ2l0aHViLmNvbS9mbHV0dGVyL2ZsdXR0ZXIuZ2l0,RkxVVFRFUl9GUkFNRVdPUktfUkVWSVNJT049M2I2MmVmYzJhMw==,RkxVVFRFUl9FTkdJTkVfUkVWSVNJT049NzhmYzMwMTJlNA==,RkxVVFRFUl9EQVJUX1ZFUlNJT049My4xMC43"
1111
export "DART_OBFUSCATION=false"
12-
export "TRACK_WIDGET_CREATION=true"
13-
export "TREE_SHAKE_ICONS=false"
12+
export "TRACK_WIDGET_CREATION=false"
13+
export "TREE_SHAKE_ICONS=true"
1414
export "PACKAGE_CONFIG=/Users/schnobbc/Documents/Github/MeshMapper_Flutter_App/.dart_tool/package_config.json"

lib/services/audio_service.dart

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import 'package:just_audio/just_audio.dart';
22
import 'package:hive_flutter/hive_flutter.dart';
3+
import 'package:audio_session/audio_session.dart';
34

45
import '../utils/debug_logger_io.dart';
56

@@ -30,6 +31,34 @@ class AudioService {
3031
// Load enabled state from preferences
3132
await _loadEnabledState();
3233

34+
// Configure audio session for notification mixing (play over music)
35+
try {
36+
final session = await AudioSession.instance;
37+
await session.configure(
38+
const AudioSessionConfiguration(
39+
// iOS: ambient category plays alongside other audio
40+
avAudioSessionCategory: AVAudioSessionCategory.ambient,
41+
avAudioSessionCategoryOptions: AVAudioSessionCategoryOptions.none,
42+
avAudioSessionMode: AVAudioSessionMode.defaultMode,
43+
avAudioSessionRouteSharingPolicy:
44+
AVAudioSessionRouteSharingPolicy.defaultPolicy,
45+
avAudioSessionSetActiveOptions: AVAudioSessionSetActiveOptions.none,
46+
// Android: transient focus allows other audio to continue
47+
androidAudioAttributes: AndroidAudioAttributes(
48+
contentType: AndroidAudioContentType.sonification,
49+
usage: AndroidAudioUsage.notification,
50+
),
51+
androidAudioFocusGainType:
52+
AndroidAudioFocusGainType.gainTransientMayDuck,
53+
androidWillPauseWhenDucked: false,
54+
),
55+
);
56+
debugLog('[AUDIO] Audio session configured for notification mixing');
57+
} catch (e) {
58+
debugError('[AUDIO] Failed to configure audio session: $e');
59+
// Continue initialization - audio will still work, just may interrupt music
60+
}
61+
3362
// Create audio players
3463
_txPlayer = AudioPlayer();
3564
_rxPlayer = AudioPlayer();

pubspec.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ packages:
4242
source: hosted
4343
version: "2.13.0"
4444
audio_session:
45-
dependency: transitive
45+
dependency: "direct main"
4646
description:
4747
name: audio_session
4848
sha256: "2b7fff16a552486d078bfc09a8cde19f426dc6d6329262b684182597bec5b1ac"

pubspec.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ dependencies:
3636
flutter_background_service: ^5.0.10
3737
flutter_local_notifications: ^17.0.0
3838
just_audio: ^0.9.40
39+
audio_session: ^0.1.21
3940

4041
dev_dependencies:
4142
flutter_test:

0 commit comments

Comments
 (0)