Skip to main content

Before Getting Started

Overview

Clix leverages Firebase Cloud Messaging (FCM) to deliver notifications efficiently. The goal is to ensure a smooth integration process and reliable delivery of push notifications to your app users.

Environment

  • Flutter 3.0.0 or later
  • Dart 2.17.0 or later
  • iOS 14.0+ / Android API 21+
  • Firebase configured in your Flutter app (Firebase setup guide).
    • We recommend using flutterfire for the installation.
Make sure you’ve completed the Firebase setup.If the setup is complete, the following items should be in place.
  1. Make sure GoolgeServies-Info.plist is in your project’s ios > Runner directory and google-services.json is in your project’s android > app > src directory.
  2. Upload the Service Account Key file to the Clix console.

Setup Clix - Manual Installation

Clix Flutter SDK only supports manual installation.

1. Install Dependencies

Add the Clix Flutter SDK dependency to your project’s pubspec.yaml:
dependencies:
  clix_flutter: ^0.0.1
  firebase_core: ^3.6.0
  firebase_messaging: ^15.1.3
Install dependencies:
flutter pub get

2. Add Initialization Code

Initialize Firebase and Clix in your app’s entry point (main.dart):
main.dart
import 'package:flutter/material.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:clix_flutter/clix_flutter.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();

  await Firebase.initializeApp();

  await Clix.initialize(const ClixConfig(
    projectId: 'YOUR_PROJECT_ID',
    apiKey: 'YOUR_PUBLIC_API_KEY',
  ));

  runApp(MyApp());
}
Replace YOUR_PROJECT_ID and YOUR_PUBLIC_API_KEY accordingly.

3. Add Capabilities (iOS only)

To add Push Notification Capability,
  1. Select your app target.
  2. Go to the Signing & Capabilities tab.
  3. Click the + button and choose Push Notification from the list.
  4. Click the + button and choose Background Modes from the list.
  5. Then check ‘Remote notifications’.

4. Build and Run

flutter run
For more details, please refer to the README file on the clix-flutter-sdk GitHub repository.