Error logging in with google firebase, cordova, vuejs - vuejs2

Good day, I'm trying to log in with google and my config.xml file I have it this way
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.terabit.facilpark" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<hook src="hooks/hookers.js" type="before_prepare" />
<hook src="hooks/beforedep.js" type="before_deploy" />
<name>FacilPark</name>
<description>
</description>
<preference name="AndroidLaunchMode" value="singleTask" />
<universal-links>
<host name="facilpark19.page.link" scheme="https" />
<host name="facilpark-bdfd1.firebaseapp.com" scheme="https">
<path url="/__/auth/callback" />
</host>
</universal-links>
<author email="dev#cordova.apache.org" href="http://cordova.io">
Terabit
</author>
<content src="index.html" />
<access origin="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
<platform name="android">
<allow-intent href="market:*" />
</platform>
<platform name="ios">
<allow-intent href="itms:*" />
<allow-intent href="itms-apps:*" />
</platform>
<allow-navigation href="*" />
<plugin name="cordova-plugin-whitelist" spec="^1.3.3" />
<plugin name="cordova-plugin-buildinfo" spec="^2.0.2" />
<plugin name="cordova-plugin-browsertab" spec="^0.2.0" />
<plugin name="cordova-plugin-inappbrowser" spec="^3.0.0" />
<plugin name="cordova-plugin-customurlscheme" spec="^4.3.0">
<variable name="URL_SCHEME" value="com.terabit.facilpark" />
</plugin>
<plugin name="cordova-universal-links-plugin" spec="~1.2.1" />
<plugin name="cordova-plugin-geolocation" spec="^4.0.1" />
<plugin name="cordova.plugins.diagnostic" spec="^4.0.10" />
<plugin name="cordova-open-native-settings" spec="^1.5.2" />
<plugin name="cordova-plugin-device" spec="^2.0.2" />
<engine name="browser" spec="^5.0.2" />
<engine name="android" spec="^7.0.0" />
</widget>
and the motod to initiate session in the following way:
loginGoogle(){
console.log("LOGIN GOOGLE");
const provider = new firebase.auth.GoogleAuthProvider();
firebase.auth().signInWithRedirect(provider).then(function() {
return firebase.auth().getRedirectResult();
}).then(result =>{
// This gives you a Google Access Token. You can use it to access the Google API.
console.log("AUTENTICACION POR GOOGLE EXITOSA")
this.completarInicio(user);
//this.$router.replace('home');
console.log(result);
var token = result.credential.accessToken;
// The signed-in user info.
var user = result.user;
// ...
}).catch(function(error) {
// Handle Errors here.
var errorCode = error.code;
var errorMessage = error.message;
// The email of the user's account used.
var email = error.email;
// The firebase.auth.AuthCredential type that was used.
var credential = error.credential;
// ...
});
},
The problem I have is to log in from the application, after having selected the google account and enter password I get the following message:
How can I correct the above mentioned, thank you very much.

Go to your Firebase Console, and on the Project Overview page there's a very small button called Add App. Select the OS and then enter your app bundle id.

Related

connection error when creating app using cordova

I was try to create android app using vuejs and cordova. A connection error shown while opening app.
my .env
VUE_APP_URL='https://myapp.com'
cordova/config.xml
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.mealclub.app" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>UkMeals</name>
<description>
A sample Apache Cordova application that responds to the deviceready event.
</description>
<author email="dev#cordova.apache.org" href="http://cordova.io">
Apache Cordova Team
</author>
<!-- this hook will point your config.xml to the DevServer on Serve -->
<hook type="after_prepare" src="../node_modules/vue-cli-plugin-cordova/serve-config-hook.js" />
<content src="index.html" />
<access origin="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
<platform name="android">
<allow-intent href="market:*" />
</platform>
<platform name="ios">
<allow-intent href="itms:*" />
<allow-intent href="itms-apps:*" />
</platform>
</widget>
Error image

Images not found in Cordova app from Vue project

