react-native-audio-api 0.11.0-alpha.4 → 0.11.0-alpha.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (141) hide show
  1. package/android/src/main/java/com/swmansion/audioapi/AudioAPIModule.kt +164 -16
  2. package/android/src/main/java/com/swmansion/audioapi/core/NativeAudioPlayer.kt +10 -8
  3. package/android/src/main/java/com/swmansion/audioapi/core/NativeAudioRecorder.kt +10 -8
  4. package/android/src/main/java/com/swmansion/audioapi/system/AudioFocusListener.kt +5 -2
  5. package/android/src/main/java/com/swmansion/audioapi/system/CentralizedForegroundService.kt +128 -0
  6. package/android/src/main/java/com/swmansion/audioapi/system/ForegroundServiceManager.kt +116 -0
  7. package/android/src/main/java/com/swmansion/audioapi/system/MediaSessionManager.kt +115 -107
  8. package/android/src/main/java/com/swmansion/audioapi/system/PermissionRequestListener.kt +2 -1
  9. package/android/src/main/java/com/swmansion/audioapi/system/notification/BaseNotification.kt +47 -0
  10. package/android/src/main/java/com/swmansion/audioapi/system/notification/NotificationRegistry.kt +191 -0
  11. package/android/src/main/java/com/swmansion/audioapi/system/notification/PlaybackNotification.kt +669 -0
  12. package/android/src/main/java/com/swmansion/audioapi/system/notification/PlaybackNotificationReceiver.kt +33 -0
  13. package/android/src/main/java/com/swmansion/audioapi/system/notification/RecordingNotification.kt +303 -0
  14. package/android/src/main/java/com/swmansion/audioapi/system/notification/RecordingNotificationReceiver.kt +45 -0
  15. package/android/src/main/java/com/swmansion/audioapi/system/notification/SimpleNotification.kt +119 -0
  16. package/common/cpp/audioapi/utils/AudioFileProperties.h +17 -17
  17. package/ios/audioapi/ios/AudioAPIModule.h +2 -2
  18. package/ios/audioapi/ios/AudioAPIModule.mm +108 -18
  19. package/ios/audioapi/ios/core/NativeAudioRecorder.m +8 -1
  20. package/ios/audioapi/ios/system/AudioEngine.mm +2 -2
  21. package/ios/audioapi/ios/system/AudioSessionManager.mm +12 -9
  22. package/ios/audioapi/ios/system/NotificationManager.mm +1 -1
  23. package/ios/audioapi/ios/system/notification/BaseNotification.h +58 -0
  24. package/ios/audioapi/ios/system/notification/NotificationRegistry.h +70 -0
  25. package/ios/audioapi/ios/system/notification/NotificationRegistry.mm +172 -0
  26. package/ios/audioapi/ios/system/notification/PlaybackNotification.h +27 -0
  27. package/ios/audioapi/ios/system/notification/PlaybackNotification.mm +427 -0
  28. package/lib/commonjs/api.js +72 -1
  29. package/lib/commonjs/api.js.map +1 -1
  30. package/lib/commonjs/api.web.js +27 -14
  31. package/lib/commonjs/api.web.js.map +1 -1
  32. package/lib/commonjs/specs/NativeAudioAPIModule.js.map +1 -1
  33. package/lib/commonjs/system/AudioManager.js +6 -9
  34. package/lib/commonjs/system/AudioManager.js.map +1 -1
  35. package/lib/commonjs/system/index.js +13 -0
  36. package/lib/commonjs/system/index.js.map +1 -1
  37. package/lib/commonjs/system/notification/PlaybackNotificationManager.js +135 -0
  38. package/lib/commonjs/system/notification/PlaybackNotificationManager.js.map +1 -0
  39. package/lib/commonjs/system/notification/RecordingNotificationManager.js +182 -0
  40. package/lib/commonjs/system/notification/RecordingNotificationManager.js.map +1 -0
  41. package/lib/commonjs/system/notification/SimpleNotificationManager.js +122 -0
  42. package/lib/commonjs/system/notification/SimpleNotificationManager.js.map +1 -0
  43. package/lib/commonjs/system/notification/index.js +45 -0
  44. package/lib/commonjs/system/notification/index.js.map +1 -0
  45. package/lib/commonjs/system/notification/types.js +6 -0
  46. package/lib/commonjs/system/notification/types.js.map +1 -0
  47. package/lib/commonjs/types.js +17 -17
  48. package/lib/commonjs/types.js.map +1 -1
  49. package/lib/commonjs/web-system/index.js +17 -0
  50. package/lib/commonjs/web-system/index.js.map +1 -0
  51. package/lib/commonjs/web-system/notification/PlaybackNotificationManager.js +34 -0
  52. package/lib/commonjs/web-system/notification/PlaybackNotificationManager.js.map +1 -0
  53. package/lib/commonjs/web-system/notification/RecordingNotificationManager.js +34 -0
  54. package/lib/commonjs/web-system/notification/RecordingNotificationManager.js.map +1 -0
  55. package/lib/commonjs/web-system/notification/index.js +21 -0
  56. package/lib/commonjs/web-system/notification/index.js.map +1 -0
  57. package/lib/module/api.js +4 -0
  58. package/lib/module/api.js.map +1 -1
  59. package/lib/module/api.web.js +3 -1
  60. package/lib/module/api.web.js.map +1 -1
  61. package/lib/module/specs/NativeAudioAPIModule.js.map +1 -1
  62. package/lib/module/system/AudioManager.js +6 -9
  63. package/lib/module/system/AudioManager.js.map +1 -1
  64. package/lib/module/system/index.js +1 -0
  65. package/lib/module/system/index.js.map +1 -1
  66. package/lib/module/system/notification/PlaybackNotificationManager.js +131 -0
  67. package/lib/module/system/notification/PlaybackNotificationManager.js.map +1 -0
  68. package/lib/module/system/notification/RecordingNotificationManager.js +178 -0
  69. package/lib/module/system/notification/RecordingNotificationManager.js.map +1 -0
  70. package/lib/module/system/notification/SimpleNotificationManager.js +118 -0
  71. package/lib/module/system/notification/SimpleNotificationManager.js.map +1 -0
  72. package/lib/module/system/notification/index.js +7 -0
  73. package/lib/module/system/notification/index.js.map +1 -0
  74. package/lib/module/system/notification/types.js +4 -0
  75. package/lib/module/system/notification/types.js.map +1 -0
  76. package/lib/module/types.js +17 -17
  77. package/lib/module/types.js.map +1 -1
  78. package/lib/module/web-system/index.js +4 -0
  79. package/lib/module/web-system/index.js.map +1 -0
  80. package/lib/module/web-system/notification/PlaybackNotificationManager.js +30 -0
  81. package/lib/module/web-system/notification/PlaybackNotificationManager.js.map +1 -0
  82. package/lib/module/web-system/notification/RecordingNotificationManager.js +30 -0
  83. package/lib/module/web-system/notification/RecordingNotificationManager.js.map +1 -0
  84. package/lib/module/web-system/notification/index.js +5 -0
  85. package/lib/module/web-system/notification/index.js.map +1 -0
  86. package/lib/typescript/api.d.ts +2 -0
  87. package/lib/typescript/api.d.ts.map +1 -1
  88. package/lib/typescript/api.web.d.ts +3 -1
  89. package/lib/typescript/api.web.d.ts.map +1 -1
  90. package/lib/typescript/events/types.d.ts +2 -2
  91. package/lib/typescript/events/types.d.ts.map +1 -1
  92. package/lib/typescript/specs/NativeAudioAPIModule.d.ts +16 -5
  93. package/lib/typescript/specs/NativeAudioAPIModule.d.ts.map +1 -1
  94. package/lib/typescript/system/AudioManager.d.ts +4 -5
  95. package/lib/typescript/system/AudioManager.d.ts.map +1 -1
  96. package/lib/typescript/system/index.d.ts +1 -0
  97. package/lib/typescript/system/index.d.ts.map +1 -1
  98. package/lib/typescript/system/notification/PlaybackNotificationManager.d.ts +22 -0
  99. package/lib/typescript/system/notification/PlaybackNotificationManager.d.ts.map +1 -0
  100. package/lib/typescript/system/notification/RecordingNotificationManager.d.ts +23 -0
  101. package/lib/typescript/system/notification/RecordingNotificationManager.d.ts.map +1 -0
  102. package/lib/typescript/system/notification/SimpleNotificationManager.d.ts +20 -0
  103. package/lib/typescript/system/notification/SimpleNotificationManager.d.ts.map +1 -0
  104. package/lib/typescript/system/notification/index.d.ts +5 -0
  105. package/lib/typescript/system/notification/index.d.ts.map +1 -0
  106. package/lib/typescript/system/notification/types.d.ts +65 -0
  107. package/lib/typescript/system/notification/types.d.ts.map +1 -0
  108. package/lib/typescript/system/types.d.ts +0 -16
  109. package/lib/typescript/system/types.d.ts.map +1 -1
  110. package/lib/typescript/types.d.ts +16 -16
  111. package/lib/typescript/types.d.ts.map +1 -1
  112. package/lib/typescript/web-system/index.d.ts +2 -0
  113. package/lib/typescript/web-system/index.d.ts.map +1 -0
  114. package/lib/typescript/web-system/notification/PlaybackNotificationManager.d.ts +19 -0
  115. package/lib/typescript/web-system/notification/PlaybackNotificationManager.d.ts.map +1 -0
  116. package/lib/typescript/web-system/notification/RecordingNotificationManager.d.ts +19 -0
  117. package/lib/typescript/web-system/notification/RecordingNotificationManager.d.ts.map +1 -0
  118. package/lib/typescript/web-system/notification/index.d.ts +3 -0
  119. package/lib/typescript/web-system/notification/index.d.ts.map +1 -0
  120. package/package.json +1 -1
  121. package/src/api.ts +17 -0
  122. package/src/api.web.ts +7 -2
  123. package/src/events/types.ts +2 -3
  124. package/src/specs/NativeAudioAPIModule.ts +23 -7
  125. package/src/system/AudioManager.ts +10 -23
  126. package/src/system/index.ts +1 -0
  127. package/src/system/notification/PlaybackNotificationManager.ts +193 -0
  128. package/src/system/notification/RecordingNotificationManager.ts +242 -0
  129. package/src/system/notification/SimpleNotificationManager.ts +170 -0
  130. package/src/system/notification/index.ts +4 -0
  131. package/src/system/notification/types.ts +111 -0
  132. package/src/system/types.ts +0 -18
  133. package/src/types.ts +17 -17
  134. package/src/web-system/index.ts +1 -0
  135. package/src/web-system/notification/PlaybackNotificationManager.ts +60 -0
  136. package/src/web-system/notification/RecordingNotificationManager.ts +60 -0
  137. package/src/web-system/notification/index.ts +2 -0
  138. package/android/src/main/java/com/swmansion/audioapi/system/LockScreenManager.kt +0 -347
  139. package/android/src/main/java/com/swmansion/audioapi/system/MediaNotificationManager.kt +0 -273
  140. package/android/src/main/java/com/swmansion/audioapi/system/MediaReceiver.kt +0 -57
  141. package/android/src/main/java/com/swmansion/audioapi/system/MediaSessionCallback.kt +0 -61
