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
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//
// Generated file. Do not edit.
//

#ifndef GeneratedPluginRegistrant_h
#define GeneratedPluginRegistrant_h

#import <Flutter/Flutter.h>

NS_ASSUME_NONNULL_BEGIN

@interface GeneratedPluginRegistrant : NSObject
+ (void)registerWithRegistry:(NSObject<FlutterPluginRegistry>*)registry;
@end

NS_ASSUME_NONNULL_END

#endif /* GeneratedPluginRegistrant_h */
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//
// Generated file. Do not edit.
//

#import "GeneratedPluginRegistrant.h"

@import firebase_analytics_tvos;
@import firebase_core_tvos;

@implementation GeneratedPluginRegistrant

+ (void)registerWithRegistry:(NSObject<FlutterPluginRegistry>*)registry {
[FirebaseAnalyticsPlugin registerWithRegistrar:[registry registrarForPlugin:@"FirebaseAnalyticsPlugin"]];
[FLTFirebaseCorePlugin registerWithRegistrar:[registry registrarForPlugin:@"FLTFirebaseCorePlugin"]];
}

@end
26 changes: 26 additions & 0 deletions packages/firebase_crashlytics_tvos/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Dart / Flutter
.dart_tool/
build/
.flutter-plugins
.flutter-plugins-dependencies
.packages
.pub/

# CocoaPods
tvos/Pods/
tvos/Podfile.lock
tvos/.symlinks/
tvos/Flutter/Flutter.framework
tvos/Flutter/Flutter.podspec

# Xcode / SwiftPM (per-user, generated when tvos/Package.swift is opened)
**/.swiftpm/
**/xcuserdata/

# IDE
.idea/
.vscode/
*.iml

# macOS
.DS_Store
1 change: 1 addition & 0 deletions packages/firebase_crashlytics_tvos/.pubignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pubspec_overrides.yaml
9 changes: 9 additions & 0 deletions packages/firebase_crashlytics_tvos/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
## 0.0.1

* Initial tvOS (Apple TV) implementation of `firebase_crashlytics`, ported from
`firebase_crashlytics` 5.2.4 via `flutter-tvos plugin port` and finished by
hand (podspec `Firebase/Crashlytics` + `firebase_core_tvos` deps, tvOS 15.0
floor, `LIBRARY_NAME`/`LIBRARY_VERSION` defines, `firebase_core_tvos` imports,
Dart re-export).
* No tvOS feature disables — full Crashlytics API. Compiles + links + registers
on the tvOS simulator and device (arm64).
27 changes: 27 additions & 0 deletions packages/firebase_crashlytics_tvos/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Copyright 2019 The Chromium Authors. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
121 changes: 121 additions & 0 deletions packages/firebase_crashlytics_tvos/PORTING_REPORT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
# firebase_crashlytics_tvos — porting report

Generated by `flutter-tvos plugin port` on 2026-08-12.

Source: `firebase_crashlytics` 5.2.4 (Objective-C). Base platform: ios.
Output: `./firebase_crashlytics_tvos`

> ✅ No tvOS-incompatible APIs detected at type level — the generated package is expected to compile on tvOS (still review stubbed/partial items below).

## Summary

| Status | Count |
| ------------------------------- | ---------------------- |
| Methods ported as-is | 10 |
| Methods stubbed (iOS-only) | 0 |
| Native regions disabled on tvOS | 0 |
| tvOS build outlook | ✅ expected to compile |
| Manual review items | 0 |

## Methods

### `Crashlytics#checkForUnsentReports` ✓ ported

No tvOS-incompatible APIs detected in this handler. Copied across unchanged.

### `Crashlytics#crash` ✓ ported

No tvOS-incompatible APIs detected in this handler. Copied across unchanged.

### `Crashlytics#deleteUnsentReports` ✓ ported

No tvOS-incompatible APIs detected in this handler. Copied across unchanged.

### `Crashlytics#didCrashOnPreviousExecution` ✓ ported

No tvOS-incompatible APIs detected in this handler. Copied across unchanged.

### `Crashlytics#log` ✓ ported

No tvOS-incompatible APIs detected in this handler. Copied across unchanged.

### `Crashlytics#recordError` ✓ ported

No tvOS-incompatible APIs detected in this handler. Copied across unchanged.

### `Crashlytics#sendUnsentReports` ✓ ported

No tvOS-incompatible APIs detected in this handler. Copied across unchanged.

### `Crashlytics#setCrashlyticsCollectionEnabled` ✓ ported

No tvOS-incompatible APIs detected in this handler. Copied across unchanged.

### `Crashlytics#setCustomKey` ✓ ported

No tvOS-incompatible APIs detected in this handler. Copied across unchanged.

### `Crashlytics#setUserIdentifier` ✓ ported

No tvOS-incompatible APIs detected in this handler. Copied across unchanged.

## Imports removed

None. Every `import` in the source compiles on tvOS.

## Cross-platform Dart pruned

None. The source ships no Dart files for non-Apple platforms — nothing had to be removed.

## Disabled on tvOS

None. No type-level tvOS-incompatible API was found; nothing had to be compiled out.

## Manual review items

