You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(amplify_push_notifications): replace removeFirst() with removeAt(0) for Android < 11 compatibility
The removeFirst() method from the Kotlin standard library is only available on
Android 11 (API 30) and above, or when running on a full Java 11+ runtime.
On older Android versions, this causes a NoSuchMethodError at runtime.
This commit replaces removeFirst() with removeAt(0), which provides the same
behavior and works correctly on all supported Android API levels (minSdk 21+).
No functional behavior changes have been made — only improved runtime
compatibility.
Copy file name to clipboardExpand all lines: packages/notifications/push/amplify_push_notifications/android/src/main/kotlin/com/amazonaws/amplify/amplify_push_notifications/PushNotificationEventsStreamHandler.kt
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -102,7 +102,7 @@ class PushNotificationEventsStreamHandler constructor(
102
102
try {
103
103
eventSink?.let {
104
104
while (eventQueue.isNotEmpty()) {
105
-
val eventFromQueue = eventQueue.removeFirst()
105
+
val eventFromQueue = eventQueue.removeAt(0)
106
106
// Check if it is an Error event and handle accordingly by using .error method
107
107
if (eventFromQueue.event.eventName ==NativeEvent.ERROR.eventName) {
0 commit comments