Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions packages/firebase_crashlytics_tvos/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
## 0.0.2

* Re-ported from `firebase_crashlytics` 5.3.0 (Swift + Pigeon). With 0.0.1,
every call failed with `channel-error` on 5.3.0.
* `pluginClass` is now `FirebaseCrashlyticsPlugin`.
* Requires `firebase_crashlytics` `^5.3.0` and `firebase_core_tvos` `^0.0.3`.
* Registers with Firebase as upstream's `flutter-fire-cls` instead of
`flutter-fire-cls-tvos`, like the other Swift ports.

## 0.0.1

* Initial tvOS (Apple TV) implementation of `firebase_crashlytics`, ported from
Expand Down
16 changes: 16 additions & 0 deletions packages/firebase_crashlytics_tvos/PORTING_REPORT.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,19 @@ produced.
**Crash-capture limits.** Per `FIRCLSFeatures.h`, tvOS captures ordinary crashes
(signal + `NSException` handlers) but has no alternate signal stack
(stack-overflow may be missed) and no Mach exception server.

## 0.0.2: re-port to firebase_crashlytics 5.3.0

5.3.0 moved the Apple plugin to Swift + Pigeon, so 0.0.1's MethodChannel
handler was never reached (`channel-error` on every call). `Classes/` is now
upstream 5.3.0's `ios/firebase_crashlytics/Sources/`, verbatim except:

- `FirebaseCrashlyticsPlugin.swift`: imports `firebase_core_tvos`; the
`registrar.messenger()` branch also covers `os(tvOS)`.
- `FirebaseCrashlyticsMessages.g.swift`: `import Flutter` also covers `os(tvOS)`.
- Upstream's Swift and ObjC SPM targets are one pod (`DEFINES_MODULE`).
- Podspec: `Firebase/Crashlytics ~> 12.15.0` to match `firebase_core_tvos`
(upstream uses 12.18.0).

