Development Tip: Appery.io Push Notification Flow

logo-localpushWhen implementing logic with a push notification function it is a good idea to understand how it works under the hood, so when you send a push notification using a REST API, Server Code, or via the web console, the flow should look like this:

  1. Appery.io push service receives and processes the request to send push.
  2. Then, Appery.io passes the message onto Google or Apple servers.
  3. Lastly, push notification providers (Google or Apple) delivers the message to a device.

Because the push notification was delivered by a third party (not by our service), the Appery.io platform can’t provide details on whether or not the push notification was delivered, and the reasons for this. However, we can provide certain error notifications along the lines of the device was not found. The same basic flows are valid for all push notification services (not only for Appery.io).

Read more about push notification in documentation and make sure to check out all of our mobile development tips.

Do you want to build apps fast? Start developing with our trial plan!

Quickly Import Any Cordova Plugin, New API Express Components to Simplify Enterprise Integration, AngularJS App Builder Updates and More In This Big Appery.io Update

Easily import any Cordova plugin

You can now easily add any 3rd party Cordova plugin to your app. This has been one of the most requested features. No more sources digging and long step-by-step guides. This is how quickly you can add any Cordova plugin to your app:

  1. Go to the Github page of the plugin and download the latest stable version by clicking “Download ZIP”. It’s important to download the stable or Release version.
  2. Go to Resources > Cordova pluginsand click Import Cordova plugin, then: Choose file, locate the downloaded file and click Import plug-in The plug-in will appear under Cordova plug-ins

And you are done — it’s that’s easy.

cordova_plugins_list

Quickly add any Cordova plugin

To manage all Cordova plugins for a particular app go to Project > App settings > Cordova plugins and you’ll set the list. On this page you will also see the Core Cordova plugins – these plugins are automatically available in your app. From this page you can easily manage the plugins. You can quickly enable or disable any plugin.

We think it’s a very nice capability that you will like. To learn more, please read the documentation for more details.

API Express enhancements

API Express allows quickly exposing a relational database via REST APIs. In this update we have added a number of important features.

New service builder components

The API Express Service Builder – a visual tool to build your custom services has a number of new components. These components simplify building your service logic.

condition-component

Easily build custom services with new logic components

You can learn more about the new components here.

Comparison query operators 

A set of comparison query operators were added to Find operation to make your requests more effective. Here is the operators list:

  • $eq – Matches values that are equal to a specified value.
  • $gt – Matches values that are greater than a specified value.
  • $gte – Matches values that are greater than or equal to a specified value.
  • $lt – Matches values that are less than a specified value.
  • $lte – Matches values that are less than or equal to a specified value.
  • $ne – Matches all values that are not equal to a specified value.
  • $in – Matches any of the values specified in an array.
  • $nin – Matches none of the values specified in an array.

Learn how to use these operators in examples.

API Express project import & export

Now it’s possible to save your API Express project locally by backing it up.The project can be restored from the exported backup as well. It’s really simple, so you have to go to API Express > Settings and click “Export Backup” to save your API Express project locally. Click “From backup” when creating new API Express project and choose previously stored backup to create a project from the backup. A little bit more about these features is here.

Quickly add a REST API to a controller with drag and drop

invoke_service_snippet

A faster way to add a REST API to an AngularJS app

When building an AngularJS app, there are useful snippet called “Invoke service”. The code to execute a REST API service will be added to your scope function when clicking on it. All you have to do is change “service_name” to your actual service name:

services_drag_n_drop

Drag and drop a service into an AngularJS controller

We now made it even simpler to add a REST API to a function. Just drag and drop the needed service from Services folder (to the left of the screen, where project tree is located) to your function and you’re done! Even the service name will be automatically substituted:

Edit scheduled pushes for faster development

You can now easily edit scheduled pushes. This means you no longer need to delete a scheduled push in order to make a change. There are few ways in Appery.io to send a Push Notification:

  1. By sending the REST request using the Push Notifications API.
  2. By calling the appropriate methods in Server Code.
  3. By using the web console.

All three methods support scheduling pushes. From now, Server Code and Push Notifications API’s were complemented with new methods to get the list of scheduled notifications and to remove them.

By using the web console you can achieve more functionality when editing scheduled pushes. You can remove them as well, but you can also change notifications content and lot of other options including push message, its sound and devices. Read the doc for details.

Push Notifications API changes

If you built an AngularJS app or jQuery Mobile app (library version 3.0), please make sure you are aware of these API changes:

New version of Appery.io Push Notification plugin has different way to read the message. The changes only concerns AngularJS apps and jQuery Mobile app with libraries version 3.0. If you ever wrote the event.notification.aps.alert code, you should replace it with new variant. So, find your code that looks like:

event.notification.aps.alert

And replace it with the next string:

event.detail.message

That’s all if your making the jQuery Mobile app, but for AngularJS one more step should done. Find PushRegisterDeviceImpl JavaScript file (under JavaScript folder) and replace the entire file with the code provided here.

Happy app building with better Appery.io!

Learn about Appery.io Platform APIs: Database, Push, and Server Code

Over the last two weeks, the Appery.io team has updated a number of docs related to the Database, Server Code and Push Notifications APIs. The new format is more user-friendly, making it easier to read and find information. The overview docs and API reference are now separated. This post summarizes what Appery.io Backend Services APIs are available and how to use them.

apperyio_apis

Read the rest of this entry »

Quickly send push notifications with Appery.io backend services

Push notifications. It is a great way to inform app users about cool offers, important events or any updates. It’s an important feature for enterprise mobile apps. For instance, a sales manager can be instantly notified when an existing customer upgrades his/her plan.  Push notifications are a powerful tool to ensure your message is received and read by the user, even when they are not using your app.

push_notification

Appery.io provides fast and easy way to send the push notifications for both platforms – iOS and Android. Sending can be done in just a few steps:

  1. Enable push notifications in the application settings.
  2. Register the application with Apple or Google services.
  3. Install the app on the device. When it’s done, device information will be automatically added to your predefined devices collection.
  4. Send notifications from the console. That it!

You can send these alerts:

  1. Instantly
  2. Schedule
  3. Deliver in device’s time zone

The first two options, all the users will receive the message simultaneously. For instance, for some users it could be 8 AM, and for other users it could be 1 PM.

In the third case of the device time zone sending, users will receive the notifications in a different time – someone later and someone sooner.

Having all three options — is what makes Appery.io push easy to use, yet very powerful, and customizable.

You are not limited to sending push notifications from the push console. With push REST API, you can enable sending messages from any app.

Want to learn more? Head to our push docs or try the quick start push tutorial.