Skip to content

Commit e200791

Browse files
authored
Merge pull request #79 from talkjs/fix-ios-crash-for-real-this-time
Fix all iOS 26 crashes for real this time
2 parents 930b74a + 9e5dfa8 commit e200791

5 files changed

Lines changed: 20 additions & 6 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.17.5
2+
3+
- Fix crashes on iOS 26 when evaluating javascript before the WebView is loaded
4+
15
## 0.17.4
26

37
- Fix crash on iOS 26

lib/src/chatbox.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,9 @@ class ChatBoxState extends State<ChatBox> {
676676
print('📗 chatbox._onLoadStop _pending: $statement');
677677
}
678678

679-
controller.evaluateJavascript(source: statement);
679+
// This statemement without the `true;` at the end results in a build that crashes on iOS 26.2 when built using Xcode 26.2
680+
// Building on Xcode 26.1.1 and running on iOS 26.2 does not result in a crash.
681+
controller.evaluateJavascript(source: '$statement; true;');
680682
}
681683
}
682684
}

lib/src/conversationlist.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,9 @@ class ConversationListState extends State<ConversationList> {
316316
print('📗 conversationlist._onLoadStop _pending: $statement');
317317
}
318318

319-
controller.evaluateJavascript(source: statement);
319+
// This statemement without the `true;` at the end results in a build that crashes on iOS 26.2 when built using Xcode 26.2
320+
// Building on Xcode 26.1.1 and running on iOS 26.2 does not result in a crash.
321+
controller.evaluateJavascript(source: '$statement; true;');
320322
}
321323
}
322324
}

lib/src/session.dart

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,9 @@ class Session with ChangeNotifier {
8484
print('📗 session.me _pending: $statement');
8585
}
8686

87-
controller.evaluateJavascript(source: statement);
87+
// This statemement without the `true;` at the end results in a build that crashes on iOS 26.2 when built using Xcode 26.2
88+
// Building on Xcode 26.1.1 and running on iOS 26.2 does not result in a crash.
89+
controller.evaluateJavascript(source: '$statement; true;');
8890
}
8991

9092
_completer.complete();
@@ -202,7 +204,9 @@ class Session with ChangeNotifier {
202204
print('📗 session._onLoadStop _pending: $statement');
203205
}
204206

205-
controller.evaluateJavascript(source: statement);
207+
// This statemement without the `true;` at the end results in a build that crashes on iOS 26.2 when built using Xcode 26.2
208+
// Building on Xcode 26.1.1 and running on iOS 26.2 does not result in a crash.
209+
controller.evaluateJavascript(source: '$statement; true;');
206210
}
207211

208212
_completer.complete();
@@ -524,7 +528,9 @@ class Session with ChangeNotifier {
524528
print('📗 session.execute: $statement');
525529
}
526530

527-
controller!.evaluateJavascript(source: statement);
531+
// This statemement without the `true;` at the end results in a build that crashes on iOS 26.2 when built using Xcode 26.2
532+
// Building on Xcode 26.1.1 and running on iOS 26.2 does not result in a crash.
533+
controller!.evaluateJavascript(source: '$statement; true;');
528534
} else {
529535
if (kDebugMode) {
530536
print('📘 session.execute: $statement');

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.17.4
3+
version: 0.17.5
44
homepage: https://talkjs.com
55

66
environment:

0 commit comments

Comments
 (0)