Skip to content

Commit

Permalink
Merge pull request #117 from stelselim/master
Browse files Browse the repository at this point in the history
[MOO-1090] Token Store's file storing functions updated.
  • Loading branch information
stelselim authored Aug 18, 2023
2 parents 82bcd1a + 02eae06 commit b6a492c
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 16 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ This project can be used to create a templated Phonegap Build package, as used w
- Windows: install from [nodejs.org](https://nodejs.org/en/download/)
- MacOS: use [Brew](https://brew.sh/) to install `Node.js`: `brew install node`
- Linux, BSD, etc: install using the available package manager, e.g. on Debian: `sudo apt-get install node`
- To customize the runtime behavior, include the following configuration: Set [com.mendix.core.SameSiteCookies](https://docs.mendix.com/refguide/custom-settings/#commendixcoreSameSiteCookies) to `None` in Studio Pro.
- Deploy and test the application using HTTPS.

### Build

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mendix/mendix-hybrid-app-base",
"version": "6.0.1",
"version": "6.0.2",
"description": "Mendix PhoneGap Build base package",
"scripts": {
"appbase": "node ./node_modules/webpack/bin/webpack --config ./webpack.config.appbase.js",
Expand Down Expand Up @@ -57,4 +57,4 @@
"devDependencies": {
"prettier": "^2.5.1"
}
}
}
4 changes: 4 additions & 0 deletions src/config.xml.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,10 @@
<application android:exported="true" />
</edit-config>

<edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application">
<application android:requestLegacyExternalStorage="true"/>
</edit-config>

{{#androidImages}}
<!-- Icon definitions - for more details: http://developer.android.com/guide/topics/resources/providing-resources.html -->
{{#density}}
Expand Down
21 changes: 9 additions & 12 deletions src/www/scripts/file-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
export default (function () {
var remove = function (namespace, key) {
return new Promise(function (resolve, reject) {
window.requestFileSystem(
LocalFileSystem.PERSISTENT,
0,
window.resolveLocalFileSystemURL(
cordova.file.dataDirectory,
function (fs) {
fs.root.getFile(
fs.getFile(
".mx-token",
{ create: false },
function (fileEntry) {
Expand All @@ -23,11 +22,10 @@ export default (function () {

var set = function (namespace, key, value) {
return new Promise(function (resolve, reject) {
window.requestFileSystem(
LocalFileSystem.PERSISTENT,
0,
window.resolveLocalFileSystemURL(
cordova.file.dataDirectory,
function (fs) {
fs.root.getFile(
fs.getFile(
".mx-token",
{ create: true, exclusive: false },
function (fileEntry) {
Expand All @@ -50,12 +48,11 @@ export default (function () {

var get = function (namespace, key) {
return new Promise(function (resolve, reject) {
window.requestFileSystem(
LocalFileSystem.PERSISTENT,
0,
window.resolveLocalFileSystemURL(
cordova.file.dataDirectory,
function (fs) {
console.log("file system open: " + fs.name);
fs.root.getFile(
fs.getFile(
".mx-token",
{ create: false },
function (fileEntry) {
Expand Down

0 comments on commit b6a492c

Please sign in to comment.