Unlock Real-Time Communication with WebSockets on Appery.io

Introduction to WebSockets with Appery.io

Have you ever wondered how apps send updates in real-time? The magic happens with WebSockets. Today, we’ll show you how to add WebSockets to your apps using Appery.io. This low-code app-building platform makes it easy to create complex apps quickly. Note that this post supports our comprehensive video tutorial and if you are interested in details, you are welcome to watch it.

By following the steps below, you can easily enhance your app with real-time communication features using WebSockets and Appery.io. Exciting, right? Let’s get started!

Setting Up Your App

First, create an empty app in Appery.io. Then, go to the Catalog of Appery.io plugins and select the WebSocket Example plugin.

Before importing it, you can click the link to open its documentation page. You’ll see it contains the code for the WebSocket server. This server needs to be run somewhere. While real applications may use Amazon or Azure, we’ll use CodeSandbox for testing.

Using CodeSandbox

1. Create a new Devbox.

2. Select Node.js Server from the list of backend frameworks.

3. Name your Devbox and set its visibility to “Public”.

4. Install two npm modules: `express` and `socket.io`.

Now, let’s move to the next step.

Setting Up Your WebSocket Server

Copy the server code from the documentation page and paste it into your `index.js` file in CodeSandbox. If everything is correct, the server should start successfully.

Back to Appery.io

Return to the Appery.io project and click Import selected plugins with the WebSocket Example plugin checked. This plugin helps you integrate WebSockets into your app. But first, let’s test it.

Testing Your App

Go to the Project > Routing section and set “WebSocketScreen” as the default page.

Next, navigate to TypeScript > WebSocket and specify the URL of your WebSocket server obtained from CodeSandbox.

Now, run your app in different browsers like Google Chrome, Firefox, and Edge. Enter a test message and click the “Send” button.

Ready! The message should be delivered to all clients in real-time.

Conclusion

Now you’ve seen how to add Websockets to your apps using Appery.io. This post is a companion piece to our detailed video tutorial. The demo app isn’t a finished product but provides a solid template for building your own real-time communication features. Give it a try and unlock powerful networking capabilities in your applications!

Easy Guide to SMS Confirmation using Twilio — No Stress, Just Success

We are here once again, this time with an easy-to-follow, stress-free tutorial on setting up SMS confirmation using Twilio. And exciting news – we also have a video tutorial for you to follow along with!

How to configure SMS verification for the app registration feature

Remember how we learned to set up SMTP server settings for email confirmations? Today, we’re switching gears to play with Twilio, allowing us to securely verify sign-up attempts via SMS. Cool, right? Let’s jump in!

Step 1: Getting to Know Twilio

Our journey starts with Twilio. Never heard of them? They are experts in sending out SMS verification codes.

  • Head over to the Twilio website and sign up for their free trial account. Once you’re registered and logged in, you can start personalizing your setup. You can either use an existing account or create a new one. I whipped up a new account I like to call SMS Confirmation.
  • Don’t forget to verify your phone number within Twilio. Just drop your number in, await the verification code via SMS, and then pop the received code into the website.
  • You’ll find a few more easy-peasy questions to answer and then hit Get started with Twilio. Congrats, you’re now ready for action!
  • Your Twilio dashboard will display a special phone number. This number is outgoing only and will be used to send confirmation messages to your own app users.
  • While you’re there, note down your Account SID, Auth Token, and your new Twilio phone number.
  • Lastly, ensure that you’ve listed the phone number you are using for testing in the ‘Active Numbers’ list (Phone Numbers > Manage), and that your Verified Caller IDs tab has the verified number ready to receive the authentication codes.

Step 2: Bring On the App Builder

Now that Twilio is all set, let’s put the App Builder to work.

  • Go to the Server Code tab then open the StarterLib library, which was created just for us. We’re planning to send out confirmation SMS, so we’ll need to replace EMAIL with SMS for the confirmation type in the StarterLib script.
  • Next, hop back over to the Twilio console and one by one, copy your Account SID, Auth Token, and Twilio phone number into the corresponding variables on the script in the StarterLib section. Hit ‘Save’ and voila — you’re all set!
  • The moment of truth has arrived. Click TEST on the App Builder page, fill in the sign-up page details, and then wait for the verification code on your mobile device. Once received, drop it into the app, and bingo! Your user is registered.

