I'm facing an issue with my Phonegap .apk
file after building it on their platform. The problem lies with axios
not functioning properly, although it works fine in my Desktop Phonegap App
. I'm unsure of the root cause behind this, could it be related to the usage of axios
?
Technologies:
Axios
, VueJS
, Phonegap
This is how my index.js
appears:
Vue.directive('focus', {
inserted: function(el) {
return el.focus();
}
});
var apiURL = 'http://stishs-grade-and-progress-report-monitoring-system.cf/',
tokenString = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz';
var Authentication = Vue.component('sti-main', {
data() {
return {
username: '',
password: '',
error: {
flag: false,
message: ''
}
}
},
template: `
<main>
/* code block truncated for brevity */
</main>
`,
created: function() {
var authToken = localStorage.getItem('stishTokenAPI')
if(authToken != null && authToken.split('&')[2] == 3) {
var authData = `method=check&0=${authToken.split('&')[0]}&1=${authToken.split('&')[1]}`
return axios.post(`${apiURL}sti-api/authentication.php`, authData).then(function(response) {
var authenticated = response.data
/* additional logic here */
});
}
},
methods: {
hideNotif: function() {
return this.error.flag ? this.error.flag = false : true
},
generateToken: function(generateToken = '') {
/* code block truncated for brevity */
},
signInProceed: function(user, pass) {
/* code block truncated for brevity */
}
}
});
new Vue({
el: '#auth'
});
This is the structure of my index.html
:
<!DOCTYPE html>
<html>
<head>
/* code block truncated for brevity */
</body>
</html>
This is how my config.xml
looks like:
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.phonegap.helloworld" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:gap="http://phonegap.com/ns/1.0">
<name>sti-mobile-app</name>
<description>
A blank PhoneGap app.
</description>
<author email="[email protected]" href="http://phonegap.com">
PhoneGap Team
</author>
<content src="index.html" />
<allow-navigation href="*" />
<allow-intent href="*" />
<access origin="*" />
</widget>