Recently I have installed cordova into a VueJS project and almost everything works fine, but statics files are not found like images and I didnt figure out why.
I read something about relative paths like ../../assets and I tried to change to assets/ just to see if works but didnt.
Using scss, images are normally imported with require(../../assets so I tried to change all my img src to :src="require(../../assets)" but still have no success.
I never had to install cordova in a running project, so I didnt know if I'm missing some config.
Here is my src-cordova/config.js
<?xml version='1.0' encoding='utf-8'?>
<widget id="medcof.app.io" version="1.0.0" xmlns:android="http://schemas.android.com/apk/res/android" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>MedCofQBank</name>
<description>
A sample Apache Cordova application that responds to the deviceready event.
</description>
<author email="dev#cordova.apache.org" href="http://cordova.io">
Apache Cordova Team
</author>
<!-- this hook will point your config.xml to the DevServer on Serve -->
<hook type="after_prepare" src="../node_modules/vue-cli-plugin-cordova/serve-config-hook.js" />
<!-- this hook will point your config.xml to the DevServer on Serve -->
<hook type="after_prepare" src="../node_modules/vue-cli-plugin-cordova/serve-config-hook.js" />
<content src="index.html" />
<access origin="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
<platform name="android">
<edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application">
<application android:usesCleartextTraffic="true" />
</edit-config>
</platform>
<platform name="ios">
<allow-intent href="itms:*" />
<allow-intent href="itms-apps:*" />
</platform>
<preference name="AndroidPersistentFileLocation" value="Compatibility" />
</widget>

i am getting while running on my mobile. But it is running fine on ionic serve

Getting ERR_CLEARTEXT_NOT_PERMITTED error. I have tried every thing change my config.xml , network_config getting update automatically when i add my domain. ionic cli is 5.4.13
<?xml version='1.0' encoding='utf-8'?>
<widget id="io.ionic.starter" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>MyApp</name>
<description>An awesome Ionic/Cordova app.</description>
<author email="hi#ionicframework.com" href="http://ionicframework.com/">Ionic Framework Team</author>
<content src="index.html" />
<access origin="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
<preference name="ScrollEnabled" value="false" />
<preference name="android-minSdkVersion" value="19" />
<preference name="BackupWebStorage" value="none" />
<preference name="SplashMaintainAspectRatio" value="true" />
<preference name="FadeSplashScreenDuration" value="300" />
<preference name="SplashShowOnlyFirstTime" value="false" />
<preference name="SplashScreen" value="screen" />
<preference name="SplashScreenDelay" value="3000" />
<platform name="android">
<access origin="*" />
<preference name="android-usesCleartextTraffic" value="true" />
<allow-navigation href="*" />
<edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application" xmlns:android="http://schemas.android.com/apk/res/android">
<application android:networkSecurityConfig="#xml/network_security_config" />
<application android:usesCleartextTraffic="true" />
</edit-config>
<resource-file src="resources/android/xml/network_security_config.xml" target="app/src/main/res/xml/network_security_config.xml" />
<allow-intent href="market:*" />
</platform>
</widget>
You can use ionic cordova http plugin for network request your error maybe solve.
Here is link for that
https://ionicframework.com/docs/native/http

Facing issue while mapping list within list in xml to xml mapping using mule dataweave

While I am transforming one xml to another and doing mapping list within list elements.I am getting one exception .
"Cannot coerce a :string to a :object (com.mulesoft.weave.mule.exception.WeaveExecutionException). Message payload is of type: WeaveMessageProcessor$WeaveOutputHandler"
Input xml:
<?xml version="1.0" encoding="UTF-8"?>
<ZCOM_IDD2565_AGREEMENT>
<transaction>
<id>www</id>
<timestamp>20160512 200939</timestamp>
<sender>ghh566</sender>
</transaction>
<identification>
<R3number>88898</R3number>
<enterpriseId />
<sourcesystemid>ffff</sourcesystemid>
<sourcesystemobjectid>999089</sourcesystemobjectid>
</identification>
<details>
<newTransaction>N</newTransaction>
<type>siiii</type>
<organizational>
<salesOrg>1223</salesOrg>
<currency>RUPEE</currency>
</organizational>
<description>
<internal>jhjb hjgjhg jkhjh</internal>
<external>jhhgjhb</external>
<project>owdoie</project>
</description>
<dates>
<validFrom>2016-04-05</validFrom>
<validTo>2017-04-30</validTo>
<fixedValue>0000-00-00</fixedValue>
</dates>
<creditTriggerEvent>S</creditTriggerEvent>
</details>
<rules>
<ZCOM_AGR_RULES>
<rule>
<ruleType>923</ruleType>
<agreementItem />
<ruleNumber />
<quantities>
<minimum />
<maximum />
</quantities>
<firstRecordA />
<application />
<conditionType>dddd</conditionType>
<salesOrg>1000</salesOrg>
<distributionChannel />
<division />
<endCustomerNumber />
<serialNumber />
<soldTo>
<ZCOM_AGR_SOLD>
<id>990888</id>
<addressNumber>2132435</addressNumber>
<name>dsfdg fdg</name>
<streetAddress>hu78hj k</streetAddress>
<postalCode>5654</postalCode>
<city>sfds</city>
<country>sdsa</country>
<phone>555-555-5555</phone>
<languageKey>E</languageKey>
<district />
<houseNumber>poio aaed</houseNumber>
<region>iii</region>
</ZCOM_AGR_SOLD>
<ZCOM_AGR_SOLD>
<id>777787</id>
<addressNumber>121223</addressNumber>
<name>dsfdg fdg</name>
<streetAddress>hu78hj k</streetAddress>
<postalCode>5654</postalCode>
<city>sfds</city>
<country>sdsa</country>
<phone>555-555-5555</phone>
<languageKey>E</languageKey>
<district />
<houseNumber>poio aaed</houseNumber>
<region>iii</region>
</ZCOM_AGR_SOLD>
</soldTo>
<shipTo>
<id />
<addressNumber />
<name />
<streetAddress />
<postalCode />
<city />
<country />
<phone />
<languageKey />
<district />
<houseNumber />
<region />
</shipTo>
<upc />
<catalogNumber />
<discountSchedule />
<priceGroupCode />
<priceFamily />
<requested-discount-netPrice />
<delete />
<customerRate />
<priceChange />
<dates>
<validFrom>2016-04-05</validFrom>
<validTo>2017-04-30</validTo>
<fixedValue>0000-00-00</fixedValue>
</dates>
<condition>
<type />
<calculationType />
<approved-discount-netPrice>0.00000</approved-discount-netPrice>
<unitOfMeasue />
<conditionitemindex />
<additionalvaluedays />
<fixedvaluedate />
<maxiumSalesOrdersPerConditionRecord />
<numberOfIncrementalScale />
<scaleNumberForPricing />
</condition>
</rule>
</ZCOM_AGR_RULES>
<ZCOM_AGR_RULES>
<rule>
<ruleType>920</ruleType>
<agreementItem />
<ruleNumber />
<quantities>
<minimum />
<maximum />
</quantities>
<firstRecordA />
<application />
<conditionType>rrrr</conditionType>
<salesOrg>1000</salesOrg>
<distributionChannel />
<division />
<endCustomerNumber />
<serialNumber />
<soldTo />
<shipTo>
<id />
<addressNumber />
<name />
<streetAddress />
<postalCode />
<city />
<country />
<phone />
<languageKey />
<district />
<houseNumber />
<region />
</shipTo>
<upc />
<catalogNumber />
<discountSchedule>B5</discountSchedule>
<priceGroupCode />
<priceFamily />
<requested-discount-netPrice>0.00</requested-discount-netPrice>
<delete />
<customerRate>0.44</customerRate>
<priceChange>X</priceChange>
<dates>
<validFrom>2016-04-05</validFrom>
<validTo>2017-04-30</validTo>
<fixedValue>0000-00-00</fixedValue>
</dates>
<condition>
<type>rrrr</type>
<calculationType>A</calculationType>
<approved-discount-netPrice>0.35000</approved-discount-netPrice>
<unitOfMeasue>%</unitOfMeasue>
<conditionitemindex />
<additionalvaluedays />
<fixedvaluedate />
<maxiumSalesOrdersPerConditionRecord />
<numberOfIncrementalScale />
<scaleNumberForPricing />
</condition>
</rule>
</ZCOM_AGR_RULES>
</rules>
</ZCOM_IDD2565_AGREEMENT>
Data weave script code
%dw 1.0
%output application/xml
%type dtfield = :string { format: "yyyyMMdd" }
%namespace ns0 http://schemas.xmlsoap.org/soap/envelope/
%namespace ns1 FlexiWebService
---
{
ns0#Envelope: {
ns0#Header: {
ns1#AuthHeader: {
Username: "dssdfdf",
Password: "dfff"
}
},
ns0#Body: {
Z_IDDO735_IRM_AGRMNTS01: {
IDOC: {
'_-IRM_-AGMTK01': {
(TRANS: payload.ZCOM_IDD2565_AGREEMENT.details.newTransaction as :string) when payload.ZCOM_IDD2565_AGREEMENT.details.newTransaction?,
(BOART_AG: payload.ZCOM_IDD2565_AGREEMENT.details.type) when payload.ZCOM_IDD2565_AGREEMENT.details.type? ,
(AMTNUM: payload.ZCOM_IDD2565_AGREEMENT.identification.sourcesystemobjectid) when payload.ZCOM_IDD2565_AGREEMENT.identification.sourcesystemobjectid?,
(AGMTNUM_EXT: payload.ZCOM_IDD2565_AGREEMENT.details.description.external as :string) when payload.ZCOM_IDD2565_AGREEMENT.details.description.external?,
(AGMTTXT: payload.ZCOM_IDD2565_AGREEMENT.details.description.internal) when payload.ZCOM_IDD2565_AGREEMENT.details.description.internal?,
(VALID_FROM: payload.ZCOM_IDD2565_AGREEMENT.details.dates.validFrom as :dtfield replace "-" with "") when payload.ZCOM_IDD2565_AGREEMENT.details.dates.validFrom?,
(VALID_TO: payload.ZCOM_IDD2565_AGREEMENT.details.dates.validTo as :dtfield replace "-" with "") when payload.ZCOM_IDD2565_AGREEMENT.details.dates.validTo?,
'_-IRM_-AGMTK02': {
ZIDDO735_AGMTK02: {
(FV_DATE: payload.ZCOM_IDD2565_AGREEMENT.details.dates.fixedValue as :dtfield replace "-" with "") when payload.ZCOM_IDD2565_AGREEMENT.details.dates.fixedValue?,
(TDOBNAME: payload.ZCOM_IDD2565_AGREEMENT.details.creditTriggerEvent) when payload.ZCOM_IDD2565_AGREEMENT.details.creditTriggerEvent?
}
}
},
E1EDK14: {
(ORGID: payload.ZCOM_IDD2565_AGREEMENT.details.organizational.salesOrg) when payload.ZCOM_IDD2565_AGREEMENT.details.organizational.salesOrg?,
ZIDDO735_E1EDK14: {
(CURR: payload.ZCOM_IDD2565_AGREEMENT.details.organizational.currency) when payload.ZCOM_IDD2565_AGREEMENT.details.organizational.currency?
}
},
((payload.ZCOM_IDD2565_AGREEMENT.rules.*ZCOM_AGR_RULES default []) map {
E1KOMG:{
KVEWE: $.rule.firstRecordA,
KOTABNR: $.rule.condition.type,
KAPPL: $.rule.application,
VKORG: $.rule.salesOrg,
VTWEG: $.rule.distributionChannel,
EAN11: $.rule.upc,
KONDM: $.rule.discountSchedule,
EVRTP: $.rule.agreementItem,
HIENR: $.rule.endCustomerNumber,
POSNR: $.rule.ruleNumber,
ANZSN: $.rule.requested-discount-netPrice,
VKGRP: $.rule.priceGroupCode,
ZIDDO735_E1KOMG_QUANTITY: {
TDID_MIN_QTY: $.rule.quantities.minimum,
TDID_MAX_QTY: $.rule.quantities.maximum
},
ZIDDO735_E1KOMG: {
ZIDD0735_SHIP_TO_KUNWE: {
LAND1: $.rule.shipTo.country,
NAME1: $.rule.shipTo.name,
ORT01: $.rule.shipTo.city,
REGIO: $.rule.shipTo.region,
TELF1: $.rule.shipTo.phone as :string replace "-" with "",
ADRNR: $.rule.shipTo.addressNumber,
SPRAS: $.rule.shipTo.languageKey,
STRAS: $.rule.shipTo.streetAddress
},
(ZIDD0735_KNA1_DETAILS: $.rule.soldTo.*ZCOM_AGR_SOLD default [] map {
KUNNR: $.id,
LAND1: $.country,
NAME1: $.name,
ORT01: $.city,
PSTLZ: $.postalCode,
REGIO: $.region,
TELF1: $.phone as :string replace "-" with "",
ADRNR: $.addressNumber,
SPRAS: $.languageKey,
STRAS: $.streetAddress
}) when ($.rule.soldTo !="" and $.rule.soldTo.*ZCOM_AGR_SOLD as :object !="")
},
E1KONH: {
DATAB: $.rule.dates.validFrom as :dtfield replace "-" with "",
DATBI: $.rule.dates.validTo as :dtfield replace "-" with "",
E1KONP: {
KSCHL: $.rule.conditionType,
KRECH: $.rule.condition.calculationType,
KBETR: $.rule.condition.approved-discount-netPrice,
KONWA: $.rule.condition.unitOfMeasue,
ZAEHK_IND: $.rule.condition.conditionitemindex,
VALTG: $.rule.condition.additionalvaluedays,
VALDT: $.rule.condition.fixedvaluedate,
KLF_STG: $.rule.condition.numberOfIncrementalScale,
KLF_KAL: $.rule.condition.scaleNumberForPricing
}
}
}})
}
}
}
}
}
Actually what is happening, fields under ZIDD0735_KNA1_DETAILS-node of output xml is mapped to fields under ZCOM_AGR_SOLD and ZCOM_AGR_SOLD is List of data or you can say array.In output where I have values for ZCOM_AGR_SOLD, I am getting data under ZIDD0735_KNA1_DETAILS, but instead of the repeated values of ZIDD0735_KNA1_DETAILS I am getting ZCOM_AGR_SOLD under ZIDD0735_KNA1_DETAILS with all input xml node names not output node names.This is happening with this field only. rest everything is working fine.
This is a similar scenario:
https://forums.mulesoft.com/questions/1108/dataweave-date-conversion-from-string.html
Could it be that your dates are the one causing the exception?

