Using Facebook API in Appery.io App

When building a mobile app in Appery.io, it’s very easy to use and connect to any APIs. Facebook provides one of the most popular and widely used APIs that you can as easily use in the app you build in Appery.io.

facebook-logo

Appery.io provides a really simple out-of-box approach to pass the OAuth protocol and connect with Facebook. Before building the Appery.io app you need to register as developer with Facebook and create an app. Once it’s done, go to Appery.io builder and import the Facebook API plug-in:

fb_import_plug_in

Once the plug-in is imported you need to specify Appery.io app ID and Facebook app ID in the Facebook_Setting file that listed under the Services folder:

fb_settings

One more thing to do is change the Start Page in App settings to Facebook_Login. After that you can test the app. You’ll see the Login to Facebook button, clicking on which will dial the OAuth log-in dialog, where you should enter your Facebook login and password. After successful authentication, information about you will be displayed at the Facebook_Me page:

fb_me_page

All of the Graph API features can be used the same way, but note, that some actions requires certain scope. You can change default scope parameter in the Facebook_Helper JavaScript file:
fb_tutorial_helper

That’s it, you can now invoke any available Facebook API.  Go ahead and see how to post a wall message in our detailed Facebook tutorial.

TADHack: Compete for $30K+ in Prizes From the Comfort of Your Home

We have Partnered with TADHack – a global event to discover the latest ways to add communications to apps, services and business processes to create powerful customer experiences.    Use Appery.io to build your hack of course… You’ll have a chance at $30K in prize money and other prizes, including full year subscriptions to Appery.io.   You can join this global event from the comfort of your own home, or in person in Madrid, Spain; Colombo, Sri Lanka; Pune, India; and Kuala Lumpur, Malaysia.

Check out some of the developers getting involved on the even’s blogRegister for the hackathon and get your developer spotlight.

If you want to learn and network rather than hack you can do that too. There will be investors, enterprise CIOs, Telcos, press, customer experience designers and many more coming to TADHack to learn how communications creates world class customer experiences and exciting new services.

TADHack will run over Friday and Saturday the 6th and 7th June 2014 . Here is the agenda. Keynotes include Mark Shuttleworth, the founder of Ubuntu, technology visionary and second space tourist.  Here are some of the developer resources for your hacks.  Hacks can use Telecom APIs, WebRTC, messaging, location, payments and much more.  You’ll even be able to hack your calls.  Its going to be a unique and exciting event – and with Appery.io, you’ll have a competitive advantage!

Sign up for the hackathon and good luck in the competition.

Appery.io platform adds speed, server jobs, Google Analytics, Windows Phone build, Customer Console, more Webhooks, and many more features

The Appery.io team released a number of really cool features over the weekend. Here is what’s new.

It’s faster

We made a lot of things go faster. You will see a big app builder speed improvement (and we are still not done, more speed is coming).

Easily schedule server-side jobs

You are building an app that needs to check for inventory once every hour or once a day? Now you can easily do this with new Server Code scheduler feature. Because this is a server-side script, the actual device can even be offline, but the script will still run. You pick a script and just set the schedule to run:

server_code_jobs_tab

Manage app data and send push messages with Customer Console

Built a restaurant app for a client and would like the restaurant owner to manage the menu or send push message for special promotions? Now you can easily create a special Customer  Console for an app and let the client manage the app data and push messages. With the just launched Customer Console, the client can edit app data (data from database), and send push notifications, all from a user-friendly console (and you don’t need to be involved). You can even publish the Customer Console to a custom domain.

customer_console

Get app insight with Google Analytics

Now you can easily collect statistics from you app by using the Google Analytics. Watch how many users use the app, or analyze data for certain periods. All the power of the Google Analytics is in your Appery.io app:

google_analytics

Styling the app with CSS is easier and faster

Earlier, when working with CSS  you have to test your app every time you want to see the changes. Now, you can see all the changes based on your CSS files directly inside the Appery.io app builder without the need to launch the app in the browser. Just write or edit the CSS and switch back to page to see the result:

css

Manage binary certificates in one place

New and convenient certificate management tool helps keep all certificates in one place. Mark certificate as default to be used by all apps, or choose a specific certificate for an app in Project > App settings. As before, you can auto-generate Android certificates inside the Appery.io platform:

certificates

Quickly build and deploy for Windows Phone

Need to build a binary for Windows Phone? It’s now as simple and fast as building for iOS and Android:

exportin_the_app

Customize and integrate more with additional Webhooks

We launched Webhooks in January to allow easy integration with other systems. In addition to app specific events (right screen shot), we just added account-wide Webhooks (left screen shot) such as App created, App removed and App renamed. With new Webhooks, you get more options to integrate with other systems:

webhooks

Custom domain HTTPS hosting

Appery.io apps can be hosted on custom domain, and now the custom domain options also supports https.

As always, if you have any questions, feedback or comments, feel free to contact us at support@appery.io, post something on our forum or ping us on Twitter.

Using Google Maps API in Appery.io App

Google Maps is probably the most popular map widget used in the mobile apps today. Working with Google Maps in Appery.io app builder is very easy but as the same time is not very different than using other dev. tools. To add a Map component, simply drag and drop it from the palette onto the page:

google_maps_api

Rename the Map component to google_map. This is done so it’s simpler to reference the component from code.

Next you can create your own JavaScript class and define map variable as following:

var map;
function initialize() {
    map = Apperyio("google_map").gmap;
    if (!map)
    {
        setDelay();
    }
    else
    {
        directionsDisplay = new google.maps.DirectionsRenderer();
    }
}

function setDelay()
{
    setTimeout(initialize, 50);
}

Google Maps is usually loaded asynchronously, so the approach with delay (as mentioned in code above) can be handy. This will ensure the map is completely loaded before you try to use it.

Generally that’s all you need to use Google Maps JavaScript API. All the actions you want to do next you can make based on Google Maps JavaScript API. Lets say you want to show direction from point A to point B. Place the button on the page and run following JavaScript by clicking on it:

var directionsDisplay = new google.maps.DirectionsRenderer();
var directionsService = new google.maps.DirectionsService();

var request = {
origin: 'Los Angeles',
destination: 'San Francisco',
travelMode: google.maps.DirectionsTravelMode.DRIVING
};
directionsService.route(request, function(response, status) {
directionsDisplay.setMap(map);
if (status == google.maps.DirectionsStatus.OK) {
directionsDisplay.setDirections(response);
}
else
{
alert("Directions query unsuccessful. Response status: " + status);
}
});

The directions will be shown on the map:

google_map_directions

To place the marker on the map you should provide latitude and longitude values of a certain point. Try to run following JavaScript code and you’ll see how the marker drop on the map:

var markerLatLng = new google.maps.LatLng(37.913597,-122.066059);

var marker = new google.maps.Marker({
    position: markerLatLng,
    map: map,
    title: "Walnut Creek, CA",
    animation: google.maps.Animation.DROP
});

added_marker

You can also place markers based on geographical names, not latitude and longitude. In this case you should use Google Geocoding services, to convert user-friendly names to latitude and longitude values. Create a REST service in the app builder with the following URL:

https://maps.googleapis.com/maps/api/geocode/json

You’ll get a coordinates (latitude/longitude) as a response of this service, and you of course can use them to add markers.

Any layers provided by Google Maps can be added too. Here is an example for Traffic layer, just run this code by clicking on the button:

var trafficLayer = new google.maps.TrafficLayer();
trafficLayer.setMap(map);

Traffic layer in action:
traffic_layer

As you can see using Google Maps and its API is very straightforward in Appery.io app builder. Check out our Google Maps section for more detailed tutorials.

Maintenance Window on Sunday April 12 (Updated)

Updated: we updated the post with correct maintenance day: Sunday.  We originally posted an incorrect day as Saturday.

Please note that we will be upgrading Appery.io with new features on Sunday April 12, starting at 12:00 AM PST (midnight on Saturday night).  The following services will be temporarily unavailable:

  • The development environment will be unavailable for about 6 hours, from 12:00 AM until about 6 AM PST.
  • The Backend Services (Cloud Database, Push Notifications, Server Code) service will be unavailable for about 2 hours, from 12:00 AM until about 2:00 AM PST)

We apologize for the inconvenience.  If you have questions, please contact us at support@appery.io

Appery.io and the “Heartbleed” bug

Just a quick update to let our users know that our team has assessed the impact to our platform related to the recent disclosure of the “Heartbleed” bug (aka CVE-2014-0160).    Our team has taken the necessary actions, including applying updates to our platform, to protect our users from such potential vulnerability.   If you have any questions, please don’t hesitate to contact our support team.

 

 

 

 

Complete the New Developer Economics Survey for a Chance at Great Prizes

The seventh Developer Economics survey is here! We’re again partnering with VisionMobile for their new Developer Economics survey to enable more developers to voice their opinions on the trends and top development issues of the day.

The 10-minute survey reaches thousands of developers, and comprises the data that goes into VisionMobile’s well-known reports on the current state of app development. Results of the survey will be available as a free public download in July 2014.

What’s your take on the latest trends in app development? Which platform(s) should developers choose in today’s competitive market? Which is the right revenue model for your apps? Take the survey, and have your say on some of the most pressing issues in app development.

