Giter Club home page Giter Club logo

hybrid-app-base's Introduction

Mendix PhoneGap / Cordova hybrid app base package

This repository contains the core files needed to build a Phonegap package for your Mendix application. It consists of two main parts:

  • The core source files for the hybrid app
  • The webpack configuration that is used during the build process

You should not use this package directly. Instead, refer to the Mendix PhoneGap / Cordova hybrid app template for instructions on how to customize and build your Mendix hybrid mobile app.

Building a templated Phonegap Build package

This project can be used to create a templated Phonegap Build package, as used within the Mobile Publish flow of the Mendix Portal.

Prerequisites

  • Recent Node.js. This code was tested with version 18. You can check by running node -v.
    • Windows: install from nodejs.org
    • MacOS: use Brew 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 to None in Studio Pro.
  • Deploy and test the application using HTTPS.
  • The scheme configuration in config.xml should not be changed to any value other than app for iOS.

Build

$ npm install                       # install dependencies
$ npm run appbase                   # create templated PGB package in `dist`

Mendix-specific forks of Cordova/Phonegap plugins

Mendix hybrid apps include a number of plugins by default. These plugins have been created by the Cordova/Phonegap community. For some of these plugins, we have created Mendix-specific forks. The reason for creating a fork varies per plugin. The list below outlines the details per forked plugin.

cordova-plugin-wkwebview-engine

We implemented XHR request handling using native code, while keeping support for cookies.

cordova-sqlite-storage

We included the SQLite native libraries.

phonegap-launch-navigator

We added support for cordova-android 7+.

phonegap-plugin-push

We unpinned the version of the Android support v13 library.

cordova-plugin-secure-storage

We added support for Android 10

hybrid-app-base's People

Contributors

cdcharlebois avatar diego-antonelli avatar feddovanede avatar gsteyn avatar jobvs avatar jogboms avatar kevinvlaanderen avatar mmehmetaliizci avatar mohannaresh avatar mulderwh avatar robinfr avatar smarki avatar stelselim avatar twiggler avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

hybrid-app-base's Issues

Online app default timeout of 5 second is causing client exception in the app

Hi, the timeout in the app is changed to 5 seconds now.

https://github.com/mendix/hybrid-app-base/blob/master/src/www/scripts/app.js line 152
server: {
timeout: enableOffline ? 30000 : 5000
},

Can this be increased to 30000 again? This will cause issue if the request is taking longer time or if we are uploding document of larger time.
I have to build custom app every time and it fails many times in the process. Also, custom build causes other unwanted issues in the app.

Use an app - logout - login - get an inifnite loader

The cause seems to be that sqlite database, which is opened via

store: {
  createStoreFn: function() {
    return window.sqlitePlugin.openDatabase({ name: "MendixDatabase.db", location: 2 });
  }
},

is not closed on window.onbeforeunload. Hence, when page is reloaded after logout, we try to re-open already opened database, which never succeeds.

npm run package fails for new builds

Hi guys,

I think this has something to do with the new PushNotifications release, but when I try to npm run package on a newly created package, I get an error about missing files in my .node-modules.

  1. Create package from Mendix Portal
  2. Unpack, open powershell in that location
  3. npm install
  4. npm run package

image

Statusbar overlay the webview and wkwebview

Hi, we've upgraded our hybrid app to the latest version that fixes the keyboard issue on iOS. However this new version introduces a new issue in our project which shows a white bar (20px) at bottom of the screen. This is because we enabled the statusbar to overlay the webview on iOS.

Can you confirm this issue or?

Error copy webpack because of missing before_build.js

Hi, after upgrading my project using npm upgrade the project fails to build using npm run package -- --env.target=acceptance.

The build fails because of error unable to locate 'before_build.js' at @mendix/mendix-hybrid-app-base/scripts/before_build.js.

Failed to fetch plugin @mendix/[email protected]

Hi, npm run platform failed because of missing plugin. I get the following error when creating new build:

Failed to restore plugin "@mendix/cordova-plugin-wkwebview-engine" from config.xml. You might need to try adding it again. Error: Failed to fetch plugin @mendix/[email protected] via registry.
Probably this is either a connection problem, or plugin spec is incorrect.
Check your connection and plugin name/version/URL.
Error: npm: Command failed with exit code 1 Error output:
npm ERR! code E404
npm ERR! 404 Not Found: @mendix/[email protected]

Building on phonegap runs into error

When using the new package (in combination with the new Push Notification setup) I run in to an issue when building the app on Phonegap:

image

The file is there as far as I can tell, below is a screenshot of my .zip contents:

image

Complete PGB log file:

    Build Date: 2019-01-08 12:38:29 +0000