Phonegap Build InAppBrowser

It is necessary to add any specific setting in config.xml to have inAppBrowser working with phonegap build?
Im just adding:
var ref = window.open(url, '_blank');
or
var ref = window.open(url, 'blank');
but it doesnt work.
My config xml:
<?xml version="1.0" encoding="UTF-8" ?>
<widget xmlns = "http://www.w3.org/ns/widgets" xmlns:gap = "http://phonegap.com/ns/1.0" id = "com.phonegap.myapp">
<name>My app</name>
<description>test</description>
<preference name="phonegap-version" value="2.7.0" />
<access origin="*" />
<preference name="fullscreen" value="false" />
</widget>
I do this which will open the in-app browser:
window.open(destination, '_blank', 'location=yes,enableViewportScale=yes');
In your config.xml you should have a lot more than what you have there. This is mine:
<?xml version="1.0" encoding="UTF-8"?>
<widget>
<preference name="AllowInlineMediaPlayback" value="false" />
<preference name="AutoHideSplashScreen" value="true" />
<preference name="BackupWebStorage" value="cloud" />
<preference name="DisallowOverscroll" value="false" />
<preference name="EnableLocation" value="false" /><!-- DEPRECATED -->
<preference name="EnableViewportScale" value="false" />
<preference name="FadeSplashScreen" value="true" />
<preference name="FadeSplashScreenDuration" value=".25" />
<preference name="HideKeyboardFormAccessoryBar" value="false" />
<preference name="KeyboardDisplayRequiresUserAction" value="true" />
<preference name="KeyboardShrinksView" value="false" />
<preference name="MediaPlaybackRequiresUserAction" value="false" />
<preference name="ShowSplashScreenSpinner" value="true" />
<preference name="SuppressesIncrementalRendering" value="false" />
<preference name="TopActivityIndicator" value="gray" />
<content src="index.html" />
<plugins>
<plugin name="Device" value="CDVDevice" />
<plugin name="Logger" value="CDVLogger" />
<plugin name="Compass" value="CDVLocation" />
<plugin name="Accelerometer" value="CDVAccelerometer" />
<plugin name="Camera" value="CDVCamera" />
<plugin name="NetworkStatus" value="CDVConnection" />
<plugin name="Contacts" value="CDVContacts" />
<plugin name="Debug Console" value="CDVDebugConsole" />
<plugin name="Echo" value="CDVEcho" />
<plugin name="File" value="CDVFile" />
<plugin name="FileTransfer" value="CDVFileTransfer" />
<plugin name="Geolocation" value="CDVLocation" />
<plugin name="Notification" value="CDVNotification" />
<plugin name="Media" value="CDVSound" />
<plugin name="Capture" value="CDVCapture" />
<plugin name="SplashScreen" value="CDVSplashScreen" />
<plugin name="Battery" value="CDVBattery" />
<plugin name="Globalization" value="CDVGlobalization" />
<plugin name="InAppBrowser" value="CDVInAppBrowser" />
</plugins>
<access origin="*" />
</widget>
Yours might be smaller if you don't use all of the features of PhoneGap. You'll definitely need that InAppBrowser plugin however!