None flagged automatically. You should still skim `tvos/Classes/` — regex-based porting is best-effort and cannot catch every obfuscated API use.

## Checklist

- [x] Stubbed methods — **N/A**: none (Crashlytics has no tvOS-incompatible APIs).
- [x] Partial methods — **N/A**: none. Full API on tvOS.
- [x] Removed imports — **N/A**: none removed.
- [x] `flutter-tvos build tvos` compiles the generated registrant — **verified** (simulator + device arm64).
- [x] Version set (`0.0.1`) and `CHANGELOG.md` updated.

---

Manual review complete (2026-08-13) — see the addendum below for the applied fixes and verification.

## Addendum: manual fixes + verification (2026-08-13)

The auto-port compiled clean (10 methods ported as-is; no stubs, no
`#if !TARGET_OS_TV` disables; Crashlytics is UI-free — no UIKit/MetricKit).
Applied by hand:

- **Podspec:** depend on `Firebase/Crashlytics '~> 12.15.0'` + `firebase_core_tvos`
(not upstream `firebase_core`); tvOS 15.0 floor; `static_framework`; no
Flutter-CocoaPod dependency (Flutter via `FRAMEWORK_SEARCH_PATHS`); added the
`LIBRARY_NAME`/`LIBRARY_VERSION` `GCC_PREPROCESSOR_DEFINITIONS` the Obj-C
plugin token-pastes (`flutter-fire-cls-tvos`).
- **`<firebase_core/…>` imports** (in `FLTFirebaseCrashlyticsPlugin.m`/`.h`)
repointed to `<firebase_core_tvos/…>`, with the flat `#else` fallbacks changed
from angle-bracket to quoted imports.
- **`lib/firebase_crashlytics_tvos.dart`:** one-line re-export of
`package:firebase_crashlytics/firebase_crashlytics.dart` (method-channel-only
Dart API — duplicating it would create incompatible types). Copied Dart
(`src/`) removed.

**Version alignment:** matches `firebase_crashlytics 5.2.4` on the
`firebase_core_platform_interface` **7.1.0** train (`firebase_core 4.11.x`) —
the same train as `firebase_core_tvos`. Keep the whole Firebase stack on one
consistent FlutterFire release.

**Verified (runtime):** against a live Firebase project on **both** the tvOS
simulator and a **physical Apple TV 4K (tvOS 26.2, release/AOT)**.
`initializeApp(options:)` succeeds, `[Firebase/Crashlytics] 12.15.0` starts and
fetches settings from `…/platforms/tvos/gmp/<app-id>/settings`, and a forced
`FirebaseCrashlytics.instance.crash()` was **captured and reported to the
Crashlytics console** on both (uploaded to `crashlyticsreports-pa.googleapis.com`;
appeared as a crash issue). dSYM symbol upload for symbolicated device stacks is
the usual app-side build config (same as iOS).
41 changes: 41 additions & 0 deletions packages/firebase_crashlytics_tvos/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# firebase_crashlytics_tvos

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
> `PORTING_REPORT.md`.

## Usage

Federated plugin implementation — no imports needed from app code; it registers
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)
```

> **Version alignment matters.** This package's native code matches the
> `firebase_core_platform_interface` **7.1.0** train (`firebase_core 4.11.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).

## Status

| 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 |

All `firebase_crashlytics` APIs are available (no tvOS feature disables).
Crashes upload on the **next app launch** (not real-time) — force a crash,
relaunch, then check the Crashlytics console.

## License

fluttertv under a BSD-3-Clause license. See `LICENSE` for the full text.
7 changes: 7 additions & 0 deletions packages/firebase_crashlytics_tvos/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
include: package:flutter_lints/flutter.yaml

analyzer:
language:
strict-casts: true
strict-inference: true
strict-raw-types: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// PLACEHOLDER — replace by running `flutterfire configure` in this example dir.
//
// On tvOS, `defaultTargetPlatform == TargetPlatform.iOS`, so the `ios` entry
// below is what the Apple TV build uses — i.e. your existing iOS Firebase app's
// config is reused for tvOS.
//
// ignore_for_file: lines_longer_than_80_chars
import 'package:firebase_core/firebase_core.dart' show FirebaseOptions;
import 'package:flutter/foundation.dart'
show defaultTargetPlatform, kIsWeb, TargetPlatform;

class DefaultFirebaseOptions {
static FirebaseOptions get currentPlatform {
if (kIsWeb) {
throw UnsupportedError('This example targets Apple TV (tvOS) only.');
}
switch (defaultTargetPlatform) {
case TargetPlatform.iOS: // tvOS reports iOS
return ios;
default:
throw UnsupportedError('This example targets Apple TV (tvOS) only.');
}
}

// Replace with your real values — run `flutterfire configure`, or copy them
// from your iOS app's GoogleService-Info.plist / Firebase console.
static const FirebaseOptions ios = FirebaseOptions(
apiKey: 'REPLACE_ME',
appId: 'REPLACE_ME', // GOOGLE_APP_ID
messagingSenderId: 'REPLACE_ME', // GCM_SENDER_ID
projectId: 'REPLACE_ME',
storageBucket: 'REPLACE_ME',
iosBundleId: 'com.example.firebaseCrashlyticsExample',
);
}
Loading