Push Configuration

Push configuration tends to be the most detailed part of Parse on Buddy configuration. To ensure push notifications work, you need to verify the following:

iOS

  • Push notification credentials in the dashboard

Creating iOS push notification certificates

There are a number of steps needed to create push notification certificates. Here’s a tutorial that steps you through the process: https://docs.microsoft.com/en-us/azure/notification-hubs/notification-hubs-ios-apple-push-notification-apns-get-started. Once you reach the “Configure your Notification Hub for iOS push notifications” step, you’ll have the certificate that you can upload to your app in the Parse on Buddy dashboard.

Configuring iOS push notification certificates

When using APNs, your app’s In production? mode needs to match your push certificate, and provisioning profile used to build your iOS app. If your certificate is a sandbox certificate (generally labelled “Apple Development IOS Push Services”), the mode should be No. If it’s a production certificate (typically labelled “Apple Push Services”), the mode should be Yes. Further, the certificate needs to match the flavor of provisioning profile used to build your iOS app. Sandbox certificates should be used with development provisioning profiles, and production certificates should be used with production (i.e. ad hoc or App Store) provisioning profiles. To change your In production? mode, click on App Settings, then General. Set the In production? switch appropriately.

  • Push notification configuration in your apps

http://docs.parseplatform.org/parse-server/guide/#apns-ios and http://docs.parseplatform.org/parse-server/guide/#ios-apps.

Android

Client SDK initialization: It’s important to ensure you are passing up an empty string for your client key, see the link above concerning SDK initialization.

  • Push notification credentials in the dashboard

Enable GCM push notification API
Parse on Buddy uses GCM for it’s push notification infrastructure. That protocol now uses FCM credentials. You must enable the GCM API for use in your app. Follow these steps:

Create Google APIs project – Create a project for your Android app in the Google APIs Developer Console. For details see here.
Enable GCM API – To enable GCM in your project, in the Google APIs Console select your project, click on ‘API Manager’, then ‘Library’, then type ‘gcm’ into the Library search box to find the GCM API. Click on ‘Google Cloud Messaging’, and enable the API.

Creating FCM push notification credentials
If you don’t have credentials, you need to acquire FCM credentials, as we don’t provide default credentials like the old Parse.com. If you already have GCM credentials, you should upgrade them to FCM. Follow these steps:

Create FCM API Key – You must use a Firebase Cloud Messaging Server key, as Google has stopped accepting new GCM API keys. First go to https://console.firebase.google.com/, then click on ‘Add Project’. Select your GCM project from the dropdown if it exists, or type in a new project name; either way you should end up in the app’s context in the Firebase console. Click on the gear in the upper-left-hand corner, then ‘Project Settings’, then the ‘Cloud Messaging’ tab. There you will find a ‘Server key’, and the older ‘Legacy Server key’ which will not work. Use this new ‘Server key’ in the Parse on Buddy dashboard.
Get Sender ID – In ‘Cloud Messaging’ tab of the Firebase console, the Sender ID is next to the server key.

  • Push notification configuration in your apps

http://docs.parseplatform.org/parse-server/guide/#android-apps

Debugging Android device tokens

Make sure to do clean builds in Android Studio, which will ensure an updated app .APK file will be installed on your test device. The SDK detects changes to the .APK file’s timestamp to help control when to send updated device tokens.

Frequently Asked Questions

Push Status

In order to see push status, you can query it via the REST API, and the API Console, by searching on classes/_PushStatus. Be sure to set ‘Use Master Key?’ to ‘Yes’ in the API Console. If you add order=-createdAt to the query parameter edit box, the most recent pushes will be displayed first.

Phonegap/Cordova support

https://github.com/taivo/parse-push-plugin looks to be the most active repository for the Phonegap/Cordova Parse Push Plugin, we recommend using that to talk to Parse on Buddy from Phonegap.

Sending pushes using the REST api or SDKs

The open-source Parse Server upon which Parse on Buddy is based requires the use of the master key. Add that when initializing the SDK, or if you are sending via a tool like cURL, pass up the ‘X-Parse-Master-Key’ header, with your app’s master key. This is intended to be used in Cloud Code or on servers that are secure, it is not recommended for clients, see http://blog.parseplatform.org/learn/engineering/the-dangerous-world-of-client-push/.