user7697994
user7697994

Reputation:

How to send notification between two application

I want to send push notification from Device "A" with Application "A" to Device "B" with application "B" how I can achieve that?

Any help will be appreciated.

can I use firebase with that?

With parse I can define that with number like :

ParseQuery query = ParseInstallation.getQuery();
query.whereEqualTo("phone", "1234567890");
ParsePush push = new ParsePush();
push.setQuery(query);
push.sendPushInBackground();

how can I achieve that in other cases ?

Upvotes: 0

Views: 1605

Answers (3)

AL.
AL.

Reputation: 37798

You'd probably have to go with something like this:

  1. Create two separate Firebase Projects for each app with FCM enabled. (Project A and B)
  2. Implement FCM for both Apps and generate tokens for each project to both apps (i.e. App A has tokenA and tokenB, App B has tokenC and tokenD). See my answer here.
  3. Store the tokens to the corresponding servers.

From there, the flow of interaction should be something like:

App A > sends data > Server A // (contains App B's tokenC)
Server A > sends notification > App B // (by using tokenC)

and vice versa:

App B > sends data > Server B // (contains App A's tokenB)
Server B > sends notification > App A // (by using tokenB)

That's pretty much the general idea.

With all that said, "how can I achieve that in other cases?" is too broad of a question.

Upvotes: 1

param
param

Reputation: 493

First of all Parse no more exists

now coming to your question yes you can send the push from application A to application B

First implement FCM in App B and store the device id on server.

Now you have device id of App B with user id on server.

Now send request to server to send the push from A to B.

Upvotes: 0

jaspreet singh
jaspreet singh

Reputation: 1

No, because package name will be different for two application. You cannot use same google-services.json file in both application if you are using FCM.

Upvotes: 0

Related Questions