team-telnyx / flutter-voice-sdk

Telnyx Flutter WebRTC SDK - Enable real-time communication with WebRTC and Telnyx
MIT License
12 stars 5 forks source link

Notifications #8

Closed hpsolver closed 2 years ago

Oliver-Zimmerman commented 2 years ago

There is no description. If this is a bug, please use the provided bug template. If it is a feature enhancement, please be more detailed.

Flutter-specific push notifications are something we plan on working on in the future. For now, though you can do the following on your own app:

Follow this guide for setting up Android Push Notifications: https://developers.telnyx.com/docs/v2/webrtc/push-notifications?lang=android

When you log in, send the 'android' platform type. (regardless of platform).

Use this library: https://pub.dev/packages/firebase_messaging

to implement push notifications and follow this guide to handle messages from the background: https://firebase.google.com/docs/cloud-messaging/flutter/receive

When a message is received and accept is clicked, implement a mechanism that logs you back in and auto accepts the call.

hpsolver commented 2 years ago

Yeah i have already followed this approach but it didn’t works for ios.

Oliver-Zimmerman commented 2 years ago

You will need to fork the library and change this line to always send android, regardless of platform: https://github.com/team-telnyx/telnyx-webrtc-flutter/blob/d5d3a76e48d1d4091c91375b5cd20a1b320342fa/packages/telnyx_webrtc/lib/telnyx_client.dart#L152

if that line isn't android, it won't use firebase

hpsolver commented 2 years ago

ok after that i will be able to receive callkit notification in ios right ?

Oliver-Zimmerman commented 2 years ago

No, you will still receive a firebase notification in this case. If you want to get callkit notifications then you still need to send iOS (as is), BUT implement this library instead: https://pub.dev/packages/flutter_ios_voip_kit

However you will then need to do platform-specific implementations for push notifications depending on the the platform (Android receiving Firebase, iOS sending callkit).

If you decide to do this route, then you will need to do the iOS setup here: https://developers.telnyx.com/docs/v2/webrtc/push-notifications?lang=ios

hpsolver commented 2 years ago

ok thanks @Oliver-Zimmerman

Oliver-Zimmerman commented 2 years ago

@hpsolver did you make progress here? There was a backend issue that has since been resolved for iOS specified for both the iOS and Flutter SDKs as described here: https://github.com/team-telnyx/telnyx-webrtc-ios/issues/70