As you can see, setting up SMS confirmation using Twilio is easier than a walk in the park.

We hope that this short guide will make your app development experience even better.

Remember, we provide a handy two-week trial giving you plenty of time to experiment with our Starter App Template. Plus, you can subscribe to our YouTube channel for even more handy tips.

Thanks for coming aboard this guide, and see you again very soon!

Your Appery.io Team!

How Events & Scripts Work with InAppBrowser in Appery.io

Below is a practical solution on how we can use customer external sites in Appery.io apps where events & scripts are defined with InAppBrowser Cordova plug-in.

Let’s say your client has a mobile site with lots of pages and different features, but lacks some mobile features like push notifications and he decides to give Appery.io a try. But to migrate all pages and all codes, the effort can be quite large. Perhaps this can be done, but at a later stage. So we made a decision to render the client’s site through the  InAppBrowser component, which is a kind of a browser that can be used inside Appery.io apps. But the control over this component is quite limited, much less than what you have for pages in an Appery.io project.

Of course, the client’s site is protected by login and password. This solution will describe the case where a user logs into an Appery.io app with the same credentials  used to bypass the site’s login screen.

The Appery.io project described in this article can be downloaded under this link.

To open it in Appery, choose Create new app > From Backup, then select the downloaded zip file, click Create, and wait a moment while Appery creates the project for you from the backup.

 

When finished, you’ll have the InAppBrowser_Autologin project created in your Appery workspace. Assuming you can already do basic operations in Appery, such as creating pages and dragging and dropping UI components from the palette, we’ll just walk you through the highlights of how this project was built, focusing on issues related to InAppBrowser.

To demonstrate these techniques, we have created a multi-page site on Heroku.com. Please click here to visit it. All the site pages except for the Login page are protected by login/password.

We will be accessing this site using InAppBrowser, so we need to have this Cordova plug-in enabled in App settings > Cordova plugins:

Let’s review how all of our InAppBrowser related activities are wrapped in an Angular service that can be used to share variables and code between the app pages. (To create this service in Appery, we performed Create New > TypeScript and named it BrowserService, with the type set to Angular service.) You can check that now we have an initial template ready to be gradually replaced with our functions:

Let’s first check how the constants are defined for our site; these are: the target host, target pages, and IDs of the credential fields on the login page:

/* Target host */

const HOST = 'https://using-inappbrowser.herokuapp.com';

 

/* Target pages */

const LOGIN_PAGE =  HOST + '/';

const LOGOUT_PAGE =  HOST + '/logout';

const HOME_PAGE = HOST + '/home';

const SCREEN_1 = HOST + '/screen1';

const SCREEN_2 = HOST + '/screen2';

 

/* IDs of credential fields */

const EMAIL_ID = 'login-form-email';

const PASSWORD_ID = 'login-form-password';

We would like to access Screen1 and Screen2 directly, bypassing the credentials on the Login page. To do this, we use the InAppBrowser ability to track the loaded pages and insert scripts into them.

To see how BrowserService is used on he Menu page of the app, go to the CODE panel and switch to Includes at the top of the page. Here, we added BrowserService to the Internal includes section. We then switched to the Variables section at the top of the page and added the browser variable of type Browser; also, we enabled the Add DI checkbox. This checkbox stands for “dependency injection”, which means that all Angular services in the app are called “dependencies” and can be “injected” into pages:

Everything looks good as we now have a browser variable on the Menu page for our BrowserService, so it can be called by binding TypeScript events to the buttons on the page:

  • this.browser.openFirstPage();
  • this.browser.openSecondPage();

These functions are implemented in BrowserService as:

public openFirstPage() {

    this.open(SCREEN_1);

}


