B
B
babavoz2022-02-10 13:06:20
firebase
babavoz, 2022-02-10 13:06:20

How to make a push notification for a specific category of people?

Hello. there is already an application configured with Firebase, there is no access to the application. you need to send push notifications for specific users, for example, by gender or by date of birth (this data is collected).
but I don’t understand how to choose exactly for this category of people in the admin panel, there are only standard ones. I found that there are
ready-made solutions, but for some reason they are not listed in the admin panel. Please tell me how can I implement this
6204e1add216f221241226.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
AlexVWill, 2022-02-10
@babavoz

each device registered in the Firebase push notification system has its own unique token, which is obtained something like this:

private void getFirebaseToken() {
        FirebaseMessaging.getInstance().getToken()
                .addOnCompleteListener(new OnCompleteListener<String>() {
                   
                    @Override
                    public void onComplete(@NonNull Task<String> task) {
                        if (task.isSuccessful()) {
                            // Get new FCM registration token
                            // Log and toast
                            fbtoken = task.getResult();
                            handleFirebaseResult();
                            //Log.d("Firebase id", fbid);
                            //Log.d("Firebase token", fbtoken);
                        }
                    }
                    private void sendRegistrationToServer() {
                        // TODO: Implement this method to send token to your app server.
                    }
                });
    }

In fact, all that is needed is to collect tokens of those devices that meet your conditions (for example, indicated the required gender or age during registration) into the database, and then send notifications only for them using the required token.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question