--------------------------------------------------------------------------------
PREPARE OUTPUT
--------------------------------------------------------------------------------
Android Studio project detected
Generating platform-specific config.xml from defaults for android at /app/src/main/res/xml/config.xml
Merging project's config.xml into platform-specific android config.xml
Merging and updating files from [www, ../platform_www] to ../app/src/main/assets/www
  mkdir ../app/src/main/assets/www/cordova-js-src
  mkdir ../app/src/main/assets/www/cordova-js-src/android
  copy  ../platform_www/cordova-js-src/android/nativeapiprovider.js ../app/src/main/assets/www/cordova-js-src/android/nativeapiprovider.js (new file)
  copy  ../platform_www/cordova-js-src/android/promptbasednativeapi.js ../app/src/main/assets/www/cordova-js-src/android/promptbasednativeapi.js (new file)
  copy  ../platform_www/cordova-js-src/exec.js ../app/src/main/assets/www/cordova-js-src/exec.js (new file)
  copy  ../platform_www/cordova-js-src/platform.js ../app/src/main/assets/www/cordova-js-src/platform.js (new file)
  mkdir ../app/src/main/assets/www/cordova-js-src/plugin
  mkdir ../app/src/main/assets/www/cordova-js-src/plugin/android
  copy  ../platform_www/cordova-js-src/plugin/android/app.js ../app/src/main/assets/www/cordova-js-src/plugin/android/app.js (new file)
  copy  ../platform_www/cordova.js ../app/src/main/assets/www/cordova.js (updated file)
  copy  www/css/index.css ../app/src/main/assets/www/css/index.css (updated file)
  delete ../app/src/main/assets/www/img/cordova.png (no source)
  copy  www/img/error.png ../app/src/main/assets/www/img/error.png (new file)
  delete ../app/src/main/assets/www/img/logo.png (no source)
  copy  www/index.html ../app/src/main/assets/www/index.html (updated file)
  copy  www/js/bundle.js ../app/src/main/assets/www/js/bundle.js (new file)
  delete ../app/src/main/assets/www/js/index.js (no source)
  copy  www/settings.json ../app/src/main/assets/www/settings.json (new file)
Wrote out android application name "TESTkompas" to /app/src/main/res/values/strings.xml
android-versionCode not found in config.xml. Generating a code based on version in config.xml (5.0.0): 50000
Wrote out Android package name "nl.enexis.vhk" to /app/src/main/java/nl/enexis/vhk/TESTkompas.java
Updating icons at ../app/src/main/res
  copy  res/android/icon-72-hdpi.png ../app/src/main/res/mipmap-hdpi/icon.png (updated file)
  copy  res/android/icon-36-ldpi.png ../app/src/main/res/mipmap-ldpi/icon.png (updated file)
  copy  res/android/icon-48-mdpi.png ../app/src/main/res/mipmap-mdpi/icon.png (updated file)
  copy  res/android/icon-96-xhdpi.png ../app/src/main/res/mipmap-xhdpi/icon.png (updated file)
  copy  res/android/icon-144-xxhdpi.png ../app/src/main/res/mipmap-xxhdpi/icon.png (updated file)
  copy  res/android/icon-192-xxxhdpi.png ../app/src/main/res/mipmap-xxxhdpi/icon.png (updated file)
Updating splash screens at ../app/src/main/res
  copy  res/android/screen-hdpi-landscape.png ../app/src/main/res/drawable-land-hdpi/screen.png (updated file)
  copy  res/android/screen-ldpi-landscape.png ../app/src/main/res/drawable-land-ldpi/screen.png (updated file)
  copy  res/android/screen-mdpi-landscape.png ../app/src/main/res/drawable-land-mdpi/screen.png (updated file)
  copy  res/android/screen-xhdpi-landscape.png ../app/src/main/res/drawable-land-xhdpi/screen.png (updated file)
  copy  res/android/screen-xxhdpi-landscape.png ../app/src/main/res/drawable-land-xxhdpi/screen.png (updated file)
  copy  res/android/screen-xxxhdpi-landscape.png ../app/src/main/res/drawable-land-xxxhdpi/screen.png (updated file)
  copy  res/android/screen-xxxhdpi-portrait.png ../app/src/main/res/drawable-mdpi/screen.png (new file)
  copy  res/android/screen-hdpi-portrait.png ../app/src/main/res/drawable-port-hdpi/screen.png (updated file)
  copy  res/android/screen-ldpi-portrait.png ../app/src/main/res/drawable-port-ldpi/screen.png (updated file)
  copy  res/android/screen-mdpi-portrait.png ../app/src/main/res/drawable-port-mdpi/screen.png (updated file)
  copy  res/android/screen-xhdpi-portrait.png ../app/src/main/res/drawable-port-xhdpi/screen.png (updated file)
  copy  res/android/screen-xxhdpi-portrait.png ../app/src/main/res/drawable-port-xxhdpi/screen.png (updated file)
  copy  res/android/screen-xxxhdpi-portrait.png ../app/src/main/res/drawable-port-xxxhdpi/screen.png (updated file)
Updating resource files at ..
  copy  google-services.json ../app/google-services.json (new file)
Error: Source path does not exist: build-extras.gradle
    at updatePathInternal (/cordova/node_modules/cordova-common/src/FileUpdater.js:145:19)
    at /cordova/node_modules/cordova-common/src/FileUpdater.js:223:19
    at Array.forEach (native)
    at Object.updatePaths (/cordova/node_modules/cordova-common/src/FileUpdater.js:221:33)
    at updateFileResources (/cordova/lib/prepare.js:432:17)
    at /cordova/lib/prepare.js:51:9
    at _fulfilled (/cordova/node_modules/q/q.js:834:54)
    at self.promiseDispatch.done (/cordova/node_modules/q/q.js:863:30)
    at Promise.promise.promiseDispatch (/cordova/node_modules/q/q.js:796:13)
    at /cordova/node_modules/q/q.js:604:44

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.