public openSecondPage() {

    this.open(SCREEN_2);

}

It points us to the open(targetURL: string) method, where we created the InAppBrowser object:

this.browser = this.iab.create(targetURL, '_blank', this.getBrowserOptions());

Next, we subscribed to the following InAppBrowser events:

  • loadstart when our browser starts to load a URL.
  • loadstop when our browser finishes loading a URL.
  • loaderror when there is an error when loading a URL.

We get notified of these events as the user navigates through the pages on the site, so that we could take the needed action. One thing that we can do when we are on the Login page is to fill in the username and password fields on the site to automatically submit the form:

this.browser.executeScript({

    code: `

        document.getElementById('${EMAIL_ID}').value = '${this.username}';

        document.getElementById('${PASSWORD_ID}').value = '${this.password}';

        document.forms[0].submit();

    `

});

Here, we are using the InAppBrowser’s executeScript() function, which allows us to call JavaScript on an already loaded page.

Let’s go back to the options we used to create InAppBrowser.

private getBrowserOptions(): InAppBrowserOptions {

    return {

        'location': 'no',

        'hidden': 'yes',

        'beforeload': 'get'

    }

}

Here, we selected to hide the location bar with the URL of the page. We also set the browser to a hidden state to be shown only when the page is loaded.

Note the beforeload event: it is a bit special here. This is a pretty useful event to prevent certain pages from loading or replace the current URL with a different one. This can be useful, for example, if your site contains PDF documentation on the page. iOS devices have no problem opening PDFs, but this is not the case on Android devices with no direct PDF support. So, we can use a workaround to display PDF using a 3rd party service:

this.iab.create("https://docs.google.com/gview?embedded=true&url=" + event.url, "_system");

Also, one should be careful with the beforeload event, as the beforeload=yes option causes POST requests to stop working in InAppBrowser on iOS due to some existing issue, see here for more details. So we are setting beforeload=get to check only GET requests.

Basically that’s all. We took a look at the InAppBrowser events like loadstart, loadstop, loaderror and beforeload and added an autologin script to the site.

Check out the code in the attached Appery.io project and let us know if you have any questions, and happy coding in Appery.io!

Appery.io Offers Free Rewarding Advertising to Their Customers

Dear Appery.io Community,

We would like to thank you for choosing our platform to address your web and mobile app-building needs. It has been a joy to work with all of you, and we hope you enjoy your Appery.io products as much as we enjoy helping you!

In addition to our ongoing efforts to meet your app development needs, we would like to reward our community with an exciting new offer to advertise your apps on our website for free

At this time, we are creating case studies (showcases) based on some of your projects on the Appery.io platform that will help you convert leads into new customers to boost your business.

If you like this idea and want to get in on it, please let us know.

So if you: 

– have an app you’re excited about

– have published your app on any app store, and

– want to advertise this app for free on our platform

Please send us a link to your application at support@appery.io.

While we have your attention, we would also like to remind you that when you work with Appery.io, you build a completely ‘white labeled’ app, so only your company’s logo and name will appear on your final product. As far as we’re concerned, you are the creator and the sole owner of all your apps. Any proprietary information or techniques used for your application will remain confidential; we will never share any information about you without your consent. For more details, you can check our Copyright, Trademark, and Content Ownership section.

We forward to hearing from you soon about this exciting new way to build our partnership,

Sincerely,

The Appery.io Team

Learn How Technology Can Improve Healthcare Supply Chains with Appery.io

In the past, each hospital department was in charge of ordering and maintaining its own inventory. This approach was inefficient and costly. In more recent times, a centralized supply chain management approach based on numerous process automations has become more prominent. As a result, technology has started to play an even more prominent role in transport and inventory management as well as in supplier relations. Nowadays, hospitals tend to switch to a dedicated all-in-one inventory system.

Our client, a not-for-profit healthcare network that includes hospitals and other medical divisions, recently introduced an Appery.io-based modern inventory system that consists of Par Counting, Express Issue, and Package Tracking applications:

Par Counting

