Skip to content

Commit 376128d

Browse files
authored
Merge pull request #74 from talkjs/fix/xcode26.2_crash
(iOS) Fix memory corruption crash with Xcode 26.2
2 parents 278d34a + 9c8bce9 commit 376128d

7 files changed

Lines changed: 68 additions & 55 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 0.16.2
2+
3+
- Fix crash when building on Xcode 26.2 and deploying to iOS 26.2.
4+
- Fix audio waveform not getting generated until user interacts with the audio.
5+
16
## 0.16.1
27

38
- Update dependencies.
@@ -6,7 +11,7 @@
611

712
- **Breaking change:** Updated Firebase dependencies. This upgrades the Firebase iOS SDK version to `12.0.0` and the Firebase Android SDK version to `34.0.0`.
813

9-
As a result the `minSdkVersion` on Android is **API Level 23 (Android 6.0)** and the minimum iOS version supported is **iOS 15**. See the Firebase [Android](https://firebase.google.com/support/release-notes/android) and [iOS](https://firebase.google.com/support/release-notes/ios#version_1200_-_july_15_2025) release notes for more information
14+
As a result the `minSdkVersion` on Android is **API Level 23 (Android 6.0)** and the minimum iOS version supported is **iOS 15**. See the Firebase [Android](https://firebase.google.com/support/release-notes/android) and [iOS](https://firebase.google.com/support/release-notes/ios#version_1200_-_july_15_2025) release notes for more information
1015

1116
## 0.15.1
1217

example/push_notifications/ios/Podfile.lock

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
PODS:
2-
- Firebase/CoreOnly (12.0.0):
3-
- FirebaseCore (~> 12.0.0)
4-
- Firebase/Messaging (12.0.0):
2+
- Firebase/CoreOnly (12.6.0):
3+
- FirebaseCore (~> 12.6.0)
4+
- Firebase/Messaging (12.6.0):
55
- Firebase/CoreOnly
6-
- FirebaseMessaging (~> 12.0.0)
7-
- firebase_core (4.0.0):
8-
- Firebase/CoreOnly (= 12.0.0)
6+
- FirebaseMessaging (~> 12.6.0)
7+
- firebase_core (4.3.0):
8+
- Firebase/CoreOnly (= 12.6.0)
99
- Flutter
10-
- firebase_messaging (16.0.0):
11-
- Firebase/Messaging (= 12.0.0)
10+
- firebase_messaging (16.1.0):
11+
- Firebase/Messaging (= 12.6.0)
1212
- firebase_core
1313
- Flutter
14-
- FirebaseCore (12.0.0):
15-
- FirebaseCoreInternal (~> 12.0.0)
14+
- FirebaseCore (12.6.0):
15+
- FirebaseCoreInternal (~> 12.6.0)
1616
- GoogleUtilities/Environment (~> 8.1)
1717
- GoogleUtilities/Logger (~> 8.1)
18-
- FirebaseCoreInternal (12.0.0):
18+
- FirebaseCoreInternal (12.6.0):
1919
- "GoogleUtilities/NSData+zlib (~> 8.1)"
20-
- FirebaseInstallations (12.0.0):
21-
- FirebaseCore (~> 12.0.0)
20+
- FirebaseInstallations (12.6.0):
21+
- FirebaseCore (~> 12.6.0)
2222
- GoogleUtilities/Environment (~> 8.1)
2323
- GoogleUtilities/UserDefaults (~> 8.1)
2424
- PromisesObjC (~> 2.4)
25-
- FirebaseMessaging (12.0.0):
26-
- FirebaseCore (~> 12.0.0)
27-
- FirebaseInstallations (~> 12.0.0)
25+
- FirebaseMessaging (12.6.0):
26+
- FirebaseCore (~> 12.6.0)
27+
- FirebaseInstallations (~> 12.6.0)
2828
- GoogleDataTransport (~> 10.1)
2929
- GoogleUtilities/AppDelegateSwizzler (~> 8.1)
3030
- GoogleUtilities/Environment (~> 8.1)
@@ -130,14 +130,14 @@ EXTERNAL SOURCES:
130130
:path: ".symlinks/plugins/url_launcher_ios/ios"
131131

132132
SPEC CHECKSUMS:
133-
Firebase: 800d487043c0557d9faed71477a38d9aafb08a41
134-
firebase_core: 633e1851ffe1b9ab875f6467a4f574c79cef02e4
135-
firebase_messaging: d17feef781edc84ebefe62624fb384358ad96361
136-
FirebaseCore: 055f4ab117d5964158c833f3d5e7ec6d91648d4a
137-
FirebaseCoreInternal: dedc28e569a4be85f38f3d6af1070a2e12018d55
138-
FirebaseInstallations: d4c7c958f99c8860d7fcece786314ae790e2f988
139-
FirebaseMessaging: af49f8d7c0a3d2a017d9302c80946f45a7777dde
140-
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
133+
Firebase: a451a7b61536298fd5cbfe3a746fd40443a50679
134+
firebase_core: ba00a168e719694f38960502ceb560285603d073
135+
firebase_messaging: bf0e29321927edc02a563c984dbfa5b063864b15
136+
FirebaseCore: 0e38ad5d62d980a47a64b8e9301ffa311457be04
137+
FirebaseCoreInternal: 69bf1306a05b8ac43004f6cc1f804bb7b05b229e
138+
FirebaseInstallations: 631b38da2e11a83daa4bfb482f79d286a5dfa7ad
139+
FirebaseMessaging: a61bc42dcab3f7a346d94bbb54dab2c9435b18b2
140+
Flutter: cabc95a1d2626b1b06e7179b784ebcf0c0cde467
141141
flutter_apns_only: bd278c53433cb01cd66152843f7247fe10b9a9ea
142142
flutter_local_notifications: 395056b3175ba4f08480a7c5de30cd36d69827e4
143143
GoogleDataTransport: aae35b7ea0c09004c3797d53c8c41f66f219d6a7

example/push_notifications/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
buildConfiguration = "Debug"
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit"
2930
shouldUseLaunchSchemeArgsEnv = "YES">
3031
<MacroExpansion>
3132
<BuildableReference
@@ -43,11 +44,13 @@
4344
buildConfiguration = "Debug"
4445
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
4546
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
47+
customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit"
4648
launchStyle = "0"
4749
useCustomWorkingDirectory = "NO"
4850
ignoresPersistentStateOnLaunch = "NO"
4951
debugDocumentVersioning = "YES"
5052
debugServiceExtension = "internal"
53+
enableGPUValidationMode = "1"
5154
allowLocationSimulation = "YES">
5255
<BuildableProductRunnable
5356
runnableDebuggingMode = "0">

example/push_notifications/pubspec.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ packages:
555555
path: "../.."
556556
relative: true
557557
source: path
558-
version: "0.16.0"
558+
version: "0.16.2"
559559
talkjs_flutter_inappwebview:
560560
dependency: transitive
561561
description:

lib/src/chatbox.dart

Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ class ChatBoxState extends State<ChatBox> {
238238
239239
// Notify the backend of the UI's focus state
240240
setTimeout(() => chatBox.onWindowVisibleChanged(document.visibilityState === "visible"), 1000);
241-
});
241+
}); true;
242242
'''
243243
.trim());
244244
} else {
@@ -270,7 +270,7 @@ class ChatBoxState extends State<ChatBox> {
270270
chatBox.mount(document.getElementById("talkjs-container")).then(() => {
271271
// Notify the backend of the UI's focus state
272272
setTimeout(() => chatBox.onWindowVisibleChanged(document.visibilityState === "visible"), 1000);
273-
});
273+
}); true;
274274
'''
275275
.trim());
276276
}
@@ -282,11 +282,13 @@ class ChatBoxState extends State<ChatBox> {
282282
if (snapshot.connectionState == ConnectionState.done) {
283283
return InAppWebView(
284284
initialSettings: InAppWebViewSettings(
285-
useHybridComposition: true,
286-
disableInputAccessoryView: true,
287-
transparentBackground: true,
288-
useShouldOverrideUrlLoading: true,
289-
applicationNameForUserAgent: snapshot.data),
285+
useHybridComposition: true,
286+
disableInputAccessoryView: true,
287+
transparentBackground: true,
288+
useShouldOverrideUrlLoading: true,
289+
applicationNameForUserAgent: snapshot.data,
290+
mediaPlaybackRequiresUserGesture: false,
291+
),
290292
onWebViewCreated: _onWebViewCreated,
291293
onLoadStop: _onLoadStop,
292294
onConsoleMessage:
@@ -387,22 +389,24 @@ class ChatBoxState extends State<ChatBox> {
387389
translateConversations: widget.translateConversations,
388390
);
389391

390-
execute('chatBox = session.createChatbox(${_oldOptions});');
392+
// This statemement without the `true;` at the end results in a build that crashes on iOS 26.2 when built using Xcode 26.2
393+
// Building on Xcode 26.1.1 and running on iOS 26.2 does not result in a crash.
394+
execute('chatBox = session.createChatbox(${_oldOptions}); true;');
391395

392396
_setMessageFilter();
393397
_setHighlightedWords();
394398

395399
execute(
396-
'chatBox.onSendMessage((event) => window.flutter_inappwebview.callHandler("JSCSendMessage", JSON.stringify(event)));');
400+
'chatBox.onSendMessage((event) => window.flutter_inappwebview.callHandler("JSCSendMessage", JSON.stringify(event))); true;');
397401
execute(
398-
'chatBox.onTranslationToggled((event) => window.flutter_inappwebview.callHandler("JSCTranslationToggled", JSON.stringify(event)));');
402+
'chatBox.onTranslationToggled((event) => window.flutter_inappwebview.callHandler("JSCTranslationToggled", JSON.stringify(event))); true;');
399403

