deltachat / deltachat-ios

Email-based instant messaging for iOS.
GNU General Public License v3.0
310 stars 49 forks source link

adding webxdc to home screen stopped working #1880

Closed r10s closed 9 months ago

r10s commented 1 year ago

as there are no recent changes in the code, i suspect the iOS 16.4 update i did recently on my iphone14.

EDIT: yip, it seems to be a change in iOS, the same Delta Chat version can add shortcuts on iphoneSE1 with iOS 15.7.3

when using "Add to homescreen" from the webxdc's menu, the following error is shown in the browser (the browser is needed as we are creating a "mini pwa" as only they are allowed to exist on the homescreen - this needs an http-server during adding, see https://github.com/deltachat/deltachat-ios/pull/1665 - and that seems not to work)

r10s commented 1 year ago

the issue in upstream: https://github.com/httpswift/swifter/issues/537

it is a pity, that there seems to be no way to pass a data: url directly; in theory, the whole server part should not be needed at all :/

EDIT: found some hints that only long data:-urls do not work, tried with a smaller one (148 bytes base64), no chance, still the error Failed to open URL data:text/html;base64,PGh0bWw+CiAgICA8aGVhZD4KICAgICAgICA8dGl0bGU+Zm9vIGJhcjwvdGl0bGU+CiAgICA8L2hlYWQ+CiAgICA8Ym9keT4KIC ... bWw+Cg==: Error Domain=NSOSStatusErrorDomain Code=-10814 "(null)" UserInfo={_LSLine=244, _LSFunction=-[_LSDOpenClient openURL:fileHandle:options:completionHandler:]}

EDIT2: here is an alternative server dedicated to exactly the issue of opening data:-urls: https://github.com/HerrmDE/OpenBase64EncodedDataWithSafari - however, at a first glance this is not much different from the existing implementation, also, the project seems unmaintained.

r10s commented 11 months ago

from ios-dev chat:

SO question: https://stackoverflow.com/questions/77028005/create-a-shortcut-on-ios-homescreen-from-my-app-post-ios-16

idea is that we can tell users in a short tutorial how to use the shortcut app for this. like this app does it: https://apps.apple.com/app/apple-store/id1532875441 Basically tell user to copy a code (contains account & messageid) and then create a shortcut, open safari url and paste the link there, then add the shortcut to the homescreen. The coding (logic) work would be very minimal because we might be able to just use safari / standard open url action. The harder part is the design of the tutorial, since it only effects newer versions we could use swiftui or just a website in a webview if we think that would be easier.

hard to tell, if this is a doable approach, would need some research and a little proof-of-concept (the "tutorial" is a think, we can think over afterwards, also the existing approach is not that easy). the liked example does not really look good to me here, it is far too complicated

for the existing approach: would be interesting, if we the approach would work by using a "real" web server, sth. we do for invite.delta.chat if the server would just server a file, no data are processes (iirc, the approach as such is still okay, but the local server is blocked). privacy wise, that may not be worse than using apple shortcuts

Simon-Laux commented 11 months ago

privacy wise, that may not be worse than using apple shortcuts

if you don't share shortcuts I don't know what's bad for privacy in using them. But for convenience I agree, the Webserver could be a solution, but it means

So in essence the webserver approach would serve a custom PWA for the user that has a custom icon, so it is probably not possible or very hard to do this in a static website, I bet we need a dynamic site for that.

Benefits and downsides:

Webserver Shortcut tutorial
+ easy for users - more clicks for users
- need to be online to create the link + works offline
+ can use the app icon - user needs to create their own icon based on svg icons apple provides
- tech is complex (create dynamic pws, host/maintain a server) + easy implementation
- might stop working offline + will still work offline
- privacy policy entry needed + privacy policy entry not needed