How to Search the Database by Date From Server-side JavaScript

Posted: January 19th, 2017Author:

clock

Searching or querying a database is one of the most common actions in a mobile app. Appery.io platform provides a cloud database to store any app data and Server Code that allows to write any server-side app logic using JavaScript. Server Code has an API to query the database that makes it easy to perform search queries based on a date. In this blog post you will learn how to write a script to query a database collection using dates.

To start, we need to create a sample database collection. Our collection looks like this:

Database collection

Database collection

The collection has two built-in date columns:

  • _createdAt – the time when a record was created
  • _updatedAt – the time when a record was updated (default value is set to _createdAt)

and two custom columns, both are of Date type:

  • startTime
  • endTime

You can of course include any other data.

Now let’s get to the code.

The first code examples shows how to query by using the built-in fields (_createdAt or _updatedAt).

This search query will return all objects where the _updatedAt date is less then ($lt) the current time (when the script runs).

When using one of the built-in data types in a query (_createdAt, _updatedAt), the date value must be formatted in ISO format. When using a custom column with Date type, using ISO format is not required.

The next code examples uses a custom endDate column (type Date). Note that the syntax to use the built-in date column (above) and a custom column is slightly different:

This query returns all records where the endTime is less than December 31, 2016. Based on data in the collection, only the record that contains tablets will be returned. This is how the response looks:

Let’s now look at another code example where we will use the startTime and endTime together.

In the following code snippet we query for all objects where the startTime is greater than December 31, 2016 and the endTime is less then February 1, 2017.

Querying the database by dates or any other columns is best suited for server-side logic as you can test the script and ensure it works before using in an app. Moving this logic to the client would only complicate the app and make it more error prone.

Once the Server Code script is tested and read you can import the service API for it inside the App Builder. This short video shows how to import a backend service. To learn more about Server Code, watch the Server Code YouTube playlist videos.

Convert Phone Numbers Into Real Business Intelligence with EveryoneAPI

Posted: January 18th, 2017Author:

old_telephone

EveryoneAPI by Telo allows to convert a phone number into real business intelligence with a simple API request. The complete reverse phone append product is simple to use, yet powerful and built for developers by developers. As you probably already know, integrating with any 3rd party REST API using the Appery.io Server Code is also simple. In this blog post, I will show you how to invoke a test a script that calls the Everyone API.

To start, create a new Server Code script with the following code:

The only thing you need to do, is to replace the auth_token and account_sid with values from your account. Sign up for an account here. It’s fast and simple.

The phone number for which you want to get information is passed as a parameter to the script (line 1). To test the script, switch to Script parameter tab (on the right side), enter a parameter called telephone and then set it to a test value. Here is an example testing the API using the Appery.io telephone number:

Testing EveryoneAPI

Testing EveryoneAPI

Once you finished and tested the script, you easily import into your app. This video shows how to do that.

Looking for more APIs by Telo? Check out the CallerID Server Code plug-in:

callerid_servercode_plugin

OpenCNAM plug-in

This plug-in creates a Server Code script that integrates with OpenCNAM API. The OpenCNAM API allows you to get caller ID information for phone number provided.

Appery.io Newsletter (December 2016)

Posted: January 17th, 2017Author:

Happy New Year!

Platform News

Our Apache Cordova library update with iOS 10 support is coming by the end of January. Please check if you need to update the jQuery Mobile App Library version in your app before this update.

Appery.io Mobile Resources You Should Know in 2017

To help you build mobile apps faster in 2017, we have published all the Appery.io resources you should know about and use. Check out the list here.

A Quick Guide to Using Geolocation in Your Mobile App

We published two short videos that show you how to set up and the use Geolocation API in jQuery Mobile and Ionic apps.

GoCodes Extends Asset Tracking Solution to Android Devices with the Help of the Appery.io Platform

GoCodes provides a complete patented asset and inventory tracking solution that harnesses the power of cloud-based software, smartphones, and QR codes. When GoCodes launched in 2012, their mobile apps were limited to HTML5 browser technology and lacked the power and ease-of-use of true mobile apps. Learn how GeoCodes built a native app with Appery.io.

Appery.io Platform Overview: A Guide for Mobile Developers

Learn about Appery.io platform features and benefits from this short video. This is a great guide for mobile developers, whether they are existing Appery.io developers or just starting out. Watch the video now.