400404
if (widget.onCustomMessageAction != null) {
401405
_oldCustomMessageActions =
402406
Set<String>.of(widget.onCustomMessageAction!.keys);
403407
for (var action in _oldCustomMessageActions) {
404408
execute(
405-
'chatBox.onCustomMessageAction("$action", customMessageActionHandler);');
409+
'chatBox.onCustomMessageAction("$action", customMessageActionHandler); true;');
406410
}
407411
} else {
408412
_oldCustomMessageActions = {};
@@ -413,7 +417,7 @@ class ChatBoxState extends State<ChatBox> {
413417
Set<String>.of(widget.onCustomConversationAction!.keys);
414418
for (var action in _oldCustomConversationActions) {
415419
execute(
416-
'chatBox.onCustomConversationAction("$action", customConversationActionHandler);');
420+
'chatBox.onCustomConversationAction("$action", customConversationActionHandler); true;');
417421
}
418422
} else {
419423
_oldCustomConversationActions = {};
@@ -461,7 +465,7 @@ class ChatBoxState extends State<ChatBox> {
461465
_oldCustomMessageActions.add(action);
462466

463467
execute(
464-
'chatBox.onCustomMessageAction("$action", customMessageActionHandler);');
468+
'chatBox.onCustomMessageAction("$action", customMessageActionHandler); true;');
465469

466470
retval = true;
467471
}
@@ -493,7 +497,7 @@ class ChatBoxState extends State<ChatBox> {
493497
_oldCustomConversationActions.add(action);
494498

495499
execute(
496-
'chatBox.onCustomConversationAction("$action", customConversationActionHandler);');
500+
'chatBox.onCustomConversationAction("$action", customConversationActionHandler); true;');
497501

