/** * Similar to {@link #subscribeToTopic(List, String)} but performs the operation asynchronously. * * @param registrationTokens A non-null, non-empty list of device registration tokens, with at * most 1000 entries. * @param topic Name of the topic to subscribe to. May contain the {@code /topics/} prefix. * @return An {@code ApiFuture} that will complete with a {@link TopicManagementResponse}. */ public ApiFuture<TopicManagementResponse> subscribeToTopicAsync( @NonNull List<String> registrationTokens, @NonNull String topic) { return manageTopicOp(registrationTokens, topic, IID_SUBSCRIBE_PATH).callAsync(app); }
/** * Subscribes a list of registration tokens to a topic. * * @param registrationTokens A non-null, non-empty list of device registration tokens, with at * most 1000 entries. * @param topic Name of the topic to subscribe to. May contain the {@code /topics/} prefix. * @return A {@link TopicManagementResponse}. */ public TopicManagementResponse subscribeToTopic(@NonNull List<String> registrationTokens, @NonNull String topic) throws FirebaseMessagingException { return manageTopicOp(registrationTokens, topic, IID_SUBSCRIBE_PATH).call(); }
/** * Unubscribes a list of registration tokens from a topic. * * @param registrationTokens A non-null, non-empty list of device registration tokens, with at * most 1000 entries. * @param topic Name of the topic to unsubscribe from. May contain the {@code /topics/} prefix. * @return A {@link TopicManagementResponse}. */ public TopicManagementResponse unsubscribeFromTopic(@NonNull List<String> registrationTokens, @NonNull String topic) throws FirebaseMessagingException { return manageTopicOp(registrationTokens, topic, IID_UNSUBSCRIBE_PATH).call(); }
/** * Similar to {@link #unsubscribeFromTopic(List, String)} but performs the operation * asynchronously. * * @param registrationTokens A non-null, non-empty list of device registration tokens, with at * most 1000 entries. * @param topic Name of the topic to unsubscribe from. May contain the {@code /topics/} prefix. * @return An {@code ApiFuture} that will complete with a {@link TopicManagementResponse}. */ public ApiFuture<TopicManagementResponse> unsubscribeFromTopicAsync( @NonNull List<String> registrationTokens, @NonNull String topic) { return manageTopicOp(registrationTokens, topic, IID_UNSUBSCRIBE_PATH) .callAsync(app); }