UpviseJS Device Services Integration Guide
Thanks to the nature of the UpviseJS framework, using native application on mobile devices, UpviseJS exposes a rich set of API to integration with great external application and services.
Most of it is exposed trough the App class. You can also query any existing data tables of an standard Upvise app like Contacts, Forms, Sales...
Start the Mail Compose App
To start the default mail application with a prefilled list of recipients and a subject, use the App.mailto(recipients, subject) method
App.mailto("john@gmailcom;terry@google.com", "My Subject")
Make a phone call
App.call("8586 93845")
Start SMS Compose App
App.sms("8586 93845")
Start the Map App
You can start the native map application on your phone by giving a address or also specify as a second parameter the geo coordinates as a lat,long formatted string. On the Web, it will launch Google Maps we site on another tag. Launching the external Map is useful to allow the user to find driving directions from their current location to the target address.
If you do not want to leave your application, you can instead use the Map class to embbeded a zoomable map within your app
App.map("1 infinite Loop California"); App.map("Custom Label", "32.4542,25.6644");
Taking a picture with Camera app
Start the Camera App and attaches the photo to an existing record id in a database table.App.takePicture("mytable", "myrecid");
Playing a YouTube video
Text To Speech
Push notifications
You can send push notification to other users in your account.
Notif.send(title, body, onclick, type, emails);
We plan to introduce push notification to Chrome browser and iOs later this year.
NFC Support
On Android phone, with NFC enabled, you can write to any NFC tag a function call defined in your application.
Then, when a user put its phone with Upvise installed on your NFC tag, the Upvise native app with automatically read the tag and launch your application by executing the callback function
found in the tag. Think as it as a shortcut or web link for your application.
Myapp.onNfc will be called when a user puts its phone on top the NFC tag that was written
Config.appid = "MyApp"; funtion MyApp() {}; MyApp.onNfc(date) { var msg = "The date the tag was written is: " + Fornat.datetime(date); App.alert(msg); } .... var callback = "MyApp.onNFc({Date.now()})"; App.writeNfc(vcllback);Query data tables from other applications
You can also query any existing data tables of an standard Upvise app like Contacts, Forms, Sales...
var contacts = Query.select("contacts.contacts", "id;email;phone;phone2;jobtitle"); var products = Query.select("sales.products", "*"); var forms = Query.select("forms.forms", "id;name;geo;address;value");