Right way to handle old versions of mobile app when your database schema has changed - ruby-on-rails

i have an ionic android mobile app which connects to a ruby on rails api server
and this app uses postgresql as database server.
whenever i create a new feature i deploy both, the api and the new app to the app store and bump the respective versions of api and the app, which have their own version numbering sequence.
The api is deployed to the server but app's on users devices are not frequently updated so below 2 cases arise for me
Case 1 : New columns additions
Issue happens for a release when for e.g i have few new columns added to certain tables in db to capture additional info for which respective text fields have also been added to the app's UI.
Here users of the newer version of app will work as expected (send those 2 info to columns) but the older versions will not be sending those 2 field values
Case 2: Columns deleted
for instance i am re-architecting the app in a major way and have to normalized the database as it was inefficient earlier which even leads to breaking of tables etc or deletion of a couple of columns.
Here the older versions of app would simply crash or fail to work.
i feel every business app i build will have this same scenario to manage and it should be common issue to all
I am in the process of writing some custom logic where the app would check when connected to api server for a "update flag" and if the app's version is set to
be force updated to make it work with api version then the app would be redirected to play/ app store.
i would like to know how everyone handle this problem and am i doing the right way.
Is there any rails plugin or library which already takes care of this particular problem
or helps in doing so.
i know there are lot of versioning gems available but they dont take care of this issue [force updating app]
Please guide

I've worked on a project where an API for configuration was called on the Android App Startup. This API would provide 2 fields: major_version and minor_version. If the major_version from the configuration API did not match the one on the App, there would be a popup asking you to force update the App. This would be on the Start-up Screen, so you won't be able to access the actual contents of the App unless you force update your app. If you do not want a force update between 2 app versions or 2 API versions, you have the option of tweaking the minor_version.

Related

Firebase ab testing - users with older app version counted in experiment

Does anyone know why are users with older app version which doesn't have new experiment in config counted as part of experiment? This is scenario:
I have app version 1 with experiment A with activation event for new users new_install
Then I create app version 2 and new experiment B with same activation event for new users new_install . I start experiment on firebase console.
Now I am waiting for app to be approved by apple appstore or starting rollout on android. Even before any user gets app version 2 I already see many users showing in experiment B on firebase console.
I would expect that users with app version 1 will be not part of experiment because remote config doesn't have default value for experiment B in app version 1 but it seems that because users are still installing app version 1 and new_install event is fired, they are counted as part of experiment B event when it's not in app version 1.
Is it feature? Bug? I am supposed to create custom activation event for every experiment?
That's actually easy to prevent - and good practice for A/B testing in general - just target users with at least given app version. Usually it will be version since you have remote config properly set up.
I would not rely on Firebase including or excluding users if they don't have remote config parameter. Today it might work differently than how it's going to work in a month. If there is no guarantee, just make sure you are targeting users who are properly set up.

Will my app update automatically or will user need to update the app when the code is updated?

I am creating a weather app and want to give local warnings to people through an app. I want to be able to give up to date warnings, but I am wondering: does updating information in Xcode get automatically pushed to the devices or will it need an update every time I put new information in?
If I understand your question correctly - you have an app, which warns people about some unexpected weather conditions?
You basically have two options:
Do a code push to your app every time you do a change. This is not supported by default in Swift and Xcode, and can only be done via some third-party integration or framework (e.g. React Native), and is generally a hard thing to implement.
Setup a back-end server and link it with your app, so the new information is downloaded from this back-end server dynamically.
The only suitable and easy thing to do for your use case seems to be option 2.

How do I access my azure database data from my xamarin mobile app?