@@ -42,6 +42,7 @@ static inline uint32_t nextPowerOfTwo(uint32_t x)
42
42
  return self;
43
43
  }
44
44
 
45
+ // Note: this method should be called only after the session is activated
45
46
  - (AVAudioFormat *)getInputFormat
46
47
  {
47
48
  AVAudioFormat *format = [AudioEngine.sharedInstance.audioEngine.inputNode inputFormatForBus:0];
@@ -97,7 +98,13 @@ static inline uint32_t nextPowerOfTwo(uint32_t x)
97
98
  assert(audioEngine != nil);
98
99
  [audioEngine stopIfPossible];
99
100
  [audioEngine detachInputNode];
100
- [audioEngine restartAudioEngine];
101
+
102
+ // This makes sure that the engine releases the input properly when we no longer need it
103
+ // (i.e. no more misleading dot)
104
+ // Restart only if is not running to avoid interruptions of playback
105
+ if ([audioEngine getState] != AudioEngineStateRunning) {
106
+ [audioEngine restartAudioEngine];
107
+ }
101
108
  }
102
109
 
103
110
  - (void)pause
@@ -268,10 +268,10 @@ static AudioEngine *_sharedInstance = nil;
268
268
  NSLog(@"================ 🎧 AVAudioEngine STATE ================");