Survey respondents can enter to win some terrific prizes! Respondents will have a chance to win such prizes as an iPhone 5s, a Galaxy S5, a Sphero, a Lego Mindstorm robot, and many others!

Take the survey today!

Connect With API Providers in Appery.io App Using OAuth.io

OAuth is an open protocol to allow secure authorization from web, mobile, and desktop apps. However, making  OAuth work in your mobile app is not a simple task and often takes a lot of time and effort. Using the OAuth.io service is a great and simple way to save time, and make the authentication pretty much work out-of-the-box.

oauth-io-logo

OAuth.io service can be easily integrated in Appery.io app. There are two ways to setup the OAuth.io plug-in in Appery.io app:

Include OAuth.js as JavaScript asset

This approach can be helpful when developing a mobile web app. Apps with OAuth.js included as JavaScript asset work from browser and can be quickly tested by clicking the Test button. Such approach saves development time because you don’t need to install the app on the device every time after making changes. These are the steps:

  1. Go to OAuth.io web site and download the latest JavaScript library.
  2. Upload this library to your Appery.io app by choosing Create New -> JavaScript -> Create from file.
  3. You have to remove or comment the if statement on line 193 in that file because the Appery.io app already contains some methods with “OAuth” name.

Include as PhoneGap plugin

Apps with OAuth.io service included as PhoneGap plugin will not work from the browser. Such apps should be built as binary and installed directly on the device. Steps for adding OAuth.io as PhoneGap plugin are almost identical to adding any 3rd party PhoneGap plug-in:

  1. Download repository from github plug-in page.
  2. Create new folder for this plugin in the Appery.io app and upload oauth.js:
  3. Add the following line of code to the very beginning of this file:
    • cordova.define(“com.phonegap.plugins.oauthio”, function (require, exports, module) {
      and the closing bracket to end of file “}”.
    • Edit the cordova_plugins.js file by adding plug-in description.

Once the OAuth.io included in Appery.io app the same code can be used to initialize and authenticate. See the OAuth.io documentation for code examples.

Examples

Adding Oauth.io service to your app is pretty simple.  See our detailed tutorial where we describe how to authenticate with Google and how to post to Facebook.

Dialing number and sending SMS via JavaScript

Being able to launch the native dialer app or SMS app from the app you are building might be a very useful feature. For instance, the app you are building might display a list of restaurants in the area with a phone number. You want to be able to click the number and call the restaurant. This functionality can be easily done with calling the “tel:” or “sms:” and passing the needed values. Here is the simple Appery.io app that contains just a two buttons:

buttons

Here is the JavaScript code for the “Send SMS” button:

window.location.href = "sms:+375292771265?body=Hello from Appery.io!";

Such code will open the SMS typing window with predefined text and phone number as following:

2014-03-12 14.42.34

Second button has the following JavaScript code:

window.location.href = "tel:+375292771265";

Clicking on that button will open the dialer with pre-populated phone number:

2014-03-12 14.42.15

It is not possible to programmatically call or send SMS without opening the appropriate window due to the security reasons.

iOS has some nuances when dialer or SMS window should be opened. Try to use such code for iOS platform:

window.open('tel:+375292771265', '_system');

Or for SMS:
window.open('sms:+375292771265?body=Hello from Appery.io!', '_system');

Please also note that these protocols (tel: and sms:) might work differently depending on OS/browser versions. On Android, you might get different functionally depending what app is selected for sending SMS messages.

Instead of using the native SMS app, a number of services such as AT&T and Twilio provide APIs to send SMS messages. Appery.io has plugins for AT&T and Twilio SMS API.

Build a multi-language app in Appery.io

An app that has multi-language support is always better than the same app that supports just one language.  Appery.io app can be easily upgraded with multi-language support by using the i18next plug-in. This post will show you how to do it.

i18n_blog_en_de_app

There are few steps to add the multi-language support:

  1. Download i18next.js from the i18next web-site and upload it to WEB_RESOURCES folder in Appery.io app builder.
  2. Create folder structure that corresponds to i18next structure and upload translation files in JSON format:
    i18n_translation_files
  3. UI components that should be translated must be marked with special attributes: data-i18n, and data-i18n-target. Read more about it in our detailed tutorial.
  4. Initialize the plug-in via JavaScript specifying needed options as initialize language (can be retrieved from the browser or device language) and fallback language. Fallback language is very handy feature and it’s define what language should be used in case of missing language or translation.

Downloading of translation files will take some time on initial app start up. There is no need to create any preloaders as all the files will be loaded automatically. It’s a good idea to use launch images to show that the app launching/loading. Once the translation files are loaded, properly marked components will be automatically translated accordingly to the initialized language.

To build an app with multi-language support, try the multi-language tutorial and read the i18next documentation.