Making sure that items are always in stock is a critical task for a hospital warehouse. With this application, counting of stock items has become much easier. Scanning with a fast hardware barcode scanner, counting per cart, filtering, sorting and focusing on critical items, and offline automatic synchronization are a few key features in the application.

Express Issue

Express Issue automates issuing products from an inventory while simultaneously decrementing the count of processed inventory and charging the department requesting that product.

Package Tracking

Whether it’s a flower bouquet or a vendor track shipment, each package is supplied with an internal barcode to go through the different workflow stages to the addressee. Also, the tracking application allows fast debiting (via a fast barcode scanner and a portable printer), transparent routing, and digital signing on receiving.

Benefiting from Technology

Thanks to the Appery.io platform support for hybrid apps, these applications require next-to-no modifications to run on both iOS and Android devices as well as in Web browsers. This makes the development price tag much lower.

In addition, Appery.io API Express streamlined Vuetura-supported communication as well as cost-effectively integrating these applications with legacy back-end systems such as PeopleSoft, Active Directory, and other databases. Because of this, both operation and maintenance costs are projected to go down. Moreover, the Appery.io out-of-the box offline synchronization feature saved a lot in infrastructure upgrade cost.

Leading in Digital Transformation

As rising expenses threaten the viability of traditional healthcare distribution methods, this healthcare network continues to show the way in digital transformation with its focus on supply chain fundamentals.

We Built an IoT App to Control Temperature and Humidity in 16 Hours

According to numerous scientific studies, a comfortable work environment directly contributes to the bottom line. Hear what these experts say:

“With high air quality, an individual productivity improvement can range from 13.5% up to 87%.”

— Prof. Vivian Loftness, Carnegie Mellon University

“The incidence of absenteeism or respiratory infections was found to be lower among people working in high air quality environments.”

— Prof. Anthony V. Arundel, University of Tasmania

With that in mind, we decided to improve its controllable indoor air quality. To accomplish this goal, an Appery.io-powered solution has been built to control temperature and humidity in its office spaces in the face of the most demanding conditions.

The solution’s design is based on a hub to aggregate probes, a database, and a mobile app. Appery.io API Express (built into the Appery.io platform) was used to expose both the Raspberry Pi sensors and the Appery.io cloud database as REST services, making the orchestration process smooth and fast.

In addition, each conference facility is managed by a booking app to ensure higher utilization. As a result of its initial success, that booking app was extended to provide an interface for controlling indoor air quality.

The really amazing thing was that the complete solution was designed, developed, and tested in about 16 hours.

Putting Wi-Fi, GPS & Magnetic Positioning to Use in an In-door Navigation App

A top-notch asset management company with offices based in Asia, Europe, and the Americas cares about its over 20,000 employees. To translate into action its corporate social responsibility policy statements, the company wanted a mobile app to ensure comfortable and hassle-free in-door navigation across multi-story building facilities for its professionals with these requirements:

  1. Get real-time directions from the employee’s current positioning within a facility
  2. Browse floor maps while offline
  3. Find the closest facility

This global financial organization selected the Appery.io cloud platform to develop and launch this hybrid mobile app. Picking Appery.io was bolstered by the platform’s rich built-in functionality as well as the efficient teamwork in working with Appery.io.

Architectural pillars

The Appery.io mobile app architecture took into account overcoming GPS signal attenuation, possible Wi-Fi signal fluctuations, and local magnetic field deviations by implementing a combination of Wi-Fi, GPS, and magnetic positioning approaches. The app also used the offline synchronization supported by Appery.io API Express (built into the platform). In addition, the app brought together flat floor plans and geo-coordinates into navigable 3-axis maps.

Never get lost

The app was first distributed to the global asset management organization’s employees in Boston, MA, where it was a great success, enhancing the working environment in the office. And now, Global adoption by all the company’s offices is very near.

ViewFence Appery.io App Helps Home Buyers Review and Rate Homes They Visit

ViewFence Screenshot

About the Company