Appery.io Videos

We have close to 200 short videos conveniently organized into playlists. Check them out.

Learn How to Use Server Code Snippets

Learn how to use Server Code Snippets for faster server-side JavaScript development and learn about the new FullContact API integration.

Appery.io Mobile Resources You Should Know in 2017

Posted: January 16th, 2017Author:

happy2017

Happy New Year!

As we are starting 2017, we want to let you know about all the Appery.io resources available to you, to help you build you app faster and easier. These resources are being updated with new content all the time, so we definitely recommend subscribing to updates or following them. This way you will be always up to date with what is happening. Let’s get to the resources.

Developer Documentation and Portal (http://docs.appery.io)

The docs site is the most important resources (obviously). The docs site contains the platform documentation, tutorials, and API reference section. We regularly update the content on this site. If you find a typo or an error, please use the Suggest Edits feature to tell us about it.

The docs site has a blog section (http://docs.appery.io/blog) where we usually post technical information such as API updates or library updates. The information is usually very technical and specific so it doesn’t go on the main blog. We will also post links to tutorials and videos.

The Appery.io blog (http://blog.appery.io)

The blog is one of the most important resources you should read. This is where we post platform updates, announcements, new videos, new tutorials, case studies and anything else. We definitely recommend you follow the blog to stay up to date. Following the blog is very simple. You can subscribe via the RSS feed or subscribe via email (you will get an email every time a new post is published).

YouTube Channel (http://youtube.com/apperyio)

This is our most popular resource. Our YouTube channel has over 200 short videos on various topics to help you build apps faster. Definitely subscribe to get updates when we publish new videos. The videos are organized into playlists:

Most of our videos are no longer than 15 minutes. This allows you to learn about a topic, feature or benefit very fast and you won’t be bored through an hour long example.

Community Forum (http://appery.io/forum)

Our community forum is the place to get help, ask questions and help your fellow Appery.io developers.

Platform Status Page (http://status.appery.io)

Appery.io platform status page shows each platform component and its current status. It’s important to bookmark or follow this page via RSS to always know the status of each component.

Twitter (http://twitter.com/apperyio)

Twitter is where we post important announcements, platform updates, new tutorials, case studies, new videos and anything else. We recommend to follow up on Twitter to always stay up to date.

Facebook Page (http://facebook.com/apperyio)

Facebook is very similar to Twitter. On Facebook we post important announcements, platform updates, new tutorials, case studies, and new videos. We recommend to Like us Facebook to always stay up to date.

LinkedIn Company Page (https://www.linkedin.com/company/appery-io)

On our LinkedIn Company Page we post announcements, new tutorials, case studies, and new videos.

Google+ Page (https://plus.google.com/u/0/104276681162289155352)

Yes, we are still on Google+ :).

Instagram (https://www.instagram.com/apperyio/)

This is a new resource and we will be posting a lot more in 2017.

What’s New Panel

And a bonus resource is our What’s New panel. The What’s New panel can be opened from any platform page from the header. The panel shows you the most recent updates, tutorials, and videos. Check this resource often to learn what’s new.

whatsnew-panel

 

App Metrics You Need to Know: A Guide for Mobile Developers

Posted: January 13th, 2017Author:

metrics_you_need_to_know

A guest blog post by Vasily Malyshev (Messapps)

Perhaps the best way to run a business is to run it mathematically. Knowing all your business metrics will allow you to not only better predict your revenue but also understand what you can do and how much you can invest to further multiply your revenue. In my role as CEO of an app development company, Messapps, I have worked on over 50 different applications and found that knowing the following metrics is absolutely essential if you want to be a successful “appreneur”.

1. Downloads

What it is: Number of downloads represents the number of unique app store accounts that have downloaded your app. That means that if the same person downloads the app 10 times it will still be displayed as 1 download. The exact number of downloads is always shown in your app store analytics.

Why it is important: Ok, that’s a no-brainer. How many people download your app is the most basic and the most important metric. If downloads are at 0 then all other metrics simply don’t exist. You need to get those users first in order for your app to start earning money. No matter which monetization method you’ll choose.

That being said, it is important to note that number of downloads can also become completely meaningless if nobody is using the app after the initial download.

Read the rest of this entry »

GoCodes Extends Asset Tracking Solution to Android Devices With the Help of Appery.io Platform

Posted: January 12th, 2017Author:

GoCodes provides a complete patented asset and inventory tracking solution that harnesses the power of cloud-based software, smartphones and QR codes. When GoCodes launched in 2012, their mobile apps were limited to HTML5 browser technology and lacked the power and ease-of-use of true mobile apps.

geocodes1

Moving From HTML5 to True Mobile App

Fast forward to 2015 when GoCodes was looking to develop the next generation of mobile asset tracking apps. They turned to Appery.io to provide a powerful and easy-to-use development tool that could cut development time in half and enable existing team members to quickly get up-to-speed without any special training.

Read the rest of this entry »

How to Use Geolocation In An Ionic App: A Quick Video Guide

Posted: January 9th, 2017Author:

This short video shows how to use Apache Cordova Geolocation API to get latitude and longitude data in an Ionic app.

Watch other Ionic videos on our YouTube channel.

Learn How to Get Complete Contact Information with FullContact API

Posted: December 30th, 2016Author:

FullContact Developer APIs such as Person API, Company API, Email API and others can provide social profiles in an app, improve contacts in address book, enrich CRM information, and create marketing campaigns.

To make it simple to use FullContact API, we created a Server Code plug-in that quickly creates a script to invoke the Person API. You only need to set the FullContact API key. The following animated GIF shows how to insert the FullContact plug-in and its script:

FullContact_Servercode

 

Once you set the API key, it’s fast to test the script and the API. Switch to Run tab to test the script. The script comes with a sample email. Feel free to change the input data.

FullContact_ServerCode_run

Testing FullContact API

 

You can also set the email as a script parameter. Update the script code to look like this:

and then add the parameter on Script parameters tab.

Using a Server Code plug-in for FullContact API it’s fast and simple to invoke the Person API. Using this plug-in as a starting point, you can update the script to include other API parameters or use other APIs.

Appery.io November 2016 Newsletter

Posted: December 21st, 2016Author:

November 2016 newsletter.

Platform News

We just launched a new platform status page, which allows you to check the platform status any time.

Our Apache Cordova library update with iOS 10 support is coming along well. We will release this update in the first two weeks of January (instead of in December).

Released at the end of November, our platform update included stability, performance, and scalability improvements. We also updated the JavaScript engine used by Server Code. Want to see our roadmap? You can always check it out here.

Appery.io Platform Overview: A Guide for Mobile Developers

Learn about Appery.io platform features and benefits from this short video. This is a great guide for mobile developers, whether they are existing Appery.io developers or just starting out. Watch the video now.

A Quick Guide for Setting Up and Invoking the Salesforce API

In this blog post you will learn how to build an Appery.io app that connects to Salesforce API. After a login into Salesforce, the app will display a list of Salesforce objects available in your account. The complete app has the following components:

  • App UI (client)
  • Server Code for server-side logic to handle OAuth flow
  • Salesforce account and app to access the data in your account

Read the entire blog post.

New Habit: iOS App Built on the Appery.io Platform With Ionic and Backend Services

An Appery.io customer has built New Habit, a wonderful iOS app using the Appery.io platform. Read about his app and how he built it.

Appery.io Videos

We have close to 200 short videos conveniently organized into playlists. Check them out.

Sample Apps

Do you know that we have sample apps for SMS, email, camera, barcode scanner, and others? A sample app has a UI and a backend preconfigured so you can quickly run the app, show it as an example, or use it as a starting point. Check out the apps today.

Update to Library Version Used in Your Appery.io jQuery Mobile App

Please read this blog post to learn if you need to update the library version used in your jQuery Mobile app.

A Quick Guide to Using Geolocation in Your Mobile App

Posted: December 13th, 2016Author:

geolacation_map

 

Geolocation is one of the most widely used APIs in mobile apps today. From weather to Uber and Lyft, the device location is crucial information and many APIs use it to determine what services and products are available in a given location. When building a mobile app in Appery.io, using the Geolocation API is simple. Apache Cordova library is built-in in every new Appery.io app. Invoking Geolocation will return the latitude, longitude (and other) information which can then be passed to any REST API. The following two short videos show how to use and invoke Geolocation in an Ionic and jQuery Mobile apps:

Looking for more videos like that? Check out our YouTube channel for many more videos.