{"_id":"@bazumax/cordova-firebase-authentication","_rev":"1-9a85934e9e7fb5f65215ec669b70417a","name":"@bazumax/cordova-firebase-authentication","dist-tags":{"latest":"4.0.3"},"versions":{"4.0.3":{"name":"@bazumax/cordova-firebase-authentication","version":"4.0.3","description":"Cordova plugin for Firebase Authentication","cordova":{"id":"@bazumax/cordova-plugin-firebase-authentication","platforms":["ios","android"]},"repository":{"type":"git","url":"git+https://github.com/chemerisuk/cordova-plugin-firebase-authentication.git"},"author":{"name":"Maksim Chemerisuk","email":"chemerisuk@gmail.com","url":"https://github.com/chemerisuk"},"license":"MIT","bugs":{"url":"https://github.com/chemerisuk/cordova-plugin-firebase-authentication/issues"},"scripts":{"version":"replace -s 'version=\"(.+)(?=\">)' 'version=\"'$npm_package_version plugin.xml && git add plugin.xml","postversion":"git push && git push --tags"},"homepage":"https://github.com/chemerisuk/cordova-plugin-firebase-authentication#readme","funding":"https://github.com/chemerisuk/cordova-plugin-firebase-authentication?sponsor=1","keywords":["cordova","firebase","authentication","analytics","ecosystem:cordova","cordova-android","cordova-ios"],"gitHead":"8525b25732d453556fdc46ee494f52d85335fdec","_id":"@bazumax/cordova-firebase-authentication@4.0.3","_nodeVersion":"15.6.0","_npmVersion":"7.4.0","dist":{"integrity":"sha512-CPiR/vDAt/NoI2HVqKne3YL7YX8bMnE5sqmXRYBSzbXbkoJvEUN8rr0K+DtfFfnCjLXnIgR3pasV6jBXxmZsIA==","shasum":"f63eeed97efb2e0e330c32572db4d79506552fc6","tarball":"https://registry.npmjs.org/@bazumax/cordova-firebase-authentication/-/cordova-firebase-authentication-4.0.3.tgz","fileCount":9,"unpackedSize":42488,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgMr08CRA9TVsSAnZWagAAt8MP/i8762BGS7kqgkSY4Zlf\nVUxM20Y4mLifQkh77AQJz/vvlA83ERTgFat2yJYyKWSUuPuIACJJ4jFUkYR8\nb0E+f7grYXpXxCeSchUdLbsBPL9O1YLdJ5XyMBX88PnvLhqgvxDS2qc17Cw6\nXvf07UmsPHzgYnXX12HxK7gJr48xPhcav+DaaWiZ/j56o00NDnAyGOGRUjnt\nZyNgrixertNSLpkJydt80gLpeZhXZSif4Mm/x+OXmVn5dTl4QIgY7A3Xx1gX\nfNTG9nJOcZk5nGJZi29dmE5x0Gn5hIdFRC7wMCno4ZBgHF8QCPm6+10E8R21\nzOnpfPWNLwH4twYTOWD8bf4EpcWPTw63WrI6TtVWvjcIhi9Xe7q87s5lWZ6K\nJbuvg6Mif9huZGE6mTK+xBJl6sfl5VNOLcefxDOwSyMbDVKnDVK0Vst+6m5k\nFXgJNNhNdriTTgk1+NGosbAAuDk4Aopr3ssL+5EH1Tw9IIpvoZ7eSyoLV2qh\nPJWxEp+ZMCnTEP0rx0fBRpQ0yvvFjy+VFZH8DWw52VzMGaIl0dFiUKF6QtxF\n6Mo5cKZO4RztF24fZ2RjcQ+eEAOZqiF5NaG+QqgaE2yaxH3jnlZ5f2fs+LCK\nFf6FpNI6V6q5e5KxeGdw7JjPF09bE/oP2IYPvJ4XyyaB+SF2lOi2cE6SHzqh\nqqr7\r\n=NUTo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA0NuZUzGRePqb47hxZYefHAKQ98wqOJjvNmTyz0klKUAiEAyBfX7zjGlYiYwHwpCQywnFP2H5ht/wrGGDT0tFXMPl4="}]},"_npmUser":{"name":"bazuka5801","email":"bazuka5801@mail.ru"},"directories":{},"maintainers":[{"name":"bazuka5801","email":"bazuka5801@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/cordova-firebase-authentication_4.0.3_1613937980352_0.4888030906034808"},"_hasShrinkwrap":false}},"time":{"created":"2021-02-21T20:06:20.134Z","4.0.3":"2021-02-21T20:06:20.516Z","modified":"2022-04-04T17:50:09.819Z"},"maintainers":[{"name":"bazuka5801","email":"bazuka5801@mail.ru"}],"description":"Cordova plugin for Firebase Authentication","homepage":"https://github.com/chemerisuk/cordova-plugin-firebase-authentication#readme","keywords":["cordova","firebase","authentication","analytics","ecosystem:cordova","cordova-android","cordova-ios"],"repository":{"type":"git","url":"git+https://github.com/chemerisuk/cordova-plugin-firebase-authentication.git"},"author":{"name":"Maksim Chemerisuk","email":"chemerisuk@gmail.com","url":"https://github.com/chemerisuk"},"bugs":{"url":"https://github.com/chemerisuk/cordova-plugin-firebase-authentication/issues"},"license":"MIT","readme":"# Cordova plugin for [Firebase Authentication](https://firebase.google.com/docs/auth/)\n\n[![NPM version][npm-version]][npm-url] [![NPM downloads][npm-downloads]][npm-url] [![NPM total downloads][npm-total-downloads]][npm-url] [![Twitter][twitter-follow]][twitter-url]\n\n| [![Donate](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif)][donate-url] | Your help is appreciated. Create a PR, submit a bug or just grab me :beer: |\n|-|-|\n\n## Index\n\n<!-- MarkdownTOC levels=\"2\" autolink=\"true\" -->\n\n- [Installation](#installation)\n- [Supported Platforms](#supported-platforms)\n- [User authorization](#user-authorization)\n- [Get/set user state](#getset-user-state)\n\n<!-- /MarkdownTOC -->\n\n## Installation\n\n    cordova plugin add cordova-plugin-firebase-authentication\n\nUse variables `ANDROID_FIREBASE_AUTH_VERSION` or `IOS_FIREBASE_AUTH_VERSION` to override dependency versions for Firebase SDKs.\n\nTo use phone number authentication on iOS, your app must be able to receive silent APNs notifications from Firebase. For iOS 8.0 and above silent notifications do not require explicit user consent and is therefore unaffected by a user declining to receive APNs notifications in the app. Thus, the app does not need to request user permission to receive push notifications when implementing Firebase phone number auth.\n\n## Supported Platforms\n\n- iOS\n- Android\n\n## User authorization\nUnlike v1 of the plugin in v2 you must register `onAuthStateChanged` callback to be notified when  `signIn*` or `signOut` methods are completed. \n\n### onAuthStateChanged(_callback_)\nRegisters a block as an auth state did change listener. To be invoked when:\n* The block is registered as a listener,\n* A user with a different UID from the current user has signed in, or\n* The current user has signed out.\n\n```js\ncordova.plugins.firebase.auth.onAuthStateChanged(function(userInfo) {\n    if (userInfo) {\n        // user was signed in\n    } else {\n        // user was signed out\n    }\n});\n```\n\n### createUserWithEmailAndPassword(_email_, _password_)\nTries to create a new user account with the given email address and password.\n```js\ncordova.plugins.firebase.auth.createUserWithEmailAndPassword(\"my@mail.com\", \"pa55w0rd\");\n```\n\n### sendEmailVerification()\nInitiates email verification for the current user.\n```js\ncordova.plugins.firebase.auth.sendEmailVerification();\n```\n\n### sendPasswordResetEmail(_email_)\nTriggers the Firebase Authentication backend to send a password-reset email to the given email address, which must correspond to an existing user of your app.\n```js\ncordova.plugins.firebase.auth.sendPasswordResetEmail(\"my@mail.com\");\n```\n\n### signInWithEmailAndPassword(_email_, _password_)\nAsynchronously signs in using an email and password.\n```js\ncordova.plugins.firebase.auth.signInWithEmailAndPassword(\"my@mail.com\", \"pa55w0rd\");\n```\n\n### verifyPhoneNumber(_phoneNumber_, _timeout_)\nStarts the phone number verification process for the given phone number.\n\nNOTE: Android supports auto-verify and instant device verification. Therefore in that cases it doesn't make sense to ask for sms code. It's recommended to register `onAuthStateChanged` callback to be notified on auto sign-in. \n\n_timeout_ [milliseconds] is the maximum amount of time you are willing to wait for SMS auto-retrieval to be completed by the library. Maximum allowed value is 2 minutes. Use 0 to disable SMS-auto-retrieval. If you specify a positive value less than 30 seconds, library will default to 30 seconds.\n\n```js\ncordova.plugins.firebase.auth.verifyPhoneNumber(\"+123456789\").then(function(verificationId) {\n    // pass verificationId to signInWithVerificationId\n}).catch(function(err) {\n    console.error(\"phoner number verification failed\", err);\n});\n```\n### signInWithVerificationId(_verificationId_, _smsCode_)\nAsynchronously signs in using verificationId and 6-digit SMS code.\n\n```js\ncordova.plugins.firebase.auth.signInWithVerificationId(\"djgfioerjg34\", \"123456\");\n```\n\n\n### signInAnonymously()\nCreate and use temporary anonymous account to authenticate with Firebase. \n```js\ncordova.plugins.firebase.auth.signInAnonymously();\n```\n\n### signInWithGoogle(_idToken_, _accessToken_)\nUses Google's _idToken_ and _accessToken_ to sign-in into firebase account. In order to retriave those tokens you can use `cordova-plugin-googleplus` (or any other cordova plugin for Google Sign-In).\n\n    cordova plugin add cordova-plugin-firebase-authentication\n    cordova plugin add cordova-plugin-googleplus --variable REVERSED_CLIENT_ID=myreversedclientid --variable WEB_APPLICATION_CLIENT_ID=mywebapplicationclientid\n\nNow trigger signin dialog UI to popup:\n\n```js\nwindow.plugins.googleplus.login({\n    'scopes': '... ', // optional, space-separated list of scopes, If not included or empty, defaults to `profile` and `email`.\n    'webClientId': 'client id of the web app/server side', // optional clientId of your Web application from Credentials settings of your project - On Android, this MUST be included to get an idToken. On iOS, it is not required.\n    'offline': true // optional, but requires the webClientId - if set to true the plugin will also return a serverAuthCode, which can be used to grant offline access to a non-Google server\n}, function(res) {\n    // signin into Firebase\n    cordova.plugins.firebase.auth.signInWithGoogle(res.idToken, res.accessToken).then(function() {\n        console.log(\"Firebase logged in with Google\");\n    });\n}, function(err) {\n    console.error(\"login failed\", err);\n});\n```\n\n### signInWithApple(_idToken_, _rawNonce_)\nUses Apples's _idToken_ and _rawNonce_ to sign-in into firebase account. For getting _idToken_ (_rawNonce_ is optional) you can use `cordova-plugin-sign-in-with-apple` (or any other cordova plugin for Apple Sign-In).\n\n    cordova plugin add cordova-plugin-firebase-authentication\n    cordova plugin add cordova-plugin-sign-in-with-apple\n\nThen use code snippet below to signin into Firebase:\n\n```js\ncordova.plugins.SignInWithApple.signin({\n    requestedScopes: [0, 1]\n}, function(res) {\n    cordova.plugins.firebase.auth.signInWithApple(res.identityToken).then(function() {\n        console.log(\"Firebase logged in with Apple\");\n    });\n}, function(err) {\n    console.error(\"signin failed\", err);\n});\n```\n\n### signInWithFacebook(_accessToken_)\nUses Facebook's _accessToken_ to sign-in into firebase account. In order to retriave those tokens follow instructions for [Android](https://firebase.google.com/docs/auth/android/facebook-login) and [iOS](https://firebase.google.com/docs/auth/ios/facebook-login).\n\n### signInWithTwitter(_token_, _secret_)\nUses Twitter's _token_ and _secret_ to sign-in into firebase account. In order to retriave those tokens follow instructions for [Android](https://firebase.google.com/docs/auth/android/twitter-login) and [iOS](https://firebase.google.com/docs/auth/ios/twitter-login). \n\n### signInWithCustomToken(_idToken_)\nYou can integrate Firebase Authentication with a custom authentication system by modifying your authentication server to produce custom signed tokens when a user successfully signs in. Your app receives this token and uses it to authenticate with Firebase. See [Android](https://firebase.google.com/docs/auth/android/custom-auth) and [iOS](https://firebase.google.com/docs/auth/ios/custom-auth) for more info. \n\n### signOut()\nSigns out the current user and clears it from the disk cache.\n```js\ncordova.plugins.firebase.auth.signOut();\n```\n\n## Get/set user state\nEvery method call returns a promise which is optionally fulfilled with an appropriate value.\n\n### getCurrentUser()\nReturns the current user in the Firebase instance.\n```js\ncordova.plugins.firebase.auth.getCurrentUser().then(function(userInfo) {\n    // user information or null if not logged in\n})\n```\n\n### updateProfile()\nUpdates the current user's profile data.\n\nPassing a `null` value will delete the current attribute's value, but not\npassing a property won't change the current attribute's value.\n\n```js\ncordova.plugins.firebase.auth.updateProfile({\n   displayName: \"Jane Q. User\",\n   photoURL: \"https://example.com/jane-q-user/profile.jpg\"\n}).then(function() {\n    console.log(\"user profile updated\");\n});\n\n// Let's say we continue updating the profile of the same user as before.\ncordova.plugins.firebase.auth.updateProfile({\n    photoURL: null\n}).then(function() {\n    // displayName is unchanged - \"Jane Q. User\"\n    // photoURL is changed - null\n    console.log(\"only photoURL is changed\");\n});\n```\n\n### getIdToken(_forceRefresh_)\nReturns a JWT token used to identify the user to a Firebase service.\n```js\ncordova.plugins.firebase.auth.getIdToken().then(function(idToken) {\n    // send token to server\n});\n```\n\n### setLanguageCode(_languageCode_)\nSet's the current user language code. The string used to set this property must be a language code that follows BCP 47.\n\n### useAppLanguage()\nSets languageCode to the app’s current language.\n\n[npm-url]: https://www.npmjs.com/package/cordova-plugin-firebase-authentication\n[npm-version]: https://img.shields.io/npm/v/cordova-plugin-firebase-authentication.svg\n[npm-downloads]: https://img.shields.io/npm/dm/cordova-plugin-firebase-authentication.svg\n[npm-total-downloads]: https://img.shields.io/npm/dt/cordova-plugin-firebase-authentication.svg?label=total+downloads\n[twitter-url]: https://twitter.com/chemerisuk\n[twitter-follow]: https://img.shields.io/twitter/follow/chemerisuk.svg?style=social&label=Follow%20me\n[donate-url]: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=FYAALBP25DP2G&source=url","readmeFilename":"README.md"}