cloudMessagingService function

  1. @riverpod
CloudMessagingService cloudMessagingService(
  1. dynamic ref
)

A provider for the CloudMessagingService class.

This provider is used to provide the CloudMessagingService class to the rest of the application. It is used to interact with Firebase Cloud Messaging.

Usage:

ref.read(cloudMessagingServiceProvider).subscribeToTopic(topic);

Implementation

@riverpod
CloudMessagingService cloudMessagingService(CloudMessagingServiceRef ref) {
  final cloudMessagingInstance = ref.read(cloudMessagingInstanceProvider);
  return CloudMessagingService(cloudMessagingInstance);
}