Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70764

Make an APP read file

$
0
0

@jcmendes98 wrote:

My question is that, if it is possible to get a variable from a .properties or .txt file. I need that in order to save the endPoint , the server IP address. That way, every time that the IP address is changed, all you need to do is change the IP on the file, instead of compile the code again and build the apk, and install it again on the device. Any tips will be welcome.

import { File } from '@ionic-native/file';
async test(){
this.promise = this.file.readAsText('file:///data/','ipAddress.txt'); 
await this.promise.then(value => {
console.log(value)
}).catch(error=> console.log("nao existe"))
}

Receiving the following error :

ERROR Error: Uncaught (in promise): FileError: {"code":1,"message":"NOT_FOUND_ERR"}

I do .checkDir and so, i know that the path is correct. Even though i can’t read the file.

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70764

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>