-
-
Notifications
You must be signed in to change notification settings - Fork 735
Guide for opening a push related issue
We know in Android, setting up Push Notifications is often a source of frustration. We will briefly describe how our Parse SDK works for push and the basic debug steps. Please read this carefully and update your pull request as necessary, it saves both you and our time.
Parse using Google Cloud Messaging (GCM) to send push notifications to your device. What Parse SDK does in this process is
- Register the device with GCM to get a registrationId which we store as
_Installation["deviceToken"]
. - Save or update the
ParseInstallation
instance withpushType
,deviceToken
,channels
, etc. - Wait for push notifications from GCM, decode the message and display the notification.
In order to debug push related issues, you need
- A test device which has Google Play Services/Google Services Framework (GSF). If you are using an emulator, you need to use one with Google APIs or manually install it.
- Use the latest version of the Parse SDK if possible.
- Configure the Parse SDK as we describe in this tutorial.
- Set log level to verbose. You can do this by adding this before initializing Parse:
Parse.setLogLevel(Parse.LOG_LEVEL_VERBOSE)
- Update your Parse SDK to the latest version if possible.
To verify whether Parse SDK registers your device to GCM, you can check the log in the console after you launch your app. Normal output messages should be
V/com.parse.ManifestInfo: Using gcm for push.
V/com.parse.GcmRegistrar: Sending GCM registration intent.
Besides the error messages, the common abnormal messages are
V/com.parse.ManifestInfo: Using none for push.
Most of the time this means something is wrong in your AndroidManifest.xml or your test device does not have Google Play Services. We also log the possible errors and solutions to the console so please check them carefully.
V/com.parse.ManifestInfo: Using ppns for push.
If you do not intend to use PPNS, this also means something wrong in your AndroidManifest.xml or your test device does not have Google Play Services.
To check whether the ParseInstallation
has been saved or not, you can check the log in console and the ParseInstallation
collection in your Parse dashboard. Normal output messages should be
V/com.parse.GCMRegistrar: Received deviceToken XXXXX from GCM.
You can then open Parse dashboard and see the deviceToken column of the Parse installation is not empty.
Some possible problems if you do not see the log message is that you are trying to use Parse with other push providers such as Mixpanel(#265) or you have your own GCM registration implementation(#192). If this is the case, we recommend removing any customizations and trying again.
If you see the log message but the deviceToken column in the dashboard is empty, please check your network connectivity. After that, you can use Parse Network Interceptor to check whether the SDK's request to the server contains the deviceToken or not.
If the device is registered correctly but isn't receiving push notifications, common problems are that the push might be delayed or there are problems with GCM. To verify this you can check the log in the console and add additional log in your custom ParsePushBroadcastReceiver. Normal output messages should be
V/com.parse.ParsePushReceiver: Received push data: XXXXX.
If you use your custom ParsePushBroadcastReceiver
, you can check whether the onPushReceive
method has been executed.
If you can see the log message but no push notification shows up on your device, a possible problem is your custom ParsePushBroadcastReceiver
is misconfigured. Please check it carefully and use ParsePushBroadcastReceiver
directly to see whether it works or not.
The above issues are common issues we receive from developers on Github. If you're still having issues, please take a look about the Troubleshooting section in our website as it covers more edge cases. You can also take a look at our existing Github issues to see if someone else has submitted a similar issue and if it has been solved already.
Since many different systems comprise Parse Push such as the Parse backend and Google's servers for GCM, the problem might not always be due to the SDK. If you still have problems, feel free to open a new issue. We are happy to help you identify where is the problem and how to solve it. If you do open a new issue, please make sure it contains the information outlined in our Contributing Guidelines as well as the following:
- Your Parse SDK version
- Your test environment
- Your AndroidManifest.xml
- Log messages after you set the log level to verbose
- Your custom
ParsePushBroadcastReceiver
if you have that - Log of the Parse Network Interceptor if your issue is related to saving the installation
- In which step you get stuck and what have you tried to solve it