**Verified** on the tvOS 27.0 simulator: every API call returns, and a forced
`crash()` is detected on relaunch. Not yet checked on a physical Apple TV.
17 changes: 9 additions & 8 deletions packages/firebase_crashlytics_tvos/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
The tvOS implementation of [`firebase_crashlytics`](https://pub.dev/packages/firebase_crashlytics).

> Ported with [`flutter-tvos plugin port`](https://github.com/fluttertv/flutter-tvos)
> from `firebase_crashlytics` 5.2.4, then finished + verified by hand. See
> from `firebase_crashlytics` 5.3.0 (Swift + Pigeon), then finished + verified by hand. See
> `PORTING_REPORT.md`.

## Usage
Expand All @@ -13,14 +13,15 @@ automatically. Apps that already use `firebase_crashlytics` and target tvOS add:

```yaml
dependencies:
firebase_crashlytics: ^5.2.4
firebase_crashlytics_tvos: ^0.0.1
firebase_core: ^4.11.0
firebase_core_tvos: ^0.0.1 # tvOS core (this package depends on it)
firebase_crashlytics: ^5.3.0
firebase_crashlytics_tvos: ^0.0.2
firebase_core: ^4.14.0
firebase_core_tvos: ^0.0.3 # tvOS core (this package depends on it)
```

> **Version alignment matters.** This package's native code matches the
> `firebase_core_platform_interface` **7.1.0** train (`firebase_core 4.11.x`).
> `firebase_core_platform_interface` **8.1.1** train (`firebase_core 4.14.x`).
> Use 0.0.2 with `firebase_crashlytics` 5.3.0+, 0.0.1 with 5.2.x.
> Keep your whole Firebase stack on one consistent FlutterFire release, or Dart
> `initializeApp(options:)` can crash in `CoreFirebaseOptions.fromList` at launch
> (a `FirebaseOptions` field-count mismatch).
Expand All @@ -29,8 +30,8 @@ dependencies:

| Platform | Implemented | Verified |
| --------------------------------------- | ----------- | ----------------------------------------------------------- |
| Apple TV (`appletvos`) | yes | ✅ **runtime-verified on a physical Apple TV 4K (release/AOT)** — a forced `crash()` was captured and reported to the Crashlytics console |
| Apple TV simulator (`appletvsimulator`) | yes | ✅ runtime-verified — crash reported to the console |
| Apple TV (`appletvos`) | yes | 0.0.1: crash reported to the console. 0.0.2: not yet run |
| Apple TV simulator (`appletvsimulator`) | yes | ✅ 0.0.2: all calls work, crash detected on relaunch |

All `firebase_crashlytics` Dart APIs work on tvOS. Ordinary crashes are captured
(signal + `NSException` handlers), but tvOS has no alternate signal stack, so
Expand Down
8 changes: 4 additions & 4 deletions packages/firebase_crashlytics_tvos/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ environment:

dependencies:
# firebase_core is pinned exact; its train picks the matching firebase_core_tvos
# (4.11.x -> pi 7.1.0 -> 0.0.2); floating it breaks the native Pigeon ABI.
firebase_core: 4.11.0
firebase_crashlytics: 5.2.4
# (4.14.x -> pi 8.1.1 -> 0.0.3); floating it breaks the native Pigeon ABI.
firebase_core: 4.14.0
firebase_crashlytics: 5.3.0
firebase_crashlytics_tvos:
path: ../
firebase_core_tvos: ^0.0.1
firebase_core_tvos: ^0.0.3
flutter:
sdk: flutter

Expand Down
12 changes: 8 additions & 4 deletions packages/firebase_crashlytics_tvos/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: firebase_crashlytics_tvos
description: >-
tvOS (Apple TV) implementation of the firebase_crashlytics Flutter plugin,
providing Firebase Crashlytics crash reporting on Apple TV.
version: 0.0.1
version: 0.0.2
homepage: https://fluttertv.dev
repository: https://github.com/fluttertv/plugins/tree/main/packages/firebase_crashlytics_tvos
issue_tracker: https://github.com/fluttertv/plugins/issues
Expand All @@ -16,13 +16,17 @@ environment:
dependencies:
flutter:
sdk: flutter
firebase_crashlytics: ^5.2.4
# tvos/Classes/*.g.swift is generated against 5.3.0. 5.4.0 ships the same
# native sources apart from versionNumber. 6.0.0 needs firebase_core 5.x,
# which firebase_core_tvos doesn't support yet.
firebase_crashlytics: ^5.3.0
# Transitive Dart dependency so the app's dependency graph includes
# firebase_core_tvos — plugin discovery (tvos_plugins.dart) only adds a
# package's native pod to the generated Podfile if it's reachable here,
# which the podspec's `s.dependency 'firebase_core_tvos'` then resolves
# instead of failing over to upstream's iOS-only firebase_core pod.
firebase_core_tvos: ^0.0.1
# 0.0.3+ matches the platform interface 8.1.1 that 5.3.0 needs.
firebase_core_tvos: ^0.0.3

dev_dependencies:
flutter_lints: ^4.0.0
Expand All @@ -33,4 +37,4 @@ flutter:
plugin:
platforms:
tvos:
pluginClass: FLTFirebaseCrashlyticsPlugin
pluginClass: FirebaseCrashlyticsPlugin
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// Copyright 2026 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

/// Auto-generated file. Do not edit.
public let versionNumber = "5.3.0"
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* Copyright 2026 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#import "CrashlyticsPlatformHelpers.h"
#import "Crashlytics_Platform.h"
#import "ExceptionModel_Platform.h"

@implementation CrashlyticsPlatformHelpers

+ (void)setDevelopmentPlatformName:(NSString *)name version:(NSString *)version {
FIRCrashlytics *crashlytics = [FIRCrashlytics crashlytics];
crashlytics.developmentPlatformName = name;
crashlytics.developmentPlatformVersion = version;
}

+ (void)recordExceptionModel:(FIRExceptionModel *)exception fatal:(BOOL)fatal {
exception.onDemand = YES;
exception.isFatal = fatal;
if (fatal) {
[[FIRCrashlytics crashlytics] recordOnDemandExceptionModel:exception];
} else {
[[FIRCrashlytics crashlytics] recordExceptionModel:exception];
}
}

@end
Loading
Loading