running two ionic 3 apps on the same device - ionic-framework

The issue can be replicated with the tutorial templates. I installed the blank and sidemenu templates using the CLI: ionic start First blank and ionic start Second sidemenu. If you build and put them on a device the following problem occurs.
The problem occurs only on iOS. If you start one of them, when you minimize it (by pushing the phone button), if you immediately start the 2nd app (in the first 5 seconds after you minimized the 1st app - i think it's because of the iOS app lifecycle that sends the app to background after 5s) then the 2nd app starts the first app. But if you wait 5 seconds after minimizing the first app and then start the second app then it works, the second app actually starts.
I tested this on ionic 3.9.2
a) Ionic CLI 3.20.0, Cordova CLI 8.0.0, Node 8.11.1, npm 5.6.0, windows 10
b) Ionic CLI 3.20.0, Cordova CLI 8.1.1, Node 8.11.2, npm 6.4.1, macOS Sierra
Is there a solution for this? Can I have two Ionic 3 apps installed on the same iOS device and when I minimize the first one if I immediately start the second one it will actually start the second one and not the first? What can I do? What options do I have?
Thank you.

Related

IONIC error with NPM (deprecated warning)

in my old ionic version i was able to run and install ionic properly.
but while creating a new project in ionic i get this error
please help me out.
C:\>ionic start
Every great app needs a name!
Please enter the full name of your app. You can change this at any time. To bypass this prompt next time, supply name,
the first argument to ionic start.
? Project name: sumith
Let's pick the perfect starter template!
Starter templates are ready-to-go Ionic apps that come packed with everything you need to build your app. To bypass this
prompt next time, supply template, the second argument to ionic start.
? Starter template: blank
√ Preparing directory .\sumith - done!
√ Downloading and extracting blank starter - done!
Installing dependencies may take several minutes.
* IONIC DEVAPP *
Speed up development with the Ionic DevApp, our fast, on-device testing mobile app
> npm i
npm WARN deprecated circular-json#0.5.9: CircularJSON is in maintenance
only, flatted is its successor.
[ ..............] / fetchMetadata: sill resolveWithNewModule
punycode#2.1.1 checking installable status
set NODE_TLS_REJECT_UNAUTHORIZED=0 before running ionic start.

(Ionic Deploy) My App Starting Screen is Very Slow Open

My project is very slowly opening with Ionic Deploy.
Starting time (Without Ionic Deploy): 00:09 seconds
Starting time (With Ionic Deploy): 00:24 seconds
ionic cordova build android --prod --release
Why is this happening? Is this happening to you too?
If you are downloading the deploy update during app startup, that can slow down start times. The Ionic Deploy service must check if there's an update, download the update and then unzip it.
The other options would be to 1) download/unzip the update during app usage and then show users the update next time they open the app or 2) write a custom installation scenario. I would suggestion option 1.
https://ionicframework.com/docs/pro/deploy/

How to get Ionic Pro Deploy to download latest version on first app open

Problem
When I release a new version to the production channel in Ionic Pro Deploy (Channels) then I have to cycle my app twice in order to get the latest version. Even worse, on the first cycle my app reverts back to a far earlier version for some reason.
What I mean by cycling is, starting from a state where the application is shut down and not open, I open the app, wait for the splash screen to go away and app to be ready, and then close the app.
Question
How do I get my app to download the latest version on the very next time I open the Ionic app following my production release?
Plugin configuration
I used the plugin config from the dashboard.ionicjs.com page:
cordova plugin add cordova-plugin-ionic --save \
--variable APP_ID="[myappid]" \
--variable CHANNEL_NAME="Production" \
--variable UPDATE_METHOD="background"
Execute the command you already showed but set UPDATE_METHOD to "auto"
If you wand more control over your updating methods have a look at this:
https://ionicframework.com/docs/pro/deploy/plugin-api.html
In my case, live deploy worked correctly on a "blank" Ionic project. Live deploy also worked correctly on "my" app on iOS but not on Android.
I followed the follow steps and successfully fixed Android. However, during this process iOS suddenly had the same problem (would apply update on app install/close/open).
Set versions as per Ionic support. IonicPro live deploy currently requires these versions. Ionic are in the process of fixing this dependency:
"cordova-plugin-ionic-webview": "1.1.19",
"cordova-plugin-ionic": "4.1.7",
Install a new version of "blank" project. Update my app to use the same npm plugin versions (some of my app plugins were old).
Remove/add android platform. My hunch is this is what ultimately resolved the issue.
I wanted to try a remove/add ios platform to see if that also resolved the issue on iOS. But it was less work to ultimately switch over to IonicPro rather than re-config the local build setup.
Live deploy worked correctly on both iOS and Android after creating binaries in IonicPro.

