Ionic react Appflow live updates not working

Hi.
I am trying to use Appflow’s live updates, but it does not work.

my string.xmlis like following:

<?xml version='1.0' encoding='utf-8'?>
<resources>
...
  <string name="ionic_app_id">fbba1af6</string>
  <string name="ionic_channel_name">Master</string>
  <string name="ionic_update_method">auto</string>
  <string name="ionic_max_versions">0</string>
  <string name="ionic_min_background_duration">1000</string>
  <string name="ionic_update_api">auto</string>
</resources>

the log cat is like following:

I think the error comes from capacitor-runtime.js's parsing the JSON.

Any body help me?

Thanks.

Finally I got the message that live update cannot make with free account from Mr. Bryant Feld from Ionic Support. Please check your Ionic account if you cannot use live updates feature.
Actually, in the pricing page (https://ionicframework.com/pricing/compare), the free plan gives us Deploy 100 live updates / mo , but it is totally not true. You have to pay if you want to try live update feature.

Actually, the full solution is like follow:

I’m having issue with this, tried live update for hours and no progressing still.

this is my current strings.xml

 <string name="app_name">myappname</string>
  <string name="title_activity_main">myappname</string>
  <string name="package_name">com.myappname.app</string>
  <string name="custom_url_scheme">com.myappname.app</string>
  <string name="ionic_app_id">${my_appflow_app_id}</string>
  <string name="ionic_channel_name">Master</string>
  <string name="ionic_update_method">background</string>
  <string name="ionic_max_versions">2</string>
  <string name="ionic_min_background_duration">10</string>
  <string name="ionic_update_api">https://api.ionicjs.com</string>

this was generated with

ionic deploy add \--app-id="---" \--channel-name="Master" \--update-method="background"

but if I run ionic deploy add only without flags

I get this

  <string name="app_name">myappname</string>
     <string name="title_activity_main">myappname</string>
     <string name="package_name">com.myappname.app</string>
    <string name="custom_url_scheme">com.myappname.app</string>
    <string name="IonAppId">${my_appflow_app_id}</string>
    <string name="IonChannelName">Master</string>
    <string name="IonUpdateMethod">auto</string>
    <string name="IonMaxVersions">2</string>
    <string name="IonMinBackgroundDuration">30</string>
    <string name="IonApi">https://api.ionicjs.com</string>

you’ll notice that the names are Camel cased.

still, both formats are still not working for me…

help please. I even bought a subscription just to try this out :frowning:

I think it is weired. What version of Ionic are you using?

If you once deploy add, then you cannot ionic deploy add again with error [ERROR] Appflow Deploy plugin is already installed.. If you want to reset the configuration after ionic deploy add, then you have to ionic deploy configure.

You can check if the key value of the string.xml is valid by searching the keyword through the android project files. For my case, I can find the lines like follow in the IonicCordovaCommon.java.

j.put("updateMethod", getStringResourceByName("ionic_update_method"));

yes I do have that line in IonicCordovaCommon.java.

you’re right, I did ionic deploy add with flags once, but did not work the first time. So I revert my commit and do another one this time without those flags still no luck.

here’s my flow.

  1. Ionic build
  2. npx cap copy
  3. run in on my device
  4. make changes and push it to ionic master branch
  5. in the dashboard, I web build that commit to Master channel
  6. then I go back to my app and close it back open it back.

Am I missing something?

If you have line like j.put("updateMethod", getStringResourceByName("ionic_update_method"));, it means that your string.xml must have the value with key ionic_update_method not ionUpdateMethod. The key with camel case is somewhat weird. I’d like you to check the key name mentioned in the IonicCordovaCommon.java line by line. (If there is value missed, then your preference setup will not be completed. You can check about this in the logcat while your debugging with Android Studio.)

Also, I recommend you just put the following value in your string.xml manually. I guess following 6 values are related to the live update.

  <string name="ionic_app_id">${your_app_id}</string>
  <string name="ionic_channel_name">Master</string>
  <string name="ionic_update_method">auto</string>
  <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>

I tried the live update with another ionic app,

I worked, I have it on background method with 30 background duration.

what happens is, it take a while for the update to take effect.

when is the exact time that the update gets downloaded and update?

I tried the auto but it did not work for me. I was expecting it to hold on the splash screen, but it did not.

I am not pretty sure, but you can also guess that the default live update is done in background. It is not blocking process. I think the time to check and download the update is different for the environment like network status or something.
If you want to check for live update during the splash screen, then you’d better make your own splash screen and check the live update manually.