[Feature] Make iOS firebase dependency optional
I maintainer di solito rispondono entro 2 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 42/100
Direzione di ricerca
Start with packages/stream_video_push_notification/lib/src/stream_video_push_provider.dart, especially the Firebase use around the line linked in the issue, and compare the iOS token-retrieval approach in stream-video-swift. The issue outlines several possible solutions, but choosing among them and avoiding iOS Firebase dependencies while preserving Android behavior requires design and platform-specific investigation. Done means the chosen approach makes Firebase optional for iOS without breaking APNs registration or Android push notifications.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
When using StreamVideoPushProvider.apn for iosPushProvider, technically the firebase SDK would not be needed.
Pulling in the Firebase dependency on iOS has the following downsides:
- app binary size increases by 13.6MB. Thats almost 20% for my app, and it basically doubles the advertised required size for the Stream Video Flutter SDK (ios:stream_video + ios:stream_video_flutter + stream_video_push_notification = ~11.9MB, according to https://github.com/GetStream/stream-video-flutter/blob/main/README.md )
- data is sent to Google unnecessarily (data minimization, data privacy issue)
- stream_video_flutter requires iOS 14, firebase_core iOS 15. Not a big issue currently, as every iOS 14 device can upgrade to 15. But in the future, firebase_core could dictate a minimum supported iOS version that would exclude some older devices that otherwise would be compatible with stream_video_flutter
Context
The stream_video_push_notification package currently only uses firebase in one place on iOS:
https://github.com/GetStream/stream-video-flutter/blob/dfcaffbc07e4a8c494d1c5c733ebc8079d9455bc/packages/stream_video_push_notification/lib/src/stream_video_push_provider.dart#L88
This is only needed if StreamVideoPushNotificationManager.registerApnDeviceToken is set to true to enable missed call notifications. (It’s currently also called in an unneeded case, see https://github.com/GetStream/stream-video-flutter/issues/1428)
This could easily be moved to a native swift implementation (the voip-token retrieval already is in swift) and make the iOS platform package free of the firebase dependency.
However, because the stream_video_push_notification still needs the firebase_core and firebase_messaging packages for Android, an iOS build still would pull in the entire native firebase_messaging SDK for iOS.
Possible Solutions
Solution A
Adding an apnTokenProvider param to StreamVideoPushNotificationManager.create and use it with a push token already present from another SDK (eg. push or OneSignal SDK).
I’ve implemented and tested that here and can send a PR for it: https://github.com/bbjay/stream-video-flutter/pull/1
(this also includes a fix for https://github.com/GetStream/stream-video-flutter/issues/1428, which otherwise would produce an error)
To get rid of the native firebase_messaging SDK for iOS, I’ve made an android-only flutterfire fork which does not pull in any native ios dependecies and use it with dependency_overrides:
https://github.com/bbjay/flutterfire/tree/android-only
and its diff:
https://github.com/bbjay/flutterfire/pull/1/changes
The fork only changed a few lines in pubspec.yaml and should be easily maintainable.
Solution B
getAPNToken() backed by a native swift implementation (copy it form stream-video-swift, which also does not have a firebase dependency)
This would still need the android-only flutterfire fork.
Solution C
Getting rid of the flutter firebase package dependency entirely in stream_video_push_notification does seem like a non-trivial task. It would involve moving the firebase dependency to the android native side (build.gradle), handle events there and forward them to the flutter side.
- Lingua principale
- Dart
- Stelle
- 79
- Fork
- 55
- Merge medio
- 2g 11h
- PR unite (30g)
- 143
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di GetStream/stream-video-flutter
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
GetStream/stream-video-flutter#1535 · 2 commenti ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
GetStream/stream-video-flutter#1293 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
documentation
Difficoltà 4/5 3-5 giorni Idoneità per principianti 38/100
GetStream/stream-video-flutter#1066 · 8 commenti · 1 reazione ·
I maintainer di solito rispondono entro 2 giorni
-
enhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
GetStream/stream-video-flutter#1047 · 4 commenti ·
I maintainer di solito rispondono entro 2 giorni
-
enhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
GetStream/stream-video-flutter#1036 ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di GetStream/stream-video-flutter
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
bggRGjQaUbCoE/PiliPlus#3522 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
ccch1mneyyy/dsh-Go#731 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement good first issue help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100