4

I have implemented ios Today extension(Widget) in flutter from xcode. What i need is to run the Flutter code when the widget is clicked. I can use Communication Channel in AppDelegate.m for that. But how can i use communication channel from controller of widget to fire event in flutter side?

umuieme
  • 729
  • 6
  • 20
  • 1
    I'm researching this as well. I'm afraid the answer might be, you can't. Today Extensions are not apps and the App Delegate code isn't fired when the Today Extension is used by the OS. B/c of this the Flutter client is not running when the today extension is. Nothing is stopping you from writing native code to handle the today extension and if the user opens your app from the extension triggers calls back into Flutter once the app launches, from App Delegate. I hope I'm wrong about this! – kev Oct 23 '18 at 17:28
  • See also, https://stackoverflow.com/questions/47870740/flutter-is-it-somehow-possible-to-create-app-widgets-android-and-today-extens – kev Oct 23 '18 at 17:32
  • Did you found anything regarding this? – Dhaval Kansara Jun 22 '20 at 08:25
  • there is no direct way but i implemented this with some work around using platform channel and deep linking. in short i open my app with custom scheme when user pressed the widget. Then use platform channel `FlutterBasicMessageChannel` to send that link to flutter side where i listened to that channel. Try if you understand, or i can later send a complete answer. I did not use any library for this as the deeplinking packages were not wroking then, maybe they will work now. – umuieme Jun 23 '20 at 05:08

0 Answers0