{"action":"created","issue":{"url":"https://api.github.com/repos/invertase/react-native-firebase/issues/543","repository_url":"https://api.github.com/repos/invertase/react-native-firebase","labels_url":"https://api.github.com/repos/invertase/react-native-firebase/issues/543/labels{/name}","comments_url":"https://api.github.com/repos/invertase/react-native-firebase/issues/543/comments","events_url":"https://api.github.com/repos/invertase/react-native-firebase/issues/543/events","html_url":"https://github.com/invertase/react-native-firebase/issues/543","id":267713228,"number":543,"title":"Persistence for the default initialized app is not working","user":{"login":"Shank209","id":7887799,"avatar_url":"https://avatars2.githubusercontent.com/u/7887799?v=4","gravatar_id":"","url":"https://api.github.com/users/Shank209","html_url":"https://github.com/Shank209","followers_url":"https://api.github.com/users/Shank209/followers","following_url":"https://api.github.com/users/Shank209/following{/other_user}","gists_url":"https://api.github.com/users/Shank209/gists{/gist_id}","starred_url":"https://api.github.com/users/Shank209/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shank209/subscriptions","organizations_url":"https://api.github.com/users/Shank209/orgs","repos_url":"https://api.github.com/users/Shank209/repos","events_url":"https://api.github.com/users/Shank209/events{/privacy}","received_events_url":"https://api.github.com/users/Shank209/received_events","type":"User","site_admin":false},"labels":[{"id":565970758,"url":"https://api.github.com/repos/invertase/react-native-firebase/labels/android","name":"android","color":"c2e0c6","default":false},{"id":566539156,"url":"https://api.github.com/repos/invertase/react-native-firebase/labels/awaiting-user-feedback","name":"awaiting-user-feedback","color":"5319e7","default":false},{"id":576623451,"url":"https://api.github.com/repos/invertase/react-native-firebase/labels/database","name":"database","color":"006b75","default":false}],"state":"closed","locked":false,"assignee":{"login":"Salakar","id":5347038,"avatar_url":"https://avatars0.githubusercontent.com/u/5347038?v=4","gravatar_id":"","url":"https://api.github.com/users/Salakar","html_url":"https://github.com/Salakar","followers_url":"https://api.github.com/users/Salakar/followers","following_url":"https://api.github.com/users/Salakar/following{/other_user}","gists_url":"https://api.github.com/users/Salakar/gists{/gist_id}","starred_url":"https://api.github.com/users/Salakar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Salakar/subscriptions","organizations_url":"https://api.github.com/users/Salakar/orgs","repos_url":"https://api.github.com/users/Salakar/repos","events_url":"https://api.github.com/users/Salakar/events{/privacy}","received_events_url":"https://api.github.com/users/Salakar/received_events","type":"User","site_admin":false},"assignees":[{"login":"Salakar","id":5347038,"avatar_url":"https://avatars0.githubusercontent.com/u/5347038?v=4","gravatar_id":"","url":"https://api.github.com/users/Salakar","html_url":"https://github.com/Salakar","followers_url":"https://api.github.com/users/Salakar/followers","following_url":"https://api.github.com/users/Salakar/following{/other_user}","gists_url":"https://api.github.com/users/Salakar/gists{/gist_id}","starred_url":"https://api.github.com/users/Salakar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Salakar/subscriptions","organizations_url":"https://api.github.com/users/Salakar/orgs","repos_url":"https://api.github.com/users/Salakar/repos","events_url":"https://api.github.com/users/Salakar/events{/privacy}","received_events_url":"https://api.github.com/users/Salakar/received_events","type":"User","site_admin":false},{"login":"chrisbianca","id":10723021,"avatar_url":"https://avatars0.githubusercontent.com/u/10723021?v=4","gravatar_id":"","url":"https://api.github.com/users/chrisbianca","html_url":"https://github.com/chrisbianca","followers_url":"https://api.github.com/users/chrisbianca/followers","following_url":"https://api.github.com/users/chrisbianca/following{/other_user}","gists_url":"https://api.github.com/users/chrisbianca/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisbianca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisbianca/subscriptions","organizations_url":"https://api.github.com/users/chrisbianca/orgs","repos_url":"https://api.github.com/users/chrisbianca/repos","events_url":"https://api.github.com/users/chrisbianca/events{/privacy}","received_events_url":"https://api.github.com/users/chrisbianca/received_events","type":"User","site_admin":false}],"milestone":null,"comments":15,"created_at":"2017-10-23T15:29:51Z","updated_at":"2017-11-09T08:10:45Z","closed_at":"2017-11-06T09:29:52Z","author_association":"NONE","body":"According to the [docs](https://rnfirebase.io/docs/v3.0.*/core/default-app), in order to enable persistence for the DEFAULT initialized app, I need to add the line `FirebaseDatabase.getInstance().setPersistenceEnabled(true);` to my **MainActivity.java** file which I did. But persistence is still not working. This is the code for my MainActivity.java file:\r\n```\r\npackage com.myapp;\r\n\r\nimport com.facebook.react.ReactActivity;\r\nimport com.google.firebase.database.FirebaseDatabase;\r\nimport android.os.Bundle;\r\n\r\npublic class MainActivity extends ReactActivity {\r\n    @Override\r\n\tprotected void onCreate(Bundle savedInstanceState) {\r\n        super.onCreate(savedInstanceState);\r\n\t\tFirebaseDatabase.getInstance().setPersistenceEnabled(true);\r\n\t}\r\n\r\n    /**\r\n     * Returns the name of the main component registered from JavaScript.\r\n     * This is used to schedule rendering of the component.\r\n     */\r\n    @Override\r\n    protected String getMainComponentName() {\r\n        return \"myapp\";\r\n    }\r\n}\r\n\r\n```\r\n\r\nApplication Target Platform: Android\r\n\r\nDevelopment Operating System: Windows 10\r\n\r\nBuild Tools: Android Studio 2.2.3\r\n\r\nReact Native version: 0.49.3\r\n\r\nRNFirebase Version: 3.0.4\r\n\r\nFirebase Module: database"},"comment":{"url":"https://api.github.com/repos/invertase/react-native-firebase/issues/comments/343078014","html_url":"https://github.com/invertase/react-native-firebase/issues/543#issuecomment-343078014","issue_url":"https://api.github.com/repos/invertase/react-native-firebase/issues/543","id":343078014,"user":{"login":"nikolal","id":6722104,"avatar_url":"https://avatars2.githubusercontent.com/u/6722104?v=4","gravatar_id":"","url":"https://api.github.com/users/nikolal","html_url":"https://github.com/nikolal","followers_url":"https://api.github.com/users/nikolal/followers","following_url":"https://api.github.com/users/nikolal/following{/other_user}","gists_url":"https://api.github.com/users/nikolal/gists{/gist_id}","starred_url":"https://api.github.com/users/nikolal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nikolal/subscriptions","organizations_url":"https://api.github.com/users/nikolal/orgs","repos_url":"https://api.github.com/users/nikolal/repos","events_url":"https://api.github.com/users/nikolal/events{/privacy}","received_events_url":"https://api.github.com/users/nikolal/received_events","type":"User","site_admin":false},"created_at":"2017-11-09T08:10:45Z","updated_at":"2017-11-09T08:10:45Z","author_association":"NONE","body":"OK. So this means if I log in user once and keep him logged in for a longer time, next time he opens the app offline he will stay logged in and will be able to access database ( if rules are allowing it ).\r\n\r\nAm I correct?"}}
{"actor":{"display_login":"nikolal"}}