Open ClaseVIvas opened 3 years ago
Hello community!
I need your help.
I am implementing in an Android App with NativeScript-VUE. The plugin: "nativescript-plugin-firebase": "^ 10.5.2", (package.json).
"nativescript-plugin-firebase": "^ 10.5.2", (package.json).
Everything is perfectly laced and worked with my firebase console and the app.
But in the Authentication by SMS the prompt DOES NOT APPEAR!
prompt
the SMS just arrives on my Android device with version 10 and continues normally.
However at other times if the Promptappears, is this normal?
Prompt
I attach my configuration.
PACKAGE.JSON { "name": "@nativescript/template-blank-vue", "main": "app.js", "displayName": "Blank", "version": "7.0.1", "description": "CCRChapela Application", "author": "NativeScript Team <oss@nativescript.org>", "license": "SEE LICENSE IN www.acvtools.com", "repository": "<fill-your-repository-here>", "homepage": "https://github.com/NativeScript/nativescript-app-templates", "bugs": { "url": "https://github.com/NativeScript/NativeScript/issues" }, "publishConfig": { "access": "public" }, "keywords": [ "nstudio", "nativescript", "mobile", "{N}", "tns", "vue", "nativescript-vue", "template", "master-detail", "detail", "category-general" ], "dependencies": { "@nativescript/core": "~7.0.0", "@nativescript/theme": "~2.3.0", "axios": "^0.20.0", "nativescript-permissions": "^1.3.9", "nativescript-plugin-firebase": "^10.5.2", "nativescript-vue": "~2.8.0" }, "devDependencies": { "@babel/core": "~7.1.0", "@babel/preset-env": "~7.1.0", "@nativescript/android": "7.0.0", "@nativescript/webpack": "~3.0.0", "babel-loader": "~8.0.0", "nativescript-vue-template-compiler": "~2.8.0", "node-sass": "^4.7.1", "vue-loader": "~15.9.3" }, "gitHead": "3c1e356f5a73a8feb68acc40b3c7c02c9d18d7f0", "private": "true", "readme": "NativeScript Application" } METHOD FIREBASE: sendSmsFirebase() { const firebase = require("nativescript-plugin-firebase"); this.isEnableRegister = false; var self = this; firebase .login({ type: firebase.LoginType.PHONE, phoneOptions: { phoneNumber: "+34" + self.phone, verificationPrompt: "Introduce el código que te llegará por SMS", // default "Verification code" android: { timeout: 30 // Tiempo de espera. } } }) .then( function(result) { console.log("RESULTADO ---- ", result); console.log("phonenumber",result.phoneNumber); try { self.isEnableRegister = true; if (result.phoneNumber === result.phoneNumber) { console.log("ENTRA EN EL IF -> ", result.phoneNumber); appSettings.setString("phoneNumberConfirm", self.phone); self.phoneConfirmed = appSettings.getString("phoneNumberConfirm"); self.setSeconActivityPantalan(); } } catch (ex) { alert("ERROR - ", ex); } }, function(errorMessage) { self.isEnableRegister = true; console.log(errorMessage); alert(errorMessage); } ); },
{ "name": "@nativescript/template-blank-vue", "main": "app.js", "displayName": "Blank", "version": "7.0.1", "description": "CCRChapela Application", "author": "NativeScript Team <oss@nativescript.org>", "license": "SEE LICENSE IN www.acvtools.com", "repository": "<fill-your-repository-here>", "homepage": "https://github.com/NativeScript/nativescript-app-templates", "bugs": { "url": "https://github.com/NativeScript/NativeScript/issues" }, "publishConfig": { "access": "public" }, "keywords": [ "nstudio", "nativescript", "mobile", "{N}", "tns", "vue", "nativescript-vue", "template", "master-detail", "detail", "category-general" ], "dependencies": { "@nativescript/core": "~7.0.0", "@nativescript/theme": "~2.3.0", "axios": "^0.20.0", "nativescript-permissions": "^1.3.9", "nativescript-plugin-firebase": "^10.5.2", "nativescript-vue": "~2.8.0" }, "devDependencies": { "@babel/core": "~7.1.0", "@babel/preset-env": "~7.1.0", "@nativescript/android": "7.0.0", "@nativescript/webpack": "~3.0.0", "babel-loader": "~8.0.0", "nativescript-vue-template-compiler": "~2.8.0", "node-sass": "^4.7.1", "vue-loader": "~15.9.3" }, "gitHead": "3c1e356f5a73a8feb68acc40b3c7c02c9d18d7f0", "private": "true", "readme": "NativeScript Application" }
sendSmsFirebase() { const firebase = require("nativescript-plugin-firebase"); this.isEnableRegister = false; var self = this; firebase .login({ type: firebase.LoginType.PHONE, phoneOptions: { phoneNumber: "+34" + self.phone, verificationPrompt: "Introduce el código que te llegará por SMS", // default "Verification code" android: { timeout: 30 // Tiempo de espera. } } }) .then( function(result) { console.log("RESULTADO ---- ", result); console.log("phonenumber",result.phoneNumber); try { self.isEnableRegister = true; if (result.phoneNumber === result.phoneNumber) { console.log("ENTRA EN EL IF -> ", result.phoneNumber); appSettings.setString("phoneNumberConfirm", self.phone); self.phoneConfirmed = appSettings.getString("phoneNumberConfirm"); self.setSeconActivityPantalan(); } } catch (ex) { alert("ERROR - ", ex); } }, function(errorMessage) { self.isEnableRegister = true; console.log(errorMessage); alert(errorMessage); } ); },
In platform/android/app/build.gradle: implementation "androidx.multidex:multidex:2.0.1" implementation "androidx.legacy:legacy-support-v4:$androidXLegacyVersion" implementation "androidx.appcompat:appcompat:$androidXAppCompatVersion" implementation "com.google.android.material:material:$androidXMaterialVersion" implementation "androidx.exifinterface:exifinterface:$androidXExifInterfaceVersion" implementation "androidx.viewpager2:viewpager2:$androidXViewPagerVersion" implementation "androidx.fragment:fragment:$androidXFragmentVersion" implementation "androidx.transition:transition:$androidXTransitionVersion" implementation 'com.google.firebase:firebase-auth:19.3.2'
implementation "androidx.multidex:multidex:2.0.1" implementation "androidx.legacy:legacy-support-v4:$androidXLegacyVersion" implementation "androidx.appcompat:appcompat:$androidXAppCompatVersion" implementation "com.google.android.material:material:$androidXMaterialVersion" implementation "androidx.exifinterface:exifinterface:$androidXExifInterfaceVersion" implementation "androidx.viewpager2:viewpager2:$androidXViewPagerVersion" implementation "androidx.fragment:fragment:$androidXFragmentVersion" implementation "androidx.transition:transition:$androidXTransitionVersion" implementation 'com.google.firebase:firebase-auth:19.3.2'
Thank you very much for answering. I'm really studying all this and I want to learn more every day.
Thank you very much for all community!
Best regards
Hello community!
I need your help.
I am implementing in an Android App with NativeScript-VUE. The plugin:
"nativescript-plugin-firebase": "^ 10.5.2", (package.json).
Everything is perfectly laced and worked with my firebase console and the app.
But in the Authentication by SMS the
prompt
DOES NOT APPEAR!the SMS just arrives on my Android device with version 10 and continues normally.
However at other times if the
Prompt
appears, is this normal?I attach my configuration.
PACKAGE.JSON
{ "name": "@nativescript/template-blank-vue", "main": "app.js", "displayName": "Blank", "version": "7.0.1", "description": "CCRChapela Application", "author": "NativeScript Team <oss@nativescript.org>", "license": "SEE LICENSE IN www.acvtools.com", "repository": "<fill-your-repository-here>", "homepage": "https://github.com/NativeScript/nativescript-app-templates", "bugs": { "url": "https://github.com/NativeScript/NativeScript/issues" }, "publishConfig": { "access": "public" }, "keywords": [ "nstudio", "nativescript", "mobile", "{N}", "tns", "vue", "nativescript-vue", "template", "master-detail", "detail", "category-general" ], "dependencies": { "@nativescript/core": "~7.0.0", "@nativescript/theme": "~2.3.0", "axios": "^0.20.0", "nativescript-permissions": "^1.3.9", "nativescript-plugin-firebase": "^10.5.2", "nativescript-vue": "~2.8.0" }, "devDependencies": { "@babel/core": "~7.1.0", "@babel/preset-env": "~7.1.0", "@nativescript/android": "7.0.0", "@nativescript/webpack": "~3.0.0", "babel-loader": "~8.0.0", "nativescript-vue-template-compiler": "~2.8.0", "node-sass": "^4.7.1", "vue-loader": "~15.9.3" }, "gitHead": "3c1e356f5a73a8feb68acc40b3c7c02c9d18d7f0", "private": "true", "readme": "NativeScript Application" }
METHOD FIREBASE:sendSmsFirebase() { const firebase = require("nativescript-plugin-firebase"); this.isEnableRegister = false; var self = this; firebase .login({ type: firebase.LoginType.PHONE, phoneOptions: { phoneNumber: "+34" + self.phone, verificationPrompt: "Introduce el código que te llegará por SMS", // default "Verification code" android: { timeout: 30 // Tiempo de espera. } } }) .then( function(result) { console.log("RESULTADO ---- ", result); console.log("phonenumber",result.phoneNumber); try { self.isEnableRegister = true; if (result.phoneNumber === result.phoneNumber) { console.log("ENTRA EN EL IF -> ", result.phoneNumber); appSettings.setString("phoneNumberConfirm", self.phone); self.phoneConfirmed = appSettings.getString("phoneNumberConfirm"); self.setSeconActivityPantalan(); } } catch (ex) { alert("ERROR - ", ex); } }, function(errorMessage) { self.isEnableRegister = true; console.log(errorMessage); alert(errorMessage); } ); },
In platform/android/app/build.gradle:
implementation "androidx.multidex:multidex:2.0.1" implementation "androidx.legacy:legacy-support-v4:$androidXLegacyVersion" implementation "androidx.appcompat:appcompat:$androidXAppCompatVersion" implementation "com.google.android.material:material:$androidXMaterialVersion" implementation "androidx.exifinterface:exifinterface:$androidXExifInterfaceVersion" implementation "androidx.viewpager2:viewpager2:$androidXViewPagerVersion" implementation "androidx.fragment:fragment:$androidXFragmentVersion" implementation "androidx.transition:transition:$androidXTransitionVersion" implementation 'com.google.firebase:firebase-auth:19.3.2'
Thank you very much for answering. I'm really studying all this and I want to learn more every day.
Thank you very much for all community!
Best regards