{"action":"created","issue":{"url":"https://api.github.com/repos/fullstackreact/react-native-firestack/issues/153","repository_url":"https://api.github.com/repos/fullstackreact/react-native-firestack","labels_url":"https://api.github.com/repos/fullstackreact/react-native-firestack/issues/153/labels{/name}","comments_url":"https://api.github.com/repos/fullstackreact/react-native-firestack/issues/153/comments","events_url":"https://api.github.com/repos/fullstackreact/react-native-firestack/issues/153/events","html_url":"https://github.com/fullstackreact/react-native-firestack/issues/153","id":190724693,"number":153,"title":"persisting auth state in salakar's branch - refresh necessary to get correct auth state","user":{"login":"florianbepunkt","id":8314202,"avatar_url":"https://avatars.githubusercontent.com/u/8314202?v=3","gravatar_id":"","url":"https://api.github.com/users/florianbepunkt","html_url":"https://github.com/florianbepunkt","followers_url":"https://api.github.com/users/florianbepunkt/followers","following_url":"https://api.github.com/users/florianbepunkt/following{/other_user}","gists_url":"https://api.github.com/users/florianbepunkt/gists{/gist_id}","starred_url":"https://api.github.com/users/florianbepunkt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/florianbepunkt/subscriptions","organizations_url":"https://api.github.com/users/florianbepunkt/orgs","repos_url":"https://api.github.com/users/florianbepunkt/repos","events_url":"https://api.github.com/users/florianbepunkt/events{/privacy}","received_events_url":"https://api.github.com/users/florianbepunkt/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":35,"created_at":"2016-11-21T14:01:05Z","updated_at":"2016-11-23T17:11:28Z","closed_at":"2016-11-22T12:13:03Z","body":"With Salakar's fork I noticed following behaviour which might be a bug or something intentional:\r\n\r\nI have a fresh react-native project on iOS (simulator). in my index.ios I have a login function and an auth state listener (see below).\r\n\r\nLogin works fine and auth state listener triggers. When I now exit the app in simulator and reopen it again user is not loggedin (state.user is null). However when I hit Command + R to refresh, user is logged in.\r\n\r\nExspected behaviour: User would be loggedin when reopening the app without the need of additional refresh.\r\n\r\n```\r\ncomponentDidMount() {\r\n    this.unsubscribe = firestack.auth().onAuthStateChanged((user) => {\r\n      if (user) {\r\n        Alert.alert('loggedin');\r\n        // User is signed in.\r\n        this.setState({user});\r\n      }\r\n      else {\r\n        // use is not signed in\r\n        this.setState({user: ''});\r\n      }\r\n    });\r\n  }\r\n```\r\n\r\n```\r\nlogin() {\r\n    console.log('login func called');\r\n    firestack.auth().signInWithEmailAndPassword('mail@florian-bischoff.de', '123456')\r\n      .then((user) => {\r\n        console.log('logged in user. ', user);\r\n        Alert.alert('logged in user');\r\n      })\r\n      .catch((ex) => {\r\n        console.error('error during login', ex.message);\r\n        Alert.alert('Error during login', ex.message);\r\n      })\r\n  }\r\n```\r\n\r\n```\r\nrender() {\r\n    return (\r\n      <View style={styles.container}>\r\n        <Text style={styles.welcome}>\r\n          Welcome to React Native {this.state.user.uid}!\r\n        </Text>\r\n        <Button title=\"Login\" onPress={this.login}></Button>\r\n      </View>\r\n    );\r\n  }\r\n```"},"comment":{"url":"https://api.github.com/repos/fullstackreact/react-native-firestack/issues/comments/262575633","html_url":"https://github.com/fullstackreact/react-native-firestack/issues/153#issuecomment-262575633","issue_url":"https://api.github.com/repos/fullstackreact/react-native-firestack/issues/153","id":262575633,"user":{"login":"florianbepunkt","id":8314202,"avatar_url":"https://avatars.githubusercontent.com/u/8314202?v=3","gravatar_id":"","url":"https://api.github.com/users/florianbepunkt","html_url":"https://github.com/florianbepunkt","followers_url":"https://api.github.com/users/florianbepunkt/followers","following_url":"https://api.github.com/users/florianbepunkt/following{/other_user}","gists_url":"https://api.github.com/users/florianbepunkt/gists{/gist_id}","starred_url":"https://api.github.com/users/florianbepunkt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/florianbepunkt/subscriptions","organizations_url":"https://api.github.com/users/florianbepunkt/orgs","repos_url":"https://api.github.com/users/florianbepunkt/repos","events_url":"https://api.github.com/users/florianbepunkt/events{/privacy}","received_events_url":"https://api.github.com/users/florianbepunkt/received_events","type":"User","site_admin":false},"created_at":"2016-11-23T17:11:28Z","updated_at":"2016-11-23T17:11:28Z","body":"@Salakar I will do that, thanks. Is there a roadmap somewhere for this project? I noticed small things here and there like different syntax from web api with some methods or stuff not working, but was not sure whether this is an issue or a side effect of the project being rehauled to mimic web js api syntax of firebase"}}
{"actor":{"display_login":"florianbepunkt"}}