The ViewFence app was born as an effort to provide unbiased third party opinions about homes, before buyers decide to spend thousands of dollars on the purchase. ViewFence provides a platform where home buyers and real estate agents can write personalized reviews and share objective opinions about the homes they visit.

The Problem

ViewFence recognized that it is important for home buyers to organize, track, evaluate and compare homes as part of the viewing process. Some of the flexibility the app needed to provide included:

  • Clean and consistent interface across multiple mobile devices and platforms
  • Real-time access to unbiased third party opinions and
  • Ability to take photos and share reviews with family and friends

The company was looking to support a rapidly evolving user experience based on feedback from initial beta users. They were looking for a platform that would enable them to innovate faster and incorporate user feedback.

Solution

ViewFence evaluated several mobile application development platforms (MADP). Appery.io stood out for the following reasons:

Intuitive interface and accelerated learning: The online interface and the usage of standard JavaScript constructs enabled the team to quickly get comfortable with the platform. This also eliminated the need for any specialized mobile platform training for the developers.

Quick turnaround time between releases: The companion Appery.io Tester app on iOS and Android platforms enabled the team to rapidly test features on various devices. The “write once deploy everywhere” development approach allowed the team to simultaneously and seamlessly release the app on multiple App stores and seek feedback from the beta users.

Exceptional support: A comprehensive knowledge base, an active online support forum and responsive support staff ensured timely resolutions to development issues.

ViewFence for Android

ViewFence for Android

ViewFence app was built using Appery.io App Builder for jQuery Mobile, Appery.io Database and Appery.io Server Code.

Looking Ahead

With the help of appery.io, ViewFence has been able to launch the app and is looking to further enrich its offering by expanding features to include REST API integration with real estate content providers including MLS and zillow.com.

Install and use the app today at Apple Store and Google Play at the following links:

Apple Store: get the app

Google Play: get the app

Website: http://www.viewfence.com

Learn How Appery.io Helped Deliver: HABITat, an AI-powered Personal Change App

Appery.io, HABITat, API, API Express, Case Study, Database, Mobile Backend, Server Code
Enkr8ia was formed with the purpose of developing technology to enable people to achieve their personal goals. The name is derived from the ancient Greek word “enkrateia” that stands for “In power of self”.

Read the rest of this entry »

Learn How Dyjit Launched Their App for a New Hospitality Platform Using Appery.io

Appery.io, App Builder, Case Study, Database, Server Code, Knowye

 

Dyjit’s vision is to make life better by introducing digital experiences where they do not yet exist. Dyjit’s first product, knowye (know what you eat), is a hospitality platform that transforms the traditional paper menu into a digital marketing channel and enables restaurants to cater and market to shifting consumer needs.

  • Filter the menu to items that meet your preferences. For example, if you are a vegan or looking for a gluten-free dish, your personal menu with additional ingredient related details will be shown.
  • Select items for your order.
  • Estimate your bill, calculate the tip, split with your group.
  • Add items to your wishlist or favorites.
  • Keep your menu and selection history.

The Dyjit team selected the Appery.io lowcode platform to build and launch their first mobile app.

The Appery.io visual App Builder allows building the app UI 3-4 times faster than using traditional tools.

The Appery.io platform also provides out-of-the-box, integrated backend services such as a cloud database, Server Code for app logic and Push Notifications. This means you don’t need to look for any other backend services and can build and test the entire app quickly and with less resources. The platform enables building a complete mobile app fast, without needing to have a traditional development team.

The app UI was quickly built using the Appery.io App Builder for jQuery Mobile. On the backend, the app leverages the Appery.io Database and Server Code for custom app logic. Running the app on the Appery.io platform will enable the Dyjit team to easily scale the app to any number of backend API calls without lifting a finger. And that’s precisely the reason why the Dyjit team selected the Appery.io platform – it enables them to spend time building their product without worrying about app infrastructure and tooling.

Knowye is available in the Apple and Android app stores and piloting at Heartland Brewery in New York’s Port Authority. Follow knowye’s progress on their Facebook page.

Bon appetite!