Ionic serve / ionic run not reflecting changes

Both ionic serve and ionic run are not reflecting any of my latest changes. ionic serve is showing them from a few hours ago, and ionic run is showing them from about an hour later. Since then, I've discarded all my changes, and created a new branch from the parent--yet it's still showing those same versions from a few hours ago on the first branch. In short, there's code showing up that I don't have in any files in this, or any, branch. And no uncommitted changes.
Your system information:
Cordova CLI: 6.5.0
Ionic CLI Version: 2.2.2
Ionic App Lib Version: 2.2.1
ios-deploy version: 1.9.0
ios-sim version: 5.0.8
OS: macOS Sierra
Node Version: v6.10.1
Xcode version: Xcode 8.3.1 Build version 8E1000a
I've tried things including ionic state restore and ionic state reset as well as removing and adding platforms back manually.
Also, this is what shows up in my console currently:
Static file server running # http://localhost:8000/index.html
CTRL + C to shut down
200 /service-worker.js
Whereas it previously displayed a list of html, css, etc. requests when the page loaded. Currently, I can make it work as expected by unregistering and removing all ServiceWorkers at chrome://serviceworker-internals/ and chrome://inspect/#service-workers
#stephen, it's been some time now, but I faced a similar issue before. Turns out I had registered the service worker that ships with projects created with the CLI, check your index.html and see if the lines that register the service worker are commented out. If they are you may be having a different problem, if they aren't and you didn't plan to use a service worker, comment them out again, and on your browser (you said chrome), after running ionic serve, open "Inspect" (Ctrl+Shift+I), go to the "Application" tab - "Service Workers" and unregister it.
This happens because the service worker that ships with new projects created using the cli will cache all resources, next time you update your code the browser will load the previous version, that's why you don't see the changes.
Hope it helps
Open the developer console, right click on the button to reload the page and click on empty cache and reload in a forced way (Last option).

ionic v2 error ionic view

I'm developing an ionic v2 app but even working on ionic lab it gets a complete white screen on the ionic view. If I do the same withe the ionic v1 it works.
ionic start sample --v2
cd sample
ionic lab
ionic upload
It shows white but
ionic start sample
cd sample
ionic lab
ionic upload
It works perfectly. No changes on the code at all
Thanks
ionic 2 needs at least 4.4 android to work, lost a lot of time on this and there is nothing on the ionic website informing about that. Writing down here to help anyone in the future.
Ionic v2 supports android 4.4 and up. The older browser on pre-4.4 devices do not have the features needed for ionic2 and angular 2 to work. Though this can be fixed with crosswalk.
The supported platforms are list here:
http://ionicframework.com/docs/overview/#browser-support
You can go back to 4.1 with crosswalk it states.
ionic 2 needs at least 4.4 android to work,.. for more info debug app in chrome.
from ionic 2 Ionic officially stops to use ionic lab.
You can run and test your app in browser using command "ionic serve".
Ionic2 app was initially created with --v2 flag but now they removed it . So nothing happens with --v2
Better way to solve the code 1st time by running directly into android devices by
Ionic cordova run android or
Ionic run android
Then connect your device with your system and open chrome and enter chrome://inspect to the url
Now you can console log the the error and can find the way of solutions.
Now try to run by ionic view
Remove the platform and then add it again.
please try eionic start sample --type=ionic-angular