> ## Documentation Index
> Fetch the complete documentation index at: https://docs.auxia.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Sample Flutter Set up

> This section contains helpful links to set up a sample Flutter Android application to integrate push notifications and corresponding notification events.

[Complete implementation for reference](/deploying-auxia/delivery-integrations/firebase-push-notifications-integration-manual/sample-flutter-set-up/sample-flutter-client-implementation).

### **Step 1: Initialization**

[Set up a client with Flutter for Android](https://firebase.google.com/docs/flutter/setup?platform=android).

### **Step 2: Plugins**

Add the following plugins:

1. [Google Analytics](https://firebase.google.com/docs/analytics/get-started?platform=flutter)
2. [Firebase Cloud Messaging](https://firebase.google.com/docs/cloud-messaging/flutter/client)

### **Step 3: FCM Token**

Make code changes to get the FCM token for the developer's device.

```protobuf theme={null}
  @override
  void initState() {
    super.initState();
    _initializeFirebaseMessaging();
  }

  /// Initializes Firebase Messaging and retrieves the FCM token.
  Future<void> _initializeFirebaseMessaging() async {
    FirebaseMessaging messaging = FirebaseMessaging.instance;

    await messaging.requestPermission(
      alert: true,
      badge: true,
      sound: true,
      provisional: true,
    );

    // Get the initial FCM token
    String? token = await messaging.getToken();
    _updateFcmToken(token);

    // Handle token refresh
    FirebaseMessaging.instance.onTokenRefresh.listen(_updateFcmToken);
  }

  /// Updates the FCM token and prints it for debugging.
  void _updateFcmToken(String? token) {
    setState(() => _fcmToken = token);
    debugPrint("FCM Token: $_fcmToken");
  }
```
