React-Native: Webview Javascript-Injection not working as expected
<p><strong>What I want to do:</strong>
I make a fetch call, that gives me an API-token to login into a network. Now I want to inject a cookie (containing this api-token) into a Webview, so I should get logged in automatically.</p>

<p><strong>What I tried:</strong>
I set up a Webview like so:</p>

<pre><code>&lt;WebView
        source={{uri:this.state.url}}
        onNavigationStateChange={this._onNavigationStateChange.bind(this.url)}
        javaScriptEnabled = {true}
        injectedJavaScript={this.state.cookie}
      /&gt;
</code></pre>

<p>a little bit above I set cookie to:</p>

<pre><code>cookie: 'document.cookie=\'apiToken=xxx; userId=1; expires=28799\'';
</code></pre>

<p>Also I loaded <a href="https://chrome.google.com/webstore/detail/custom-javascript-for-web/poakhlngfciodnhlhhgnaaelnpjljija" rel="noreferrer">this chrome extension</a> and injected the above line in Chrome and it works flawlessly..</p>

<p>I've read that the javascript gets injected after the view loaded, but this should still work, since I get redirected to 'domain/login', which should detect the cookie..</p>

<p>(I'm running react-native 0.29)
Would appreciate any help.</p>