talkjs / talkjs-flutter

Flutter SDK for the TalkJS Chat API
https://talkjs.com
BSD 3-Clause "New" or "Revised" License
9 stars 14 forks source link

talkjs lib broke Firebase lib on iOS #22

Closed zSoNz closed 1 year ago

zSoNz commented 1 year ago

After instilling talkjs lib, Firebase lib starts throwing this error on Firebase.initializeApp:

PlatformException(channel-error, Unable to establish connection on channel., null, null)

Here dependencies from my pubspec.yaml:

firebase_core: ^2.3.0 talkjs_flutter: ^0.6.0

vickz84259 commented 1 year ago

Hey there, we don't use Firebase on iOS. So you need to ensure that Firebase.initializeApp is only called on Android, unless you use Firebase on your app for other things other than push notifications. Here's a link to our docs on how to have push notifications setup.

zSoNz commented 1 year ago

@vickz84259 , yeah but my team are using Firebase for other purposes, and this lib totally broke it because we don’t have opportunity to initialise Firebase app with Firebase.initializeApp function. So please fix it.

vickz84259 commented 1 year ago

Can you confirm if you have the flutter_apns.disable_swizzling key in your info.plist? If you don't follow the step outlined here.

If you are still experiencing the issue regardless, do let me know.

zSoNz commented 1 year ago

@vickz84259 , but if I wanna use Firebase apns lib for my project?

zSoNz commented 1 year ago

I think you really need to move your notification lib to another repo, so any who want to use it, can integrate it separately.

zSoNz commented 1 year ago

Anyway. I fix this issue here #23, please merge it. Rn I'm gonna use my fork instead.

vickz84259 commented 1 year ago

@vickz84259 , but if I wanna use Firebase apns lib for my project?

You should be able to do so. Our SDK shouldn't interfere with your Firebase usage whatsoever.

I think you really need to move your notification lib to another repo, so any who want to use it, can integrate it separately.

Push notifications on TalkJS is an entirely opt in feature. Dart/Flutter does not support optional dependencies hence the need to have flutter_apns_only as a transitive dependency despite push notification being an optional feature.

If you would like to rely on your own implementation of push notifications via webhooks from TalkJS, you can do so. Just make sure you don't enable push notifications for your user's Sessions and also don't call Talk.registerPushNotificationHandlers.

zSoNz commented 1 year ago

@vickz84259 , but if I wanna use Firebase apns lib for my project?

You should be able to do so. Our SDK shouldn't interfere with your Firebase usage whatsoever.

I think you really need to move your notification lib to another repo, so any who want to use it, can integrate it separately.

Push notifications on TalkJS is an entirely opt in feature. Dart/Flutter does not support optional dependencies hence the need to have flutter_apns_only as a transitive dependency despite push notification being an optional feature.

If you would like to rely on your own implementation of push notifications via webhooks from TalkJS, you can do so. Just make sure you don't enable push notifications for your user's Sessions and also don't call Talk.registerPushNotificationHandlers.

Okay, sounds logical!

vickz84259 commented 1 year ago

23 has been merged. I'll be making a release for this later today.