I'm new to mobile app development, I've been tasked with making an app and so I'm now starting my voyage of discovery. I am coding the app in Visual Studio 2015 with Xamarin using a Mac Book Pro as the client for testing, all our data is stored in a database in our Azure portal. The app I am making is for iOS.
I've read the documentation but I'm getting stuck in certain areas and I think it's down to not understanding what is needed based on conflicting documentation or my own failure to grasp the concepts outlined.
All I am looking to do at the moment is have my app grab data from my azure database and display it in a list/table.
The steps I have taken so far are:
I have created a very basic app within visual studio with a
storyboard and a navigation item that points to a table view(where I'd like my data to be shown).
I created a Mobile App in my Azure account(as per documentation).
I have set the above mentioned mobile app to use my current existing database and supplied it with the username and password which all seems to be ok.
I am now at the point I need to get my app to talk to this mobile app and grab some data from my database. The todo example is ok but it's not quite enough to get me up and running or more specifically it's not in quite the right context for my setup and I think it's causing confusion.
There seems to be a few ways to set the project up for data access but I'm not sure what would be best.
Can anyone assist?
You are nearly there.
Instead of connecting directly to your database, you connect to your mobile apps API which then connects to your database, handles your request, and sends the data back to your app. You need to code this backend first so it is able to handle your requests. Take a look at this tutorial, it is really good :
https://learn.microsoft.com/en-us/azure/app-service-mobile/app-service-mobile-dotnet-backend-how-to-use-server-sdk
You will access your Azure Mobile App with the Azure Mobile Client SDK nuget package.
A complete guide to do this can be found here: https://developer.xamarin.com/guides/xamarin-forms/web-services/consuming/azure/
There is also this podcast: https://blog.xamarin.com/podcast-building-connected-apps-with-azure-mobile-apps/

iphone/ipad: how to push/notify about availability of new version of app

this is my first ios app. am working on a version 1 that i'm planning on giving to few of my customers. customers will get it from app store. in future, if i have new version that i'd like to notify current users, is there anything that I have to put in version 1?
thanks.
Yes, you will need to put something in version 1 in order to do this if you want some kind of notification in the app itself. You can go about it a few different routes depending on how complex you want it to be:
You could add push notifications to your app, so that you can send a push notification to your users letting them know an upgrade is available. You would probably only want to do this if you used the push notifications for other purposes as well, as users probably wouldn't want to allow push notifications for an app to only inform them of app updates.
You could have your app check with your server upon app launch to see if there's an update available. You could simply have a file on your server that the app checks which can contain the version number of the most up to date app you have available. If the server reports a newer version than the version reported by the app, it can display a message, which could also be contained on your server to be configurable. This would be pretty simple to implement, and could possibly contain other configuration information for your app. You could also choose when to show the prompt, in case you don't want to bug users for some updates but do for others. This would be good to do if you might release an update that requires users upgrade in order to continue to have it work with a backend server.
You can also get your app to check directly with Apple to see if a newer version of the app is available on the app store. You should be able to find a resource that will instruct you how to do this. Going this route, as soon as an update is available it will start bugging users to upgrade, so you may not want to do this if you only want to push some updates on your users but not others.
You can do nothing. On iOS 7 by default app updates get automatically installed, and even if they have that disabled, the user can see what app updates are available in their app store app. This is what most apps do, aka they don't bug the user every time an update is available. And if somebody isn't updating their apps anyway, your prompt won't necessarily encourage them to do it either.
It's similar to the message appearing in Chrome when a new version is available - something like "Chrome has just got better".
Presuming that you have a server side counterpart, my approach would be the following:
store the latest version number of your app somewhere on the server (database, configuration file, etc)
implement an API at server side that, upon an app version provided as parameter, returns true if an update is available
in your app, read the current app version (see this SO answer)
call the remote API mentioned in (2), and act accordingly if the return value is true
Note however that appstore notifies the user when an update is available - but that doesn't happen in-app
Incrementing the app version is enough for App Store notification as explained in
iPhone app Update Vs new version

Release an ios app update when content feeds are not live yet

I need to release an update to an iOS app. I want to release the app update exactly with the launch of the web site.
So what I was thinking of doing is:
- developing the new version of the app (using internal in dev feeds)
- change the feeds in the app in order to point to the new feeds (at this point the app won't have any content because the feeds are not live yet)
- submit the app to the app store (wait for Apple approval) and manually release the app when the site goes live (and at this point the feeds will be live)
The problem is that when the app is in the review process I won't have any content. Is it a problem for Apple?
They can approve an app without content?
What if I write a developer note to them?
I need to do this because when the new site goes live the new version of the feeds it's no compatible with the old version (different formats). I know it's not the ideal solution but this was not my decision.
As Rich pointed out, Apple would likely reject the app if the news feeds are a big part of the app and do nothing. If your desire is to release the app exactly when the website is launched and the news feeds are live, then while you're submitting the app there is an option to have it released on a specific date.
You could load up the back-end of the website without loading up the front-end. So have the php files loaded to the server and accessible from the app feeding it json data or however you are transferring information. If your back-end is interlaced with the front-end, you may have to re-write the files, name them the same thing, upload them to the server, have them be serving data so that they can test them, and then when you want to launch the site, overwrite the files with the full version. However, I'd imagine that your files capturing data from the database are differentiated from the ones presenting dynamic content, otherwise you are breaking the MVC paradigm and should probably change the way your website is structured anyway.

Resources