498502
retval = true;
499503
}
@@ -520,12 +524,12 @@ class ChatBoxState extends State<ChatBox> {
520524
_oldConversation = widget.conversation;
521525
if (_oldConversation != null) {
522526
execute(
523-
'chatBox.select(${getConversationVariableName(_oldConversation!)}, ${json.encode(result)});');
527+
'chatBox.select(${getConversationVariableName(_oldConversation!)}, ${json.encode(result)}); true;');
524528
} else {
525529
if (result.isNotEmpty) {
526-
execute('chatBox.select(undefined, ${json.encode(result)});');
530+
execute('chatBox.select(undefined, ${json.encode(result)}); true;');
527531
} else {
528-
execute('chatBox.select(undefined);');
532+
execute('chatBox.select(undefined); true;');
529533
}
530534
}
531535
}
@@ -546,7 +550,7 @@ class ChatBoxState extends State<ChatBox> {
546550
_oldHighlightedWords = List<String>.of(widget.highlightedWords);
547551

548552
execute(
549-
'chatBox.setHighlightedWords(${json.encode(_oldHighlightedWords)});');
553+
'chatBox.setHighlightedWords(${json.encode(_oldHighlightedWords)}); true;');
550554
}
551555

552556
bool _checkHighlightedWords() {
@@ -713,13 +717,14 @@ class ChatBoxState extends State<ChatBox> {
713717

714718
_users[user.id] = variableName;
715719

716-
execute('let $variableName = new Talk.User(${user.getJsonString()});');
720+
execute(
721+
'let $variableName = new Talk.User(${user.getJsonString()}); true;');
717722

718723
_userObjs[user.id] = User.of(user);
719724
} else if (_userObjs[user.id] != user) {
720725
final variableName = _users[user.id]!;
721726

722-
execute('$variableName = new Talk.User(${user.getJsonString()});');
727+
execute('$variableName = new Talk.User(${user.getJsonString()}); true;');
723728

724729
_userObjs[user.id] = User.of(user);
725730
}
@@ -735,7 +740,7 @@ class ChatBoxState extends State<ChatBox> {
735740
_conversations[conversation.id] = variableName;
736741

737742
execute(
738-
'let $variableName = session.getOrCreateConversation("${conversation.id}")');
743+
'let $variableName = session.getOrCreateConversation("${conversation.id}"); true;');
739744

740745
_setConversationAttributes(variableName, conversation);
741746
_setConversationParticipants(variableName, conversation);

lib/src/session.dart

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -262,18 +262,18 @@ class Session with ChangeNotifier {
262262
if (enable) {
263263
if (fcmToken != null) {
264264
statement =
265-
'session.setPushRegistration({provider: "fcm", pushRegistrationId: "$fcmToken"});';
265+
'session.setPushRegistration({provider: "fcm", pushRegistrationId: "$fcmToken"}); true;';
266266
} else if (apnsToken != null) {
267267
statement =
268-
'session.setPushRegistration({provider: "apns", pushRegistrationId: "$apnsToken"});';
268+
'session.setPushRegistration({provider: "apns", pushRegistrationId: "$apnsToken"}); true;';
269269
}
270270
} else {
271271
if (fcmToken != null) {
272272
statement =
273-
'session.unsetPushRegistration({provider: "fcm", pushRegistrationId: "$fcmToken"});';
273+
'session.unsetPushRegistration({provider: "fcm", pushRegistrationId: "$fcmToken"}); true;';
274274
} else if (apnsToken != null) {
275275
statement =
276-
'session.unsetPushRegistration({provider: "apns", pushRegistrationId: "$apnsToken"});';
276+
'session.unsetPushRegistration({provider: "apns", pushRegistrationId: "$apnsToken"}); true;';
277277
}
278278
}
279279

@@ -406,7 +406,7 @@ class Session with ChangeNotifier {
406406
_setOrUnsetPushRegistration(true);
407407
} else {
408408
_execute(
409-
'session.setPushRegistration({provider: "${provider!.name}", pushRegistrationId: "$pushRegistrationId"});');
409+
'session.setPushRegistration({provider: "${provider!.name}", pushRegistrationId: "$pushRegistrationId"}); true;');
410410
}
411411
}
412412

@@ -452,7 +452,7 @@ class Session with ChangeNotifier {
452452
_setOrUnsetPushRegistration(false);
453453
} else {
454454
_execute(
455-
'session.unsetPushRegistration({provider: "${provider!.name}", pushRegistrationId: "$pushRegistrationId"});');
455+
'session.unsetPushRegistration({provider: "${provider!.name}", pushRegistrationId: "$pushRegistrationId"}); true;');
456456
}
457457
}
458458

@@ -481,7 +481,7 @@ class Session with ChangeNotifier {
481481
print('📗 session clearPushRegistrations: Clearing push notifications');
482482
}
483483

484-
_execute('session.clearPushRegistrations();');
484+
_execute('session.clearPushRegistrations(); true;');
485485
}
486486

487487
/// For internal use only. Implementation detail that may change anytime.

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: talkjs_flutter
22
description: Official TalkJS SDK for Flutter
3-
version: 0.16.1
3+
version: 0.16.2
44
homepage: https://talkjs.com
55

66
environment:

0 commit comments

Comments
 (0)