269
269
 
270
270
  // AVAudioEngine state
271
- NSLog(@"➡️ engine.isRunning: %@", self.audioEngine.isRunning ? @"YES" : @"NO");
271
+ NSLog(@"➡️ engine.isRunning: %@", self.audioEngine.isRunning ? @"true" : @"false");
272
272
  NSLog(
273
273
  @"➡️ engine.isInManualRenderingMode: %@",
274
- self.audioEngine.isInManualRenderingMode ? @"YES" : @"NO");
274
+ self.audioEngine.isInManualRenderingMode ? @"true" : @"false");
275
275
 
276
276
  // Session state
277
277
  NSLog(@"🎚️ Session category: %@", session.category);
@@ -66,15 +66,18 @@ static AudioSessionManager *_sharedInstance = nil;
66
66
  (unsigned long)self.audioSession.categoryOptions);
67
67
  }
68
68
 
69
- if (self.audioSession.allowHapticsAndSystemSoundsDuringRecording != self.allowHapticsAndSounds) {
70
- [self.audioSession setAllowHapticsAndSystemSoundsDuringRecording:self.allowHapticsAndSounds
71
- error:&error];
72
-
73
- if (error != nil) {
74
- NSLog(
75
- @"Error while setting allowHapticsAndSystemSoundsDuringRecording: %@",
76
- [error debugDescription]);
77
- return false;
69
+ if (@available(iOS 13.0, *)) {
70
+ if (self.audioSession.allowHapticsAndSystemSoundsDuringRecording !=
71
+ self.allowHapticsAndSounds) {
72
+ [self.audioSession setAllowHapticsAndSystemSoundsDuringRecording:self.allowHapticsAndSounds
73
+ error:&error];
74
+
75
+ if (error != nil) {
76
+ NSLog(
77
+ @"Error while setting allowHapticsAndSystemSoundsDuringRecording: %@",
78
+ [error debugDescription]);
79
+ return false;
80
+ }
78
81
  }
79
82
  }
80
83
 
@@ -239,7 +239,7 @@ static NSString *NotificationManagerContext = @"NotificationManagerContext";
239
239
  target:self
240
240
  selector:@selector(checkSecondaryAudioHint)
241
241
  userInfo:nil
242
- repeats:YES];
242
+ repeats:true];
243
243
 
