Parse-server: Can i send push to android without using fcm?

Created on 20 May 2019  路  4Comments  路  Source: parse-community/parse-server

Issue Description

Hi, i'm using parse server v2.3.3 and parse dashboard 1.10.18 on my own server.
after configure the config i can send object and receive them by curl commands.
but for sending push notification to android devices i confused how to configure server.
is need to use FCM for sending pushes? or This is an optional option?
is there any way to using parse server without FCM? in my server i cant have internet some times.
currently i'm getting installation record but push notification doesn't receive to android devices!

Push Configuration

Server is running with this docker image

Android config:
(the google-services.json is added to app directory)

build.gradle

    implementation "com.github.parse-community.Parse-SDK-Android:fcm:1.20.0"
    implementation "com.github.parse-community.Parse-SDK-Android:parse:1.20.0"
    implementation 'com.google.firebase:firebase-core:16.0.9'
    implementation 'com.google.firebase:firebase-messaging:18.0.0'
 Parse.initialize(new Parse.Configuration.Builder(this)
                .applicationId("YOUR_APP_ID")
                .server("http://MyServerIp:1337/parse/")
                .build()
        );
        Parse.setLogLevel(Parse.LOG_LEVEL_DEBUG);
        ParsePush.subscribeInBackground("myChannel", new SaveCallback() {
            @Override
            public void done(ParseException e) {
                Log.e(LOG_TAG, "Successfully subscribed to Parse!");
            }
        });

        ParseInstallation.getCurrentInstallation().saveInBackground();

Manifest.xml

 <service
            android:name="com.parse.fcm.ParseFirebaseInstanceIdService"
            android:exported="true">
            <intent-filter>
                <action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
            </intent-filter>
        </service>

        <service android:name="com.parse.fcm.ParseFirebaseMessagingService">
            <intent-filter>
                <action android:name="com.google.firebase.MESSAGING_EVENT" />
            </intent-filter>
        </service>

        <receiver
            android:name="com.parse.ParsePushBroadcastReceiver"
            android:exported="false">
            <intent-filter>
                <action android:name="com.parse.push.intent.RECEIVE" />
                <action android:name="com.parse.push.intent.DELETE" />
                <action android:name="com.parse.push.intent.OPEN" />
            </intent-filter>
        </receiver>

        <receiver
            android:name="com.parse.ParsePushBroadcastReceiver"
            android:exported="false">
            <intent-filter>
                <action android:name="com.parse.push.intent.RECEIVE" />
                <action android:name="com.parse.push.intent.DELETE" />
                <action android:name="com.parse.push.intent.OPEN" />
            </intent-filter>
        </receiver>

Environment Setup

  • Server

    • parse-server version 2.3.3
    • Operating System: ubunut 18.04
    • Localhost or remote server? localhost
  • Database

Logs/Trace

sending push with curl:

curl -X POST \
  http://myServerIp:1337/parse/push \
  -H 'Postman-Token: 6acde416-955f-442a-a697-bd3ec984980f' \
  -H 'X-Parse-Application-Id: YOUR_APP_ID' \
  -H 'X-Parse-Master-Key: YOUR_MASTER_KEY' \
  -H 'X-Parse-REST-API-Key: YOUR_MASTER_KEY' \
  -H 'cache-control: no-cache' \
  -d '{
        "channels": [
          "myChannel"
        ],
        "data": {
        "masterKey": "YOUR_MASTER_KEY",
          "alert": "The Mets scored! The game is now tied 1-1.",
          "badge": "Increment",
          "sound": "cheering.caf",
          "title": "Mets Score!"
        }
      }'

stale

Most helpful comment

That is a very interesting question, because FCM requires Google Play Services to be installed on the client.

What if you want to target users in China who mostly do not / cannot use Google services or users who refuse to install Google services out of privacy concerns?

All I can think of is a 3rd party push service that is not depending on FCM, which may not be obvious at first. For example Pushy. These are usually not free.

I opened a related questions on SO you may want to keep an eye on.

All 4 comments

Yes. Parse Server requires FCM in order to send push notifications to Android devices. Please refer to this guide here on how to setup: https://docs.parseplatform.org/android/guide/#setting-up-push

That is a very interesting question, because FCM requires Google Play Services to be installed on the client.

What if you want to target users in China who mostly do not / cannot use Google services or users who refuse to install Google services out of privacy concerns?

All I can think of is a 3rd party push service that is not depending on FCM, which may not be obvious at first. For example Pushy. These are usually not free.

I opened a related questions on SO you may want to keep an eye on.

+1

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ugo-geronimo picture ugo-geronimo  路  3Comments

jaydeep82 picture jaydeep82  路  4Comments

dpaid picture dpaid  路  3Comments

sanergulec picture sanergulec  路  4Comments

ViolentCrumble picture ViolentCrumble  路  3Comments