The latest version of our two starter apps for creating mobile applications for Salesorce are now live, and they come with some funky new features.
Sync / Connectivity Icon
We have a nice new icon that shows the current connectivity state of the device, and whether or not your app is currently syncing data to-and-from the Salesforce back-end.
This handy little icon can be added to your templates via a directive like this; no other work is needed;
<!-- Output a connectivity/sync-icon in the top right of our navigation bar -->
We’ve included example outbox functionality in the app for you to use as you see fit. There’s a template, controller and service all available for you to examine and make use of.
In our experience, having the transparency of the state of any records that might need syncing back to the platform is a real win when it comes to users trust in their mobile applications.
Unit Test Coverage
It’s not all about functional updates – we have also updated the skeleton unit-test setup to include code coverage reporting
The SyncSercvice (www/js/service/sync.service.js) is among other parts of the shell app to get some love. This update inlcudes;
- initialSync – This function gives you a nice easy call to make your app perform an initial synchronisation call to the platform. This call is lighter than the standard sync offered by this service. We’ve also added the neccessary code to the app.js to call this for you – so you don’t need to do anything more than configure the tables that you want to be synchronised. This config is specified at the top of the SyncService file.
- Event broadcasting – The sync service now broadcasts a handy set of messages to let the rest of the app know what’s going on. It lets us know once an initialSync has been completed, and also when each table has had it’s synchronisation completed, even when part of a multi-table sync operation.
We have also updated the LocalNotificationService to add a more structured solution to providing notifications to your users. The current code includes support to let the users know that they have records that need to be synced. The code to actually support this has been commented out by default (in the SyncService).
These updates are available in both our tabbed-navigation and side-menu navigation Ionic starter applications and can be used via the MobileCaddy CLI.