Web App iframe

Gabria year ago

hello, i'm developing a hybrid app with ionic react to use on ios and i wanna embed an iframe into it for the traccar web app, i created my token and am using it in the url. The server is deployed to my website. When i test the app on my local computer in the browser all works as expected, but when i deploy it to my iphone i always get redirected to the login page. Any suggestions? Thank you!

iframe:

<iframe
        title='traccar'
        src='https://mysite.com/?token=myaccesstoken'
      />

error:

[Error] Failed to load resource: the server responded with a status of 404 (Not Found) https://mysite.com/api/session
Anton Tananaeva year ago

In modern browsers cookies don't work properly in iframe, so that's why you have this issue.

Anton Tananaeva year ago

This seems to be the relevant information:

https://stackoverflow.com/a/45095345/2548565

Rodrika year ago

Hi Gabri,

Which page and how are you embedding the iFrame? I have ip cam want to add on map page
I assume need too add also js lines too, to link to specific user.

Thank you

Gabria year ago

@Anton thanks i'll check it out!

@Rodrik i'm just using the iframe code i posted in my first message, i guess to link users you'd need different access tokens that you create in Settings/Preferences. the mysite.com is just where you have your webapp, so for example if you bought a subscription here that would be server.traccar.org.

See permission Ionic for redirect URLS.