Appery.io

The Appery.io Developer Hub

Welcome to the Apperyio developer hub. You'll find comprehensive guides and documentation to help you start working with apperyio as quickly as possible, as well as support if you get stuck. Let's jump right in!

Guides    

Configuration

Enabling and configuration Push Notifications.

You need to enable Push Notifications in the app and on backend services (server)

Enabling in Backend Services

To turn on messages for this app in backend services:

  1. Click on the Push link in the App Builder toolbar. The settings page for this app will open in a new tab. You can also switch to the Push Notifications tab directly from the app details page.
  2. Check the Enable Push Notifications check box to enable Push Notifications for this app.

Linking with a Database

Push Notifications require a database. The database stores all registered devices and allows sending targeted Push Notification messages.

For Database, click the Select database button. We recommend creating a new database but you can also use an existing database. Device information is stored in the built-in Devices collection.

Notification Settings

Under the Push settings section check all the three options. Note that the Badge option is only available for iOS devices.

Android Settings

There are two Push notification providers for Android: Firebase Cloud Messaging(FCM) and legacy Google Cloud Messaging (GCM).

Choosing Push Notification Provider

Despite the fact that we support both providers, we recommend using Firebase Cloud Messaging provider for new projects as Google Cloud Messaging can be disabled in the future as deprecated.

Setting up Firebase Cloud Messaging provider

Existing Firebase Project

This section shows how to create a new project. You can also use an existing project.

  1. Go to http://firebase.google.com, log in with your developer credentials. If you are already signed in, you will see the Go to console link the upper right corner.
  2. Click the Create New Project button.
  3. Enter the project name, for example, ApperyioPush. Select your country/region and click Create Project.
  4. In the upper left corner, click on the gear icon next to the "Project Overview":
Project settings.

Project settings.

  1. Click Add Firebase to your Android app.
  2. Enter the app package name, for example: io.appery.mybigapp. This name should match the name inside the App Builder, in Project > App settings > Android binary.
  3. Click Register App.
  4. Click Download google-services.json and save the google-services.json file to your drive.
  5. Click Continue and then Finish.
  6. Select the Service Accounts tab.
  7. Click Generate new private key and then Generate key. Download your Firebase private key file to your drive.
  8. Return to Push Notification settings in Appery.io.
  9. Choose Firebase Cloud Messaging in Push Notifications Service Provider combobox.
  10. Upload google-services.json in Google Services JSON File input.
  11. Upload Firebase private key in Firebase Admin SDK JSON File.
  12. Go to https://console.cloud.google.com/apis/dashboard, log in with your developer credentials.
  13. Choose your Firebase project in the upper left corner. It could be already chosen if you have only one project.
  14. Click Enable APIs and services.
  15. Enter Firebase Cloud Messaging API in search input.
  16. Click Firebase Cloud Messaging API.
  17. Click Enable.

Setting up Google Cloud Messaging provider

You can safely skip this part of documentation for all new projects.

Setting up Google Cloud Messaging provider is not required if you use Cordova Push Plugin 2.0 version and higher.

  1. Go to http://firebase.google.com, log in with your developer credentials. If you are already signed in, you will see the Go to console link the upper right corner.
  2. Click the Create New Project button.
  3. Enter the project name, for example, ApperyioPush. Select your country/region and then click Create Project.
  4. In the upper left corner, click the gear icon next to the "Project Overview":
  5. Click Add Firebase to your Android app.
  6. Enter the app package name, for example: io.appery.mybigapp. This name should match the name inside the App Builder, in Project > App settings > Android binary.
  7. Click Register App.
  8. Click Continue and then Finish.
  9. Select Cloud Messaging tab. There, you will see the server API key token and Sender Id.
  10. Return to Push Notification settings in Appery.io.
  11. Choose Google Cloud Messaging in Push Notifications Service Provider combobox.
  12. Set Sender ID with the value from Cloud Messaging tab.
  13. Set API Key with the value from Cloud Messaging tab.
  14. Go to https://console.cloud.google.com/apis/dashboard, log in with your developer credentials.
  15. Click the Select a project link in the upper left corner and choose your Firebase project.
  16. Click Enable APIs and services.
  17. Enter Firebase Cloud Messaging API in search input.
  18. Click Firebase Cloud Messaging API.
  19. Click Enable.

Warning

To use Push plugin version 1.8.4, Sender ID should also be set inside the App builder. Open App settings and go to the Cordova plugins tab. Locate PushPlugin 1.8.4, click the corresponding checkbox to activate it and open Options. Now, you can add the SENDER_ID parameter and paste the value from the clipboard. Note that the parameter name should be capitalized. This is a required parameter but it can be left empty if you are planning to send push to iOS devices only and do not have SENDER_ID.

iOS Settings

To enable Push Notifications for an iOS app, you must have a Development Certificate if your app is registered in Development mode, and a Production Certificate if your app is registered in Distribution mode.

  1. If you are using a Production Certificate, check the Production option in the iOS settings section. If you are using a Development Certificate, leave it unchecked.
  2. Upload the Push Notification Client SSL certificate you downloaded from Apple Developer portal.
    • To generate a Push Notifications certificate, you need to open the App Ids page, find the desired App ID, click Configure, and check the Enable for Apple Push Notification service checkbox. Then click Configure (select either Development or Production stage).
  3. Fill in the Certificate password that was specified during .p12 certificate creation.

That’s it for iOS configuration.

iOS Bundle ID

The Bundle ID shouldn’t have a wild card character, otherwise, you will not be able to configure push notification properties.

Enabling in the App

Cordova Plugin requirements

The google-services.json file is required with PushPlugin Cordova Plugin, version 2.1.2 for successful project builds. Please don't enable this plugin before configuring FCM.

To enable Push Notifications in an app, the Push Notifications plug-in has to be activated. Go to Project > App settings > Cordova plugins and select the PushPlugin Cordova Plugin version 2.1.2 and Device Cordova Plugin version 1.1.6.

Migration from GCM to FCM

Before version 2.0, Cordova Push Plugin used Google Cloud Messaging provider to register devices. FCM has full backward compatibility with GCM so you can still use old Cordova Push Plugin and send Push Notifications via Firebase Cloud Messaging provider. This allows smooth migration of applications from Google Cloud Messaging provider to Firebase Cloud Messaging provider.

Best practices for migration from GCM to FCM

  1. Setup Firebase Cloud Messaging provider on the Push tab.

Note

From this point, you will be able to send Push Notifications via FCM. All your installed applications will receive Push Notifications even if they use old Cordova Push Plugin. If you use old Cordova Push Plugin in your published application, all devices that install your application will still use GCM to register. Despite the fact that they will be able to receive Push notifications, we recommend continuing to step 2.

  1. Update PushPlugin Cordova Plugin in your project.
  2. Publish your project.

You are not longer dependent on an outdated service!

From this point, all devices that install your application will use FCM to register. So, you can feel safe if Google disables GCM.

Configuration


Enabling and configuration Push Notifications.

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.