Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

This Browser is not supported in iOS simulator

I am getting an error in react-native, This Browser is not supported, in the iOS simulator, after running the following code:

const firebase = require('firebase')
const firebaseConfig = require('./firebase-config')
firebase.initializeApp(firebaseConfig)

firebase.database().ref('test').set('hello')

firebase-config contains a databaseURL.

why?

like image 469
wildeyes Avatar asked May 28 '16 14:05

wildeyes


People also ask

Can I install Chrome on iOS simulator?

No, you can't install apps into the iOS simulator except for an app you can actually build in Xcode. Use a real iOS device to test using different browsers.

Do I need Xcode for iOS simulator?

Launching the Simulator, though, always requires opening Xcode and going to Developer Tools. Because the Simulator. app is embedded within the Xcode app bundle, apps like LaunchBar won't find it to index it.


2 Answers

Firebaser here

The new Firebase Authentication currently doesn't work in React Native due to a dependency on the window object. We're looking if that's something we can improve, but no guarantees.

From Jacob's post on the firebase-talk list:

As a "workaround" if you don't need auth (unlikely, I know, but still worth mentioning), you should be able to do the following:

var app = require('firebase/app');
var database = require('firebase/database');
like image 180
Frank van Puffelen Avatar answered Oct 16 '22 15:10

Frank van Puffelen


Apparently, the new Firebase Javascript client library depends on localStorage, and thus fails to start in some cases, such as Safari in Private Browsing Mode.

As a workaround, I uploaded a patched version of the new client library to github: https://github.com/urish/firebase-localstorage-fix/blob/master/firebase.js

I do hope that the team will fix this issue soon, but in the meantime the patched version does the trick for me.

like image 23
urish Avatar answered Oct 16 '22 15:10

urish