Firestore and Changing Document Models in an App - android

So we have an app that interacts directly with Firestore. In both queries for documents, creates new documents, updates, listens for changes, etc.
So we have one version of our app live. The question becomes how we can modify the model in the database, for example, adding a non-optional field, without breaking the functionality of the current apps that are installed on people's phones.
All I can think of for now is to require to be on the latest version, or perhaps the latest without a breaking change, in order to log in to initialize firebase - by using a major.minor.patch, and update the major whenever there's a breaking change.
Is there a smoother way to do this? I am more familiar with the backend and web, so not sure what's considered a best practice in this case.

The simplest solution I can think of would be to add the version of the app into a document in the database, and each time you open the app, check that value against the one in the app's code. If there is a match, it means that no update is required, otherwise, "force" the user to update the app to the latest version by opening the app's page from Google Play.
Another solution might also be to use Android In-app updates:
When your users keep your app up to date on their devices, they can try new features, as well as benefit from performance improvements and bug fixes. Although some users enable background updates when their device is connected to an unmetered connection, other users might need to be reminded to install updates. In-app updates are a Play Core library feature that prompts active users to update your app.
So it's up to you to decide which one is better. Please note, that if you'll use the first one, you'll have to pay for a document read, each time a user opens the app.

Related

Notification when there is an update

