outline-apps icon indicating copy to clipboard operation
outline-apps copied to clipboard

Could I get localStorage data in swift ?

Open suki-neithnet opened this issue 2 years ago • 7 comments

I need to read dynamic data from webview in swift before the vpn start connection. So I wonder know is there any ways to read data from localstorage.

suki-neithnet avatar Feb 01 '24 07:02 suki-neithnet

I think you can set something up where you send the info you need over IPC. https://github.com/Jigsaw-Code/outline-client/blob/6356371797cf882a9472f8be4aa9f8c7bbfb3d21/src/www/app/cordova_main.ts#L52-L53

daniellacosse avatar Feb 12 '24 20:02 daniellacosse

Sorry but I have no idea how to do with these, could you please show me a simple sample if could? Thank you very much. I need to read localstorage data in OutlineAppleLib/Sources/OutlineTunnel/OutlineVpn.swift or OutlineAppleLib/Sources/OutlineTunnel/OutlineTunnel.swift

suki-neithnet avatar Feb 16 '24 05:02 suki-neithnet

What's your goal?

daniellacosse avatar Feb 16 '24 19:02 daniellacosse

What's your goal?

I need to get different settings info by user while setup vpn every time before connect.

suki-neithnet avatar Feb 19 '24 02:02 suki-neithnet

What's your goal?

I need to get different settings info by user while setup vpn every time before connect.

But what are the settings for? Can you not do it in the web view?

daniellacosse avatar Feb 21 '24 18:02 daniellacosse

What's your goal?

I need to get different settings info by user while setup vpn every time before connect.

But what are the settings for? Can you not do it in the web view?

Well, I want to set includedRoutes and excludedRoutes or dnsSettings for different users, so I think maybe I could only get the info dynamically and set it up while every time we setup vpn.

suki-neithnet avatar Feb 22 '24 01:02 suki-neithnet

What's your goal?

I need to get different settings info by user while setup vpn every time before connect.

But what are the settings for? Can you not do it in the web view?

Well, I want to set includedRoutes and excludedRoutes or dnsSettings for different users, so I think maybe I could only get the info dynamically and set it up while every time we setup vpn.

You might be able to do this through the dynamic key maybe? https://www.reddit.com/r/outlinevpn/wiki/index/dynamic_access_keys/

Then you'll need to write a plugin (or extend the existing one): https://cordova.apache.org/docs/en/11.x/guide/platforms/ios/plugin.html

daniellacosse avatar Feb 23 '24 17:02 daniellacosse