1

An app I am working on needs a Today Extension / Widget. Are there any resources on how to build one into an Cordova app?

I found this, but it's not written very clearly and from what I understood seems to be a native app that only uses a HTML5 element in the app and widget to display some data :/

janpio
  • 10,645
  • 16
  • 64
  • 107

1 Answers1

9

Yes you are right, today extension are a native thing. I recently also did a lot of research on how to integrate one into a cordova project dynamically and ended up creating my own cordova-plugin for that. You can find it here, maybe it will be useful for you too! Nevertheless you will have to implement the widget in Swift.

The plugin takes an already developed widget and integrates it in an cordova-ios project on every cordova platform add ios using a hook which parses and modifies the project.pbxproj via the help of cordova-node-xcode.

David
  • 7,387
  • 3
  • 22
  • 39
  • Awesome! Thanks so much, will look into it if I get back to working on the widget stuff. – janpio Jun 01 '17 at 19:59
  • Hey, David! I'm currently work on this task (today extension in Cordova project). Is there any new possibilities or I have to do it in your way? – GeoSD Jan 08 '20 at 07:43
  • 1
    @GeoSD The only new possibility I know of is to do the whole project in [Capacitor](https://capacitor.ionicframework.com) if (kind of) leaving the Cordova ecosystem is an option for you. Its way more convenient this way because with Capacitor the source-code of the platform is in source-control and not regenerated all the time - so you don't have to do all the scripting stuff to add the widget to the native project. If this is not an option you can always use my plugin which is linked in my answer :) Cheers – David Jan 09 '20 at 15:47