CommandersAct / iOSV5

Other
7 stars 2 forks source link

SFSafariViewController and consent forwarding. #14

Open mseriukov opened 9 months ago

mseriukov commented 9 months ago

Is it currently possible to forward consent into the SFSafariViewController?

ahakimsaid commented 9 months ago

Hello,

If you want a way to export your consent to a webview, you can use the following method :

https://github.com/CommandersAct/iOSV5/tree/master/TCConsent#forwarding-consent-to-webviews

mseriukov commented 9 months ago

If you want a way to export your consent to a webview, you can use the following method :

Yes, but it seems it can only be done for WKWebviews. The question is if it is possible for the SFSafariViewController.

ahakimsaid commented 9 months ago

The SDK delivers the consent in a simple string json format, which should be compatible with any kind of browser or webview.

mseriukov commented 9 months ago

The SDK delivers the consent in a simple string json format, which should be compatible with any kind of browser or webview.

For this json to be useful it should be injected into the local storage of the webview and it seems that SFSafariViewController doesn't support it. So my conclusion is that consent forwarding just can't be used with the SFSafariViewController. Is it right?

CommandersAct commented 9 months ago

Is there no other way to store anything in this browser? The only important thing is that your web consent can read what you stored inside your browser.

Otherwise send everything inside the url that is called when opening the webview and get them back in the web consent code.

mseriukov commented 9 months ago

Is there no other way to store anything in this browser?

No, it seems there isn't.

Otherwise send everything inside the url that is called when opening the webview and get them back in the web consent code.

This could work, I'll try it, thank you.

mseriukov commented 9 months ago

No, unfortunately it won't work as there is no way to inject JS code into the SFSafariViewController.

CommandersAct commented 9 months ago

But if there is no JS you won't have any of our web consent inside the webview right? So if it's only to get the categories, indeed the URL should do the trick.

mseriukov commented 9 months ago

But if there is no JS you won't have any of our web consent inside the webview right?

There is JS on the page. I mean that with SFSafariViewController we can't modify the page from the app by injecting the consent hiding JS. So I guess either this consent hiding JS should be part of the original page and consent data would be in the query or we should switch to WKWebView which supports both local storage and JS injection.