apache / cordova-ios

Apache Cordova iOS
https://cordova.apache.org/
Apache License 2.0
2.15k stars 987 forks source link

Authorization Token doesn't persists on my iOS application and localStorage isn't Accessible #1280

Closed shivang-wal closed 1 year ago

shivang-wal commented 1 year ago

I have a React.js website converted to an iOS application using Cordova wrapper and I have LinkedIn integration, Whenever I log in with LinkedIn and swipe up the app, it redirects me to the homepage rather than my newsfeed page as it's not able to find the token.

What have I found

  1. I have seen that it redirects to localhost instead of my ec2 instance URL. Even if I send a redirection URL to localhost:8000, it doesn't work
  2. I have tried persistent storage but that doesn't work either

Please help me understand the issue and a resolution

breautek commented 1 year ago

Please use the issue template when creating your issue. There's not enough information provided.

I have seen that it redirects to localhost instead of my ec2 instance URL. Even if I send a redirection URL to localhost:8000

All I can say here is that your cordova webview should be using a local resource for a document. It can make API calls to external servers but the loaded HTML document should be a locally bundled resource. So redirecting to an EC2 instance URL doesn't seem correct here.

I have tried persistent storage but that doesn't work either

If by persistent storage, you mean the Web Storage (window.localStorage), that does work, so you'll need to explain the context of when it doesn't work. We may require a Sample Reproduction App.

I have a React.js website converted to an iOS application using Cordova wrapper and I have LinkedIn integration, Whenever I log in with LinkedIn and swipe up the app, it redirects me to the homepage rather than my newsfeed page as it's not able to find the token.

In general, this sounds more of a support kind of issue, and not a bug with cordova-ios. In which case a better place to ask a question would be in Cordova Discussions. But if you believe this is a bug with cordova-ios, then please create a new issue with the issue template filled.