Reputation: 1
My App allow user to click a button to subscribe a topic to receive notification. User can also click the button to unsubscribe the topic.
I would like to know, what happen if users do not unsubscribe the topic first, then direct uninstall the App,
Example:
So, we developer send the FCM data payload via our server to the app subscribed topic,
Will firebase know the 2000 users already uninstalled the app, so will not send to them?
or firebase will still send to the 2000 users, but with error fails? Does developer need to do something to unsubscribe them to reduce error and firebase workload, or firebase will automatically do it? My app currently does not store the client firebase token to server.
Example Code for the app used to subscribe to topic when click the button.
FirebaseMessaging.getInstance().subscribeToTopic("topicname")
.addOnCompleteListener(new OnCompleteListener<Void>() {
@Override
public void onComplete(@NonNull Task<Void> task) {
String msg = "Subscribed";
if (!task.isSuccessful()) {
msg = "Subscribe failed";
}
Log.d(TAG, msg);
Toast.makeText(MainActivity.this, msg, Toast.LENGTH_SHORT).show();
}
});
Thanks in advance.
Upvotes: 0
Views: 788
Reputation: 2706
Firebase slowly knows who is not "listening" for a specific Topic: when an App is uninstalled it stops sending "ping" to Firebase so it will know that and it will not send more notifications to User.
Obliviously this process takes time depending on Google Play Services and its implementation in the library you use.
Maybe Firebase will try to send notification even on an already-uninstalled App's User, however it's not a problem.
Upvotes: 0