After getting a first impression by the raywenderlich tutorial how all the Today Extension stuff natively works (Extensions are basically small, independent apps that are embedded into the main app) I looked at “html5 based widget” post and app again:
Now this makes more sense:
The author built a Swift app that uses a WebView (not Cordova!) to display an Ionic 1 app (from /www). He also has a Today Extension that displays a Ionic 1 app in a WebView. To make the Ionic 1 files accessible he has to copy it in a build step of the Extension. (And he did a lot of unrelated things with notifications and share extension that I don’t care about right now. Also the chart he is using seems to break Ionic header and footer a bit…)
Making the project work with current XCode needs some kind of conversion (I think he used an earlier Swift version…) but it actually runs on the simulator. The app works and the today extension actually displays the widget.html with the charts!
Problem is: It doesn’t work on my real test device! There I only get a black rectangle instead of the white webview showing the page.
I opened an issue with the project on GitHub, asking the author if he actually tried it on a real device and not only a simulator back when he wrote the post.
Today Extensions seem to be really ‘light’ in that they get killed and mangled very fast when they use too much (>16 MB!) memory which causes all kind of funny behaviour or “Unable to Load” messages. Also they seem to be “a bit” hard to debug as there is no console output from them. Doesn’t help that I have no idea about XCode in the first place.