I have been looking for a while to send a message to a user when there is a new version of the app is released. When I upload a new version to the Appstore or GooglePlay a message should appear when the user opens the app, but does not have the latest version that will allow user to easily update the app.
Do you guys have any solution for this? It`s for IOS and android.
There are several ways to approach that problem.
Send remote notification for each user about new version being available. Problem with this solution is you have to get user's permission first, but it will be definitely the most convenient one to use.
In-App updates:
For Android: https://developer.android.com/guide/playcore/in-app-updates
For iOS: you will have to build similar logic on your own. You will need a server-side logic - just a file exposing latest version string. Then on iOS when user is launching the application, you can compare users version with that file - and if it's different, show a custom popup telling user there is a new version available and link to AppStore.
Problem here is that user has to launch the old version - which will not give you similar results as remote notifications, which will be shown without user opening the application.
I think the best solution would be to do both and cover all cases. Remote notifications will be definitely nicer way to do that for users that allows you to do so, rest of the users will be notified inside application itself. Just make sure to not notify user about update each time they open the application if they don't update it - best approach here will be to do it once per version maybe or even better make your version file to define it update is something really crucial and should trigger a popup.

Is it possible to update android app from private server while running?

I have to develop some specific software, which sometimes can't connect to the App store, but I will have to send some updates. this software can be restarted but it needs to check for updates itself and download it, so I am looking for ways to update like Facebook is doing for example. Change its own package and restart, but I could not find any helpful information or SDK to do so. What is the right way to do so? How can I achieve that.
edit: I have seen some solutions. One is having 2 apps (1 updater and 1 main app, it is ok but I am looking for a bit more flexible ways if possible). And SDK-s just send you to the download page, but I need my app to download and install it itself (This software will be used as a middlware controlling app for IPTV devices, so there is no security issues in terms of not notifying user about update, I'll handle it with popups)
There is an API in android for update apps. It is called In-app Updates.
Basically, it has two options:
Flexible: The user choose if he wants to update the app or not
A user experience that provides background download and installation with graceful state monitoring. This UX is appropriate when it’s acceptable for the user to use the app while downloading the update. For example, you want to urge users to try a new feature that’s not critical to the core functionality of your app.
Immediate: The app shows a screen where the user must be update the app
A full screen user experience that requires the user to update and restart the app in order to continue using the app. This UX is best for cases where an update is critical for continued use of the app. After a user accepts an immediate update, Google Play handles the update installation and app restart.
In your case, you can use the "Inmediate" option
References:
https://developer.android.com/guide/playcore/in-app-updates

Android App Version Fragmentation - How To Handle?

About half a year ago we released a huge update to the app, and with this introduced new permissions to the app (GPS / Bluetooth related, etc)
Half a year is plenty of time for users to update, however in Google dev console we still shows a large percentage, about 30% of the user base still using the old version.
I'm assuming this is due to
New Permissions require Manual updates, users must to hit 'Accept' before installing the
update, and new update is being bypassed by Auto-Update
Some users have disabled Auto-Update and never update at all
Probably some percentage of old / abandoned devices
We're looking to address #1 as we experienced that making changes to app's permissions creates fragmentation pockets within the user base.
A potential solution would be to show a periodic "in-app" notification prompting users to update. But the problem is how to release an app update only reaching those old version users without impacting current users, as we cannot remove new permissions.
A hypothetical approach would be an in-between update, but the dev console does not allow lower app versions.
Are there any solutions available for reaching stuck users on old versions, or any work arounds that could be recommended?
New Permissions require Manual updates, users must to hit 'Accept'
before installing the update, and new update is being bypassed by
Auto-Update
I don't think you can bypass the prompt for the manual acknowledgment.
My best practices for using adding new permissions are:
Always adding creative release notes to explain why I need these permissions, so the user will download the update.
Luckily with Android M your users won't experience this
Are there any solutions available for reaching stuck users on old
versions, or any work arounds that could be recommended? Thanks!
Once a user is lost, it is very hard to get them back.
You can use your analytics to determine which popular devices are using your old app version.
Depending on the time/resources you have, multiple apks and segmentation based on devices can help you in this situation.
http://developer.android.com/google/play/publishing/multiple-apks.html
A potential solution would be to show a periodic "in-app" notification
prompting users to update.
This logic can live client side and if done right users running your current version do not see that.
Hope this helps or leads you in the you are hoping for.
In the past I managed this sort of situation by having the app periodically check-in with my backend server to report the app version number. The server would check the app version number against what the server supports and if an upgrade was required the server would return a message that the app would then prompt to the user asking them to update. Obviously that doesn't help you with your existing 30% of users but it might help in the future.
I would also think it would help to release an update that targets Marshmallow and then you could use the newer permission model and prompt users for what permissions you need. I would think that would then allow the 30% on the older version of your app to auto-update or update without having to confirm permission changes in the play store. Those users would then be prompted in the app for whatever permissions you require.

Best method of rolling out updates for a developed app not on the google play store

HelloNot sure if this is really the best place to ask but I was wondering if anyone has any good suggestions on rolling out updates for apps that have not been published on the google play store? I create apps to be used in house by other members of staff at my work place and there's either no need for the apps to be put on the play store or the apps that have been created are for private use only.Currently i'm having to either email new versions of the apps to members of staff who then have to delete the old versions from their phones or I have to get hold of their phones and install the newer version from eclipse everytime I create a new version Obviously this is not ideal so I was wondering if anyone has any suggestions on how I could easily roll out updates to the phones with the apps installed??
Basic idea of auto-update is putting your new software somewhere your application know and can download from. Obviously you will need some sort of versioning in your application. Application should check for updates periodically, and if the online version is newer than current version it should download and update preferably by asking to the user if he/she wants to update.
Commonsguy has a library for this. It is a suspended project but it should give you the basic idea and you can even write your own library after that. cwac-updater here you go.
Make an update module in your application, that periodically polls a server to check for updates. Keep in mind that you have to do this in a battery-efficient way so as not to drain the battery of the user.
Another option could be using GCM. Look it up. When you have an update, just send a message to all the devices to prompt the user to download the new version.

Android: Notify user of a newer version

I am finding alot of users for some reason are not upgrading my application when new versions come out.
Is there a way for my application to query the Marketplace application and then notify the user if a newer version is available ?
Personally I don't think it's quite that black and white. Lets say you've made a mistake somewhere in your app. You fix it and deploy to market. But you see from your crash reports that there are old versions out there and same users keep on using this app. If the same user keeps on using the app, wouldn't they rather use a version that does not crash? At some point they uninstall and log their rating as "zero stars, useless had to uninstall" - even though the problem is already fixed.
I agree that it is not a good idea to create duplicate logic that just notifies users about newer versions being available - but sometimes it makes sense to add a little extra notification telling users that updating is for their own good.
One solution, that I just came across today, addressing this issues, is from crash report service Bugsense. It allows to you send a notification to users that a certain error he/she has encountered has been fixed. I think it's just good service and tells users that development has not stopped.
I am finding alot of users for some reason are not upgrading my application when new versions come out.
To echo the comments, users are not compelled to upgrade your app.
Is there a way for my application to query the Marketplace application and then notify the user if a newer version is available ?
No.
Your application can query your own Web server, where you publish version information. However, you need to be a bit careful about this, as there are multiple Market servers, and not all receive updates simultaneously, AFAICT. IOW, I would use this as more of a fall-back mechanism, to perhaps do a one-time "hey, don't forget, there's an update available" notice perhaps a week or two after you publish your update.
The best would be to have a DB field with the current version on your server, and check the app version with the version mentioned in the back-end server every time the app loads.
But as CommonsWare mentioned, it might irritate some users.
Another possibility is to have an Check for Update button as I do inside the app itself.
Hope this helps....

Categories

Resources