244
244
  [[NSRunLoop mainRunLoop] addTimer:self.hintPollingTimer forMode:NSRunLoopCommonModes];
245
245
  }
@@ -0,0 +1,58 @@
1
+ #pragma once
2
+
3
+ #import <Foundation/Foundation.h>
4
+
5
+ /**
6
+ * BaseNotification protocol
7
+ *
8
+ * Interface that all notification types must implement.
9
+ */
10
+ @protocol BaseNotification <NSObject>
11
+
12
+ @required
13
+
14
+ /**
15
+ * Initialize the notification.
16
+ * @param options Initialization options (can be nil)
17
+ * @return YES if successful
18
+ */
19
+ - (BOOL)initializeWithOptions:(NSDictionary *)options;
20
+
21
+ /**
22
+ * Show the notification (sets metadata on iOS).
23
+ * @param options Notification options
24
+ * @return YES if successful
25
+ */
26
+ - (BOOL)showWithOptions:(NSDictionary *)options;
27
+
28
+ /**
29
+ * Update notification metadata.
30
+ * @param options Updated information
31
+ * @return YES if successful
32
+ */
33
+ - (BOOL)updateWithOptions:(NSDictionary *)options;
34
+
35
+ /**
36
+ * Hide the notification (clears metadata on iOS).
37
+ * @return YES if successful
38
+ */
39
+ - (BOOL)hide;
40
+
41
+ /**
42
+ * Clean up and release resources.
43
+ */
44
+ - (void)cleanup;
45
+
46
+ /**
47
+ * Check if notification is active.
48
+ * @return YES if active
49
+ */
50
+ - (BOOL)isActive;
51
+
52
+ /**
53
+ * Get notification type identifier.
54
+ * @return Type identifier (e.g., "playback", "recording")
55
+ */
56
+ - (NSString *)getNotificationType;
57
+
58
+ @end
@@ -0,0 +1,70 @@
1
+ #pragma once
2
+
3
+ #import <Foundation/Foundation.h>
4
+ #import <audioapi/ios/system/notification/BaseNotification.h>
5
+
6
+ @class AudioAPIModule;
7
+
8
+ /**
9
+ * NotificationRegistry
10
+ *
11
+ * Central manager for all notification types.
12
+ * Manages registration, lifecycle, and routing of notification implementations.
13
+ */
14
+ @interface NotificationRegistry : NSObject
15
+
16
+ @property (nonatomic, weak) AudioAPIModule *audioAPIModule;
17
+
18
+ - (instancetype)initWithAudioAPIModule:(AudioAPIModule *)audioAPIModule;
19
+
20
+ /**
21
+ * Register a new notification type.
22
+ * @param type The notification type identifier (e.g., "playback", "recording")
23
+ * @param key Unique key for this notification instance
24
+ * @return YES if registration succeeded, NO otherwise
25
+ */
26
+ - (BOOL)registerNotificationType:(NSString *)type withKey:(NSString *)key;
27
+
28
+ /**
29
+ * Show a registered notification.
30
+ * @param key The notification key
31
+ * @param options Options for showing the notification
32
+ * @return YES if successful, NO otherwise
33
+ */
34
+ - (BOOL)showNotificationWithKey:(NSString *)key options:(NSDictionary *)options;
35
+
36
+ /**
37
+ * Update a shown notification.
38
+ * @param key The notification key
39
+ * @param options Updated options
40
+ * @return YES if successful, NO otherwise
41
+ */
42
+ - (BOOL)updateNotificationWithKey:(NSString *)key options:(NSDictionary *)options;
43
+
44
+ /**
45
+ * Hide a notification.
46
+ * @param key The notification key
47
+ * @return YES if successful, NO otherwise
48
+ */
49
+ - (BOOL)hideNotificationWithKey:(NSString *)key;
50
+
51
+ /**
52
+ * Unregister and clean up a notification.
53
+ * @param key The notification key
54
+ * @return YES if successful, NO otherwise
55
+ */
56
+ - (BOOL)unregisterNotificationWithKey:(NSString *)key;
57
+
58
+ /**
59
+ * Check if a notification is active.
60
+ * @param key The notification key
61
+ * @return YES if active, NO otherwise
62
+ */
63
+ - (BOOL)isNotificationActiveWithKey:(NSString *)key;
64
+
65
+ /**
66
+ * Clean up all notifications.
67
+ */
68
+ - (void)cleanup;
69
+
70
+ @end
@@ -0,0 +1,172 @@
1
+ #import <audioapi/ios/AudioAPIModule.h>
2
+ #import <audioapi/ios/system/notification/NotificationRegistry.h>
3
+ #import <audioapi/ios/system/notification/PlaybackNotification.h>
4
+
5
+ @implementation NotificationRegistry {
6
+ NSMutableDictionary<NSString *, id<BaseNotification>> *_notifications;
7
+ }
8
+
9
+ - (instancetype)initWithAudioAPIModule:(AudioAPIModule *)audioAPIModule
10
+ {
11
+ if (self = [super init]) {
12
+ self.audioAPIModule = audioAPIModule;
13
+ _notifications = [[NSMutableDictionary alloc] init];
14
+
15
+ NSLog(@"[NotificationRegistry] Initialized");
16
+ }
17
+
18
+ return self;
19
+ }
20
+
21
+ - (BOOL)registerNotificationType:(NSString *)type withKey:(NSString *)key
22
+ {
23
+ if (!type || !key) {
24
+ NSLog(@"[NotificationRegistry] Invalid type or key");
25
+ return false;
26
+ }
27
+
28
+ // Check if already registered
29
+ if (_notifications[key]) {
30
+ NSLog(@"[NotificationRegistry] Notification with key '%@' already registered", key);
31
+ return false;
32
+ }
33
+
34
+ // Create the appropriate notification type
35
+ id<BaseNotification> notification = [self createNotificationForType:type];
36
+
37
+ if (!notification) {
38
+ NSLog(@"[NotificationRegistry] Unknown notification type: %@", type);
39
+ return false;
40
+ }
41
+
42
+ // Store the notification
43
+ _notifications[key] = notification;
44
+
45
+ NSLog(@"[NotificationRegistry] Registered notification type '%@' with key '%@'", type, key);
46
+ return true;
47
+ }
48
+
49
+ - (BOOL)showNotificationWithKey:(NSString *)key options:(NSDictionary *)options
50
+ {
51
+ id<BaseNotification> notification = _notifications[key];
52
+
53
+ if (!notification) {
54
+ NSLog(@"[NotificationRegistry] No notification found with key: %@", key);
55
+ return false;
56
+ }
57
+
58
+ // Initialize if first time showing
59
+ if (![notification isActive]) {
60
+ if (![notification initializeWithOptions:options]) {
61
+ NSLog(@"[NotificationRegistry] Failed to initialize notification: %@", key);
62
+ return false;
63
+ }
64
+ }
65
+
66
+ BOOL success = [notification showWithOptions:options];
67
+
68
+ if (success) {
69
+ NSLog(@"[NotificationRegistry] Showed notification: %@", key);
70
+ } else {
71
+ NSLog(@"[NotificationRegistry] Failed to show notification: %@", key);
72
+ }
73
+
74
+ return success;
75
+ }
76
+
77
+ - (BOOL)updateNotificationWithKey:(NSString *)key options:(NSDictionary *)options
78
+ {
79
+ id<BaseNotification> notification = _notifications[key];
80
+
81
+ if (!notification) {
82
+ NSLog(@"[NotificationRegistry] No notification found with key: %@", key);
83
+ return false;
84
+ }
85
+
86
+ BOOL success = [notification updateWithOptions:options];
87
+
88
+ if (success) {
89
+ NSLog(@"[NotificationRegistry] Updated notification: %@", key);
90
+ } else {
91
+ NSLog(@"[NotificationRegistry] Failed to update notification: %@", key);
92
+ }
93
+
94
+ return success;
95
+ }
96
+
97
+ - (BOOL)hideNotificationWithKey:(NSString *)key
98
+ {
99
+ id<BaseNotification> notification = _notifications[key];
100
+
101
+ if (!notification) {
102
+ NSLog(@"[NotificationRegistry] No notification found with key: %@", key);
103
+ return false;
104
+ }
105
+
106
+ BOOL success = [notification hide];
107
+
108
+ if (success) {
109
+ NSLog(@"[NotificationRegistry] Hid notification: %@", key);
110
+ } else {
111
+ NSLog(@"[NotificationRegistry] Failed to hide notification: %@", key);
112
+ }
113
+
114
+ return success;
115
+ }
116
+
117
+ - (BOOL)unregisterNotificationWithKey:(NSString *)key
118
+ {
119
+ id<BaseNotification> notification = _notifications[key];
120
+
121
+ if (!notification) {
122
+ NSLog(@"[NotificationRegistry] No notification found with key: %@", key);
123
+ return false;
124
+ }
125
+
126
+ // Clean up and remove
127
+ [notification cleanup];
128
+ [_notifications removeObjectForKey:key];
129
+
130
+ NSLog(@"[NotificationRegistry] Unregistered notification: %@", key);
131
+ return true;
132
+ }
133
+
134
+ - (BOOL)isNotificationActiveWithKey:(NSString *)key
135
+ {
136
+ id<BaseNotification> notification = _notifications[key];
137
+
138
+ if (!notification) {
139
+ return false;
140
+ }
141
+
142
+ return [notification isActive];
143
+ }
144
+
145
+ - (void)cleanup
146
+ {
147
+ NSLog(@"[NotificationRegistry] Cleaning up all notifications");
148
+
149
+ // Clean up all notifications
150
+ for (id<BaseNotification> notification in [_notifications allValues]) {
151
+ [notification cleanup];
152
+ }
153
+
154
+ [_notifications removeAllObjects];
155
+ }
156
+
157
+ #pragma mark - Private Methods
158
+
159
+ - (id<BaseNotification>)createNotificationForType:(NSString *)type
160
+ {
161
+ if ([type isEqualToString:@"playback"]) {
162
+ return [[PlaybackNotification alloc] initWithAudioAPIModule:self.audioAPIModule];
163
+ }
164
+ // Future: Add more notification types here
165
+ // else if ([type isEqualToString:@"recording"]) {
166
+ // return [[RecordingNotification alloc] initWithAudioAPIModule:self.audioAPIModule];
167
+ // }
168
+
169
+ return nil;
170
+ }
171
+
172
+ @end
@@ -0,0 +1,27 @@
1
+ #pragma once
2
+
3
+ #import <Foundation/Foundation.h>
4
+ #import <MediaPlayer/MediaPlayer.h>
5
+ #import <audioapi/ios/system/notification/BaseNotification.h>
6
+
7
+ @class AudioAPIModule;
8
+
9
+ /**
10
+ * PlaybackNotification
11
+ *
12
+ * iOS playback notification using MPNowPlayingInfoCenter and MPRemoteCommandCenter.
13
+ * Provides lock screen controls, Control Center integration, and Now Playing display.
14
+ *
15
+ * Note: On iOS, this only manages metadata. Notification visibility is controlled
16
+ * by the AudioContext state (active audio session shows controls).
17
+ */
18
+ @interface PlaybackNotification : NSObject <BaseNotification>
19
+
20
+ @property (nonatomic, weak) AudioAPIModule *audioAPIModule;
21
+ @property (nonatomic, weak) MPNowPlayingInfoCenter *playingInfoCenter;
22
+ @property (nonatomic, copy) NSString *artworkUrl;
23
+ @property (nonatomic, assign) BOOL isActive;
24
+
25
+ - (instancetype)initWithAudioAPIModule:(AudioAPIModule *)audioAPIModule;
26
+
27
+ @end