{"action":"created","issue":{"url":"https://api.github.com/repos/invertase/react-native-firebase/issues/119","repository_url":"https://api.github.com/repos/invertase/react-native-firebase","labels_url":"https://api.github.com/repos/invertase/react-native-firebase/issues/119/labels{/name}","comments_url":"https://api.github.com/repos/invertase/react-native-firebase/issues/119/comments","events_url":"https://api.github.com/repos/invertase/react-native-firebase/issues/119/events","html_url":"https://github.com/invertase/react-native-firebase/issues/119","id":229521265,"number":119,"title":"Firebase Phone Number Auth integration","user":{"login":"jasan-s","id":13863953,"avatar_url":"https://avatars3.githubusercontent.com/u/13863953?v=4","gravatar_id":"","url":"https://api.github.com/users/jasan-s","html_url":"https://github.com/jasan-s","followers_url":"https://api.github.com/users/jasan-s/followers","following_url":"https://api.github.com/users/jasan-s/following{/other_user}","gists_url":"https://api.github.com/users/jasan-s/gists{/gist_id}","starred_url":"https://api.github.com/users/jasan-s/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasan-s/subscriptions","organizations_url":"https://api.github.com/users/jasan-s/orgs","repos_url":"https://api.github.com/users/jasan-s/repos","events_url":"https://api.github.com/users/jasan-s/events{/privacy}","received_events_url":"https://api.github.com/users/jasan-s/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":576624277,"url":"https://api.github.com/repos/invertase/react-native-firebase/labels/auth","name":"auth","color":"d4c5f9","default":false},{"id":529942683,"url":"https://api.github.com/repos/invertase/react-native-firebase/labels/feature-request","name":"feature-request","color":"84b6eb","default":false},{"id":565970850,"url":"https://api.github.com/repos/invertase/react-native-firebase/labels/ios","name":"ios","color":"c5def5","default":false},{"id":566176097,"url":"https://api.github.com/repos/invertase/react-native-firebase/labels/js","name":"js","color":"fbca04","default":false}],"state":"open","locked":false,"assignee":{"login":"Ehesp","id":842078,"avatar_url":"https://avatars3.githubusercontent.com/u/842078?v=4","gravatar_id":"","url":"https://api.github.com/users/Ehesp","html_url":"https://github.com/Ehesp","followers_url":"https://api.github.com/users/Ehesp/followers","following_url":"https://api.github.com/users/Ehesp/following{/other_user}","gists_url":"https://api.github.com/users/Ehesp/gists{/gist_id}","starred_url":"https://api.github.com/users/Ehesp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ehesp/subscriptions","organizations_url":"https://api.github.com/users/Ehesp/orgs","repos_url":"https://api.github.com/users/Ehesp/repos","events_url":"https://api.github.com/users/Ehesp/events{/privacy}","received_events_url":"https://api.github.com/users/Ehesp/received_events","type":"User","site_admin":false},"assignees":[{"login":"Ehesp","id":842078,"avatar_url":"https://avatars3.githubusercontent.com/u/842078?v=4","gravatar_id":"","url":"https://api.github.com/users/Ehesp","html_url":"https://github.com/Ehesp","followers_url":"https://api.github.com/users/Ehesp/followers","following_url":"https://api.github.com/users/Ehesp/following{/other_user}","gists_url":"https://api.github.com/users/Ehesp/gists{/gist_id}","starred_url":"https://api.github.com/users/Ehesp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ehesp/subscriptions","organizations_url":"https://api.github.com/users/Ehesp/orgs","repos_url":"https://api.github.com/users/Ehesp/repos","events_url":"https://api.github.com/users/Ehesp/events{/privacy}","received_events_url":"https://api.github.com/users/Ehesp/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/invertase/react-native-firebase/milestones/1","html_url":"https://github.com/invertase/react-native-firebase/milestone/1","labels_url":"https://api.github.com/repos/invertase/react-native-firebase/milestones/1/labels","id":2566493,"number":1,"title":"v2.x","description":"","creator":{"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},"open_issues":9,"closed_issues":3,"state":"open","created_at":"2017-06-07T00:24:25Z","updated_at":"2017-07-30T01:00:58Z","due_on":null,"closed_at":null},"comments":59,"created_at":"2017-05-18T00:13:44Z","updated_at":"2017-08-04T03:23:53Z","closed_at":null,"body":"Is the new Firebase Phone number Auth on the roadmap? "},"comment":{"url":"https://api.github.com/repos/invertase/react-native-firebase/issues/comments/320146418","html_url":"https://github.com/invertase/react-native-firebase/issues/119#issuecomment-320146418","issue_url":"https://api.github.com/repos/invertase/react-native-firebase/issues/119","id":320146418,"user":{"login":"jesseditson","id":370239,"avatar_url":"https://avatars3.githubusercontent.com/u/370239?v=4","gravatar_id":"","url":"https://api.github.com/users/jesseditson","html_url":"https://github.com/jesseditson","followers_url":"https://api.github.com/users/jesseditson/followers","following_url":"https://api.github.com/users/jesseditson/following{/other_user}","gists_url":"https://api.github.com/users/jesseditson/gists{/gist_id}","starred_url":"https://api.github.com/users/jesseditson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jesseditson/subscriptions","organizations_url":"https://api.github.com/users/jesseditson/orgs","repos_url":"https://api.github.com/users/jesseditson/repos","events_url":"https://api.github.com/users/jesseditson/events{/privacy}","received_events_url":"https://api.github.com/users/jesseditson/received_events","type":"User","site_admin":false},"created_at":"2017-08-04T03:23:53Z","updated_at":"2017-08-04T03:23:53Z","body":"An easier way to read this may be just what would be added to the docs, which describes the proposed API:\r\n\r\n----\r\n\r\n#### [`signInWithPhoneNumber(phoneNumber: string): Promise`](https://firebase.google.com/docs/reference/js/firebase.auth.Auth#signInWithPhoneNumber)\r\n#### [`onAuthCodeSent(handler: (verificationID: string) => void): () => void`](https://firebase.google.com/docs/reference/js/firebase.auth.Auth#onAuthCodeSent)\r\n#### [`verifyCode(verificationID: string, verificationCode: string)`](https://firebase.google.com/docs/reference/js/firebase.auth.Auth#verifyCode)\r\n\r\nTo sign a user in with their phone number, use the `signInWithPhoneNumber()` function.\r\n\r\nThis method will send the user a verification code, which will either be automatically verified (some android devices), or will require the user to input the code that was sent to them.\r\n\r\nAs such, you must first subscribe to the `onAuthCodeSent` event, which if called, must in turn call `firebase.auth().verifyCode()`. once verified (or rejected), the original promise will be resolved with a user or an error:\r\n\r\n```javascript\r\nconst auth = firebase.auth();\r\n// install handler\r\nconst unsubscribe = auth.onAuthCodeSent((verificationID) => {\r\n  // obtain code from user, probably by showing a text box or similar.\r\n  getCodeFromUser()\r\n    .then(code => auth.verifyCode(verificationID, code))\r\n    .then(unsubscribe)\r\n    .catch(e => {\r\n      console.error('Unknown error verifying code:', e.message || e);\r\n    });\r\n});\r\n// then invoke the sign in method\r\nauth.signInWithPhoneNumber('+14156666666')\r\n  .then(user => {\r\n    console.log('User successfully logged in', user);\r\n  })\r\n  .catch(e => {\r\n    console.error('User signin error', e.message || e);\r\n  });\r\n```"}}
{"actor":{"display_login":"jesseditson"}}