How to send push notifications to a mobile phone

Sending push notifications to mobile phones is only supported for native mobile applications. If you want to send push notifications to mobile phones in your native mobile applications there are several major steps involved. Most of them need only to be done once, so don’t be put off by the details described below.

  1. Setup Apple and Google pre-requisites (for iOS and Android phones) – this should only be done once.
  2. Enter these pre-requisites into Aware IM (also done once only)
  3. Configure push notification rules in Aware IM

We will cover each of these steps in detail.

  1. In order to use iOS push notifications you need a certificate.
  2. In order to build native iOS applications using PhoneGap you also need a certificate and a provisioning profile file.
  3. Before you can generate certificates and provisioning profile you need to enter your Apple Developer account here https://developer.apple.com/account/#/welcome
  4. You can just sign in using your Apple ID.
  5. Then you need to join Apple Developers Program here:
  6. Once you have enrolled into this program you can generate certificates and provisioning profile for the PhoneGap build. Follow the instructions here: https://coderwall.com/p/eceasa/getting-everything-for-building-ios-apps-with-build-phonegap-com
  7. To generate the certificate. Follow the instructions here:

https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/AppDistributionGuide/AddingCapabilities/AddingCapabilities.html#//apple_ref/doc/uid/TP40012582-CH26-SW11

  1. Create an Android application for your project
  2. Go to the Application Settings (General tab) and download the file google-services.json. Keep this file in a safe location
  3. Go to the Cloud Messaging tab in application settings and copy the Services Key
  1. In the Configuration Tool, double click on the Business Space Version you want to change and click on “Push Notifications” property in the list of version properties.
  2. A dialog will popup. In the “APNS” section of this dialog enter the full path to the iOS certificate file on your machine and certificate password.
  3. In the FCM Settings section of the dialog enter the location of the google-services.json file and enter the Services Key
  4. Once you click OK Aware IM will automatically add one predefined business object (MobilePhone) and one predefined notification MobilePushNotification to your business space version.

a) First you need to make sure that the owner of the phone subscribes to push notifications. You will need a process for this. The process should use the MOBILE SUBSCRIBE action. After this action has been executed a new instance of the MobilePhone object will be added to the context of the process. It is this object that the notification will be sent to. So most of the time it makes sense to associate this object with the logged in user. You can add a reference to the user object that will store one or several phones that the user owns. The process can then look like this:

MOBILE SUBSCRIBE LoggedInRegularUser.MobilePhone = MobilePhone

or

MOBILE SUBSCRIBE 
 INSERT MobilePhone in LoggedInRegularUser.Phones)

b) To send push notifications you need to create another process that uses the MOBILE PUSH action. The process should find all MobilePhone objects that it wants to send the notifications to and use the MobilePushNotification. For example:

FIND ALL MobilePhone
 CREATE MobilePushNotification WITH 
    MobilePushNotification.Title='Test',
    MobilePushNotification,Subject='This is my test notification',
    MobilePushNotification.Sound='default'
 MOBILE PUSH MobilePushNotification TO MobilePhone
  • Last modified: 2022/09/13 18:15