Ionic appflow live update doesn't appear on device - ionic-framework

I'm evaluating appflow as it'd be very useful for our project and would be keen to get one of the paid plans.
However, I don't seem to be able to get the basic live deployments working with my Ionic/Angular/Capacitor app, and I'm a bit at a loss as to how to troubleshoot.
I have followed the docs and installed the SDK in my app.
I can see the app id, channel name (Production) and update method (auto) in string.xml and info.plist.
I have successfully built the app in appflow (web build), and I can see on the deployments screen my build assigned to the production channel of type 'Live Update'.
I'm not seeing changes on device after the splash screen, so I've put together a screen using the 'Deploy' plugin to show me what version is installed, and if updates are available.
import { Deploy } from 'cordova-plugin-ionic/dist/ngx';
...
private async loadDeployInfo()
{
const info = await this.deploy.getCurrentVersion();
if (info) {
this.liveUpdateId = info.buildId;
}
const updateCheck = await this.deploy.checkForUpdate();
console.log(updateCheck);
if (updateCheck.available) {
this.updateAvailable = updateCheck.build;
}
}
I call the above 'loadDeployInfo()' when my view loads and display out the build Id and whether an update is available. Neither show up anything when testing on device. I'm using capacitor, so running locally involves running ngx cap commands and opening android studio, which is not a tool I know how to get debug information out of, but I'm not seeing any red in the console as it's running.
I'm a bit stuck. I'm keen to use app flow, but I'm not seeing basic live updates take effect and there's not much documentation on troubleshooting.

From Ionic forum posts I've managed to piece things together. The long and short of it is that the 'ionic deploy add' command doesn't seem to perform all the required configuration to make AppFlow work, at least on a Ionic/Angular/Capacitor based app.
Having followed the steps in the quick start guide here: https://ionic.io/docs/appflow/deploy/api
I needed to do the following:
To get Appflow going on Android, find 'strings.xml' in your Capacitor app's 'Android' folder and add the following if they are missing:
<string name="ionic_max_versions">2</string>
<string name="ionic_update_api">https://api.ionicjs.com</string>
<string name="ionic_min_background_duration">30</string>
For iOS, find your Capacitor apps 'ios' folder and look for 'info.plist'. Here you may find existing entries that look like they are coded to variables:
<key>IonApi</key>
<string>$UPDATE_API</string>
<key>IonMaxVersions</key>
<string>$MAX_STORE</string>
<key>IonMinBackgroundDuration</key>
<string>$MIN_BACKGROUND_DURATION</string>
Swap these $ variables for hard coded values:
<key>IonApi</key>
<string>https://api.ionicjs.com</string>
<key>IonMaxVersions</key>
<string>2</string>
<key>IonMinBackgroundDuration</key>
<string>30</string>
Update:
I logged a ticket on the git repo for the CLI, and they've updated it, so it may hopefully work for you without the above (make sure you've the latest ionic CLI).

Related

Upgrade Flutter debug build on device (using VSCode)

I have an app that is just for personal use. I can run it from VSCode directly (just run & debug). It saves its data onto its assigned "disk space" on the device. However, when I close the app and restart it (no longer connected to my dev PC), it starts up an old version of the app - obviously the one I last really installed on the device.
The only way I know to have the latest version on the device would be to deinstall it, then install it via devPC. Unfortunately, this deletes the local files of the app.
Is there a way to upgrade the installed version directly from the dev PC? I think it is possible to manually install the newest apk after I built it, but is there a way as easy as "run & debug", with the only difference that the latest version of the app starts when I restart the app?
There are no option to upgrade the app locally from PC. Every time you connect the phone and press Run & Debug, it will rebuild the app again.
In order to persist your data through different app versions, you should consider integrating some simple backend structure to your app.
You can think of creating a database which will provide you data every time you open the app. One easy option you can try is to integrate the Cloud Firestore in your app. You can follow this tutorial here to understand the implementation and feel free to ask if you need any further support.

I want to update the existing logo for my PWA app

When I am updating the logo of the PWA app the icon is not getting updated for the previously installed applications. However for newly installed apps I am getting the correct logo.
Did you try updating the new image icon in manifest.json & then showing a prompt to users to refresh the PWA?
You can try to have a look at the documentation for Android APK (from the question is not clear your target device: web or mobile).
Chrome will periodically compare the locally installed manifest against a copy of the manifest fetched from the network. If any of the properties in the manifest required to add the PWA to the home screen have changed in the network copy, Chrome will request an updated WebAPK, reflecting those new values.
This feature is not yet available for desktop, but planned in a future release.
Do you use any framework (Angular, React) to build your PWA? If you want to read more details about how to install an app on the homescreen or the web manifest properties, you can have a look here.

Can't link ionic app to ionic pro account

I have a monolith jhispter app and an ionic-jhipster app both working fine together (Thanks to Matt Raible and JHipster team). And I'm not sure if my problem has anything to do with JHipster.
Since I'm working on windows, I thought maybe I'd be better to use Ionic Pro cloud services to build my app for ios and Android. Please correct me if I'm wrong.
Here is the process I went through:
1-I added my Ionic app on GitHub. So, I'm using GitHub as my Source Control
2-I used "ionic ssh setup" command to create SSH public/private keys and I believe it took care of generating the keys and putting them in the right place I guess I didn't have to generate the SSH keys since it could work just by my user name and password too. Is that right?
3-I went to my app's folder and used "ionic link" to link my existing app to my Ionic Pro dashboard
4-In answer to existing app or new app (which was not clear to me what it's asking for), I chose new app since GaƫlMarziou helped me in the comments section to understand there should be an app already created in my Ionic Pro so I can link my local app to it. It took me a while so I understood this prompt is asking about the dashboard app not my local app. I chose "new" since it was the first time I was using my Ionic Pro account and I had no app on it.
5-Then it asked about the source control and I chose GitHub and provided the credentials
6-Then it showed me a list of my repositories on GitHub so I can choose one. But before I do anything it just jumped out with no error/success messages. And I considered it done since I had the same names for my app and GitHub repository and I thought maybe it was smart enough to find the correct repository.
Now, I can see an app in my Ionic Pro dashboard but the build and commit history is empty and it looks like the app is not linked yet.
I tried "git push origin master" to build my app when I was in my Ionic app folder. I assume "origin" would work for any git repository, am I right? It tells me everything is up-to-date and nothing happens in my Ionic Pro dashboard.

Do I need to make draft in google play console before I use Fastlane

Can you upload app in Fastlane command with android and Fastlane app in the google play console or I need to make draft in console before I do?
Fastlane unfortunately can not create an Android app from scratch, as it can with create_app_online (formerly known as produce) for iOS. Google just doesn't offer any API for that.
So yes, you have to at least create the app on the Google Play Console which usually includes uploading a first APK (so the Play Console knows about the package name [com.example.app] or your app) to one of the available lanes (which doesn't have to get published though).

The app could not be located

i integrated crashlytics into my unity game, everything worked fine, but then i had to change my package name and my working mail, since then whenever i open the dashboard it gives me an alert "Sorry the app could not be located".
I reinstalled the crashlytics sdk in unity, used new login in prepare fabric tab, but the issue is still there, although the crashlytics seems to be working.
Thanks. Usually this means we aren't detecting the build and run event. Please make sure you are building and running in the relevant IDE. Also, clean your app and dependencies in the native IDE to make sure the bundle ID is updated in all locartions. If you still run into issues, you will need to contact support as your app may be in a weird state in our system.