5

I am currently working on a project where I need to load the user in a webview, in the same time I'm injecting a javascript code to check if tokens expired. Everything works till here, I am getting a message back from the webview that we need to refresh but I cannot figure out how I can inject javascript on runtime in the webview. I am using at the moment this module: https://github.com/alinz/react-native-webview-bridge.

Is there a way how to make this flow working? So like this the tokens will not expire if the user is using the application.

2
  • I did managed to make it work, ill post soon my repo with my result. Commented Sep 20, 2016 at 11:27
  • How did you make it work? Thanks! Commented Oct 26, 2017 at 14:01

1 Answer 1

1

Can't you just insert a new script element into the page's body?

Perhaps something like the answer to this question: Adding <script> element to the DOM and have the javascript run?

Sign up to request clarification or add additional context in comments.

1 Comment

I don't think this can help in my project as I need to receive a new token in my react-native app in the runtime.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.