/channel-flutter-sample

This project was created to test how to use ChannelTalk SDK in Flutter. It provides practical implementation examples that Flutter developers can reference before adopting ChannelTalk SDK.

Primary LanguageDart

ChannelTalk SDK Flutter Sample Project

Flutter sample project demonstrating how to use native ChannelTalk SDK in Flutter apps. (Korean Guide)

πŸ“‹ Project Overview

This project was created to test how to use ChannelTalk SDK in Flutter. It provides practical implementation examples that Flutter developers can reference before adopting ChannelTalk SDK.

⚠️ Important Notice

Channel Talk does not officially support a Flutter SDK, but we provide guides and sample projects to help our clients use it. Please understand that these guides and sample projects may not be updated as quickly as other resources.

This project is an unofficial integration method that implements bridge code to use native Android/iOS SDK in Flutter. Please conduct thorough testing and verification before using in actual production environments.

πŸ—οΈ Project Structure

channeltalk_sample/
β”œβ”€β”€ lib/
β”‚   β”œβ”€β”€ constants/
β”‚   β”‚   └── texts.dart                    # App text constants
β”‚   β”œβ”€β”€ managers/
β”‚   β”‚   β”œβ”€β”€ channel_io_manager.dart       # Flutter ChannelIO Manager (Singleton)
β”‚   β”‚   └── fcm_manager.dart             # Firebase messaging manager (FCM + ChannelTalk integration)
β”‚   β”œβ”€β”€ viewmodels/
β”‚   β”‚   β”œβ”€β”€ boot_test_viewmodel.dart      # Boot functionality test ViewModel
β”‚   β”‚   β”œβ”€β”€ event_test_viewmodel.dart     # Event handling test ViewModel
β”‚   β”‚   β”œβ”€β”€ fcm_test_viewmodel.dart       # FCM functionality test ViewModel
β”‚   β”‚   └── profile_test_viewmodel.dart   # Profile functionality test ViewModel
β”‚   β”œβ”€β”€ views/
β”‚   β”‚   β”œβ”€β”€ common/                       # Common UI components (8 files)
β”‚   β”‚   β”œβ”€β”€ pages/                        # Main app pages
β”‚   β”‚   β”œβ”€β”€ test_sections/                # Test functionality sections (4 files)
β”‚   β”‚   └── widgets/                      # Custom widgets
β”‚   β”œβ”€β”€ firebase_options.dart            # Firebase configuration (FlutterFire CLI generated)
β”‚   └── main.dart                        # Sample app implementation (UI + ChannelTalk/FCM testing)
β”œβ”€β”€ android/
β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”œβ”€β”€ build.gradle.kts              # Android dependencies (Firebase + ChannelTalk)
β”‚   β”‚   β”œβ”€β”€ google-services.json          # Firebase configuration file
β”‚   β”‚   └── src/main/
β”‚   β”‚       β”œβ”€β”€ AndroidManifest.xml       # Custom FCM service registration
β”‚   β”‚       β”œβ”€β”€ res/values/strings.xml    # FCM channel configuration
β”‚   β”‚       └── kotlin/io/channel/channeltalk_sample/
β”‚   β”‚           β”œβ”€β”€ MainActivity.kt                    # Flutter ↔ Android bridge
β”‚   β”‚           β”œβ”€β”€ ChannelIOManager.kt               # Android native logic
β”‚   β”‚           β”œβ”€β”€ MainApplication.kt                # ChannelTalk initialization
β”‚   β”‚           └── ChannelIOFirebaseMessagingService.kt  # Custom FCM service
β”œβ”€β”€ ios/
β”‚   β”œβ”€β”€ Podfile                          # iOS dependencies (Firebase + ChannelTalk)
β”‚   β”œβ”€β”€ GoogleService-Info.plist         # Firebase configuration file
β”‚   └── Runner/
β”‚       β”œβ”€β”€ AppDelegate.swift            # Flutter ↔ iOS bridge (Firebase + FCM)
β”‚       β”œβ”€β”€ ChannelIOManager.swift       # iOS native logic (ChannelPluginDelegate)
β”‚       └── Info.plist                  # FCM background mode configuration
β”œβ”€β”€ πŸ“š Documentation/
β”‚   β”œβ”€β”€ README.md                        # This file (multi-language support)
β”‚   └── guide/                          # Language-specific guide documents
β”‚       β”œβ”€β”€ ko/                         # Korean guides
β”‚       β”‚   β”œβ”€β”€ installation.md                 # SDK Installation Guide
β”‚       β”‚   β”œβ”€β”€ channel_io_manager_guide.md     # ChannelIOManager Usage Guide
β”‚       β”‚   β”œβ”€β”€ push_notification_guide.md      # Push Notification Main Guide
β”‚       β”‚   β”œβ”€β”€ push_notification_android.md    # Android Push Setup Guide
β”‚       β”‚   └── push_notification_ios.md        # iOS Push Setup Guide
β”‚       └── en/                         # English guides
β”‚           β”œβ”€β”€ installation.md                 # SDK Installation Guide
β”‚           β”œβ”€β”€ channel_io_manager_guide.md     # ChannelIOManager Usage Guide
β”‚           β”œβ”€β”€ push_notification_guide.md      # Push Notification Main Guide
β”‚           β”œβ”€β”€ push_notification_android.md    # Android Push Setup Guide
β”‚           └── push_notification_ios.md        # iOS Push Setup Guide
└── pubspec.yaml                        # Flutter packages (firebase_core, firebase_messaging)

πŸ”§ Development Environment Requirements

Minimum Requirements

  • Flutter SDK: 3.0 or higher
  • iOS: iOS 15.0 or higher
  • Android: API 21 or higher (Android 5.0)
  • ChannelTalk Plan: Paid service plan

This Project's Development Environment

Flutter

  • Flutter: 3.35.2 (stable channel)
  • Dart: 3.9.0
  • Firebase Core: 2.32.0
  • Firebase Messaging: 14.7.10

iOS

  • Xcode: 16.3 (Build 16E140)
  • Swift: 6.1
  • CocoaPods: 1.16.2

Android

  • Android Gradle: 8.12
  • Android Target SDK: API 35
  • Android Compile SDK: API 35
  • Android Min SDK: API 21
  • Firebase BOM: 33.1.2
  • Google Services Plugin: Latest (automatic)

ChannelIO SDK

  • ChannelTalk Android SDK: 12.13.0
  • ChannelTalk iOS SDK: Latest (automatic latest version)

πŸš€ SDK Guide

1. SDK Installation Guide

For detailed information on ChannelTalk SDK installation and project setup:

πŸ“‹ English Installation Guide - Step-by-step installation guide

2. Push Notification Setup

Firebase FCM integration setup for ChannelTalk push notifications:

πŸ“¬ English Push Notification Guide - Firebase FCM + ChannelTalk Integration

3. ChannelIOManager Usage Guide

Detailed guide on using ChannelIOManager in Flutter and code reuse:

βš™οΈ English ChannelIOManager Guide - Implementation, Usage, Reuse Guide

4. Official Documentation

πŸ“ Sample Project Execution Method

⚠️ Important: Firebase FCM configuration is required to run this sample project. Push notification functionality will not work without proper Firebase setup.

1. Project Clone and Setup

# 1. Clone project
git clone https://github.com/channel-io/channel-flutter-sample
cd channeltalk_sample

# 2. Install Flutter dependencies
flutter pub get

# 3. Install iOS dependencies (when building for iOS)
cd ios && pod install && cd ..

2. ChannelTalk Configuration

// Set plugin key in lib/main.dart file
await channelIO.boot(
  pluginKey: "YOUR_PLUGIN_KEY",  // ← Change to actual plugin key
  // ... other settings
);

3. Firebase Configuration (Required)

  1. Create Firebase Project in Firebase Console
  2. Add Android/iOS apps to the project
  3. Download configuration files:
    • google-services.json β†’ android/app/
    • GoogleService-Info.plist β†’ ios/Runner/
  4. Enable Firebase Cloud Messaging in Firebase Console
  5. Configure push notification credentials in ChannelTalk Admin

4. Run App

# Run in debug mode
flutter run

# Release build
flutter build apk --release  # Android
flutter build ios --release  # iOS

πŸ› οΈ Code Reuse Guide

We recommend using the sample project code as reference material rather than direct reuse. If you plan to reuse the code, please refer to the content below and modify accordingly.

Core Implementation Files

To use in actual projects, please check the following files.

Flutter Layer

πŸ“ Flutter
β”œβ”€β”€ lib/managers/channel_io_manager.dart    # ChannelTalk SDK Flutter interface (MethodChannel + event management)
β”œβ”€β”€ lib/managers/fcm_manager.dart          # Firebase FCM + ChannelTalk integrated manager
└── lib/firebase_options.dart             # Firebase configuration (FlutterFire CLI generated)

Android Native

πŸ“ Android  
β”œβ”€β”€ android/app/src/main/kotlin/.../ChannelIOManager.kt           # ChannelTalk native logic (ChannelPluginListener)
β”œβ”€β”€ android/app/src/main/kotlin/.../MainActivity.kt              # Flutter ↔ Android bridge
β”œβ”€β”€ android/app/src/main/kotlin/.../MainApplication.kt           # ChannelTalk initialization
β”œβ”€β”€ android/app/src/main/kotlin/.../ChannelIOFirebaseMessagingService.kt  # Custom FCM service
β”œβ”€β”€ android/app/src/main/AndroidManifest.xml  # FCM service registration + permissions
└── android/app/src/main/res/values/strings.xml  # FCM channel configuration

iOS Native

πŸ“ iOS
β”œβ”€β”€ ios/Runner/ChannelIOManager.swift     # ChannelTalk native logic (ChannelPluginDelegate)
β”œβ”€β”€ ios/Runner/AppDelegate.swift          # Flutter ↔ iOS bridge (Firebase + FCM + UNUserNotificationCenter)
└── ios/Runner/Info.plist                # FCM background mode configuration

Configuration Files

πŸ“ Firebase Configuration
β”œβ”€β”€ android/app/google-services.json      # Android Firebase configuration
β”œβ”€β”€ ios/GoogleService-Info.plist          # iOS Firebase configuration
β”œβ”€β”€ android/app/build.gradle.kts          # Android dependencies (Firebase BOM + ChannelTalk)
└── ios/Podfile                           # iOS dependencies (Firebase + ChannelTalk)

Key Implementation Features

  1. Integrated ChannelIOManager Architecture:

    • Flutter: Provides unified SDK interface with Singleton pattern
    • Android: Real-time event reception with ChannelPluginListener implementation
    • iOS: Real-time event reception with CHTChannelPluginDelegate implementation
    • MethodChannel: Bidirectional communication between platforms (method calls + event callbacks)
  2. Platform-optimized FCM Processing:

    • Android: Native processing in ChannelIOFirebaseMessagingService (inherits FlutterFirebaseMessagingService)
    • iOS: Integration with Flutter through UNUserNotificationCenterDelegate in AppDelegate
  3. Accurate ChannelTalk Message Detection: Distinguished by data['provider'] == 'Channel.io' key

  4. Flutter FCM Compatibility: Completely preserves existing Flutter FCM functionality while adding ChannelTalk message processing

πŸ“– Detailed ChannelIOManager Usage: Check ChannelIOManager Guide for detailed information on implementation structure, usage, and code reuse.

Precautions for Reuse

  1. Package Name Change: Modify package names in files to match your actual project
  2. Plugin Key Configuration: Use actual key issued by ChannelTalk
  3. Firebase Configuration: Replace google-services.json / GoogleService-Info.plist files with actual project settings
  4. Permission Settings: Check Android 13+ POST_NOTIFICATIONS permission and iOS notification permissions
  5. ⚠️ Notes for Reusing ChannelIOManager.swift:
    • We recommend adding the ChannelIOManager.swift file directly in Xcode
    • Copying from file explorer or creating with external editors may not be recognized by iOS project.
    • Refer to Apple Developer Documentation for details.

🀝 Contributing

This project was created for learning and reference purposes. If you find improvements or issues, feel free to create Issues or PRs in the project, but contacting through ChannelTalk service will enable faster responses.

πŸ“„ License

This project is used only for learning and testing purposes. ChannelTalk SDK license applies separately.



채널톑 SDK Flutter Sample Project

Flutter μ•±μ—μ„œ λ„€μ΄ν‹°λΈŒ 채널톑 SDKλ₯Ό μ‚¬μš©ν•˜λŠ” 방법에 λŒ€ν•œ μƒ˜ν”Œ ν”„λ‘œμ νŠΈμž…λ‹ˆλ‹€.

πŸ“‹ ν”„λ‘œμ νŠΈ κ°œμš”

이 ν”„λ‘œμ νŠΈλŠ” Flutterμ—μ„œ 채널톑 SDKλ₯Ό μ‚¬μš©ν•˜λŠ” 방법을 ν…ŒμŠ€νŠΈν•˜κΈ° μœ„ν•΄ λ§Œλ“€μ–΄μ‘ŒμŠ΅λ‹ˆλ‹€. Flutter κ°œλ°œμžλ“€μ΄ 채널톑 SDKλ₯Ό λ„μž…ν•˜κΈ° 전에 μ°Έκ³ ν•  수 μžˆλŠ” μ‹€μ œ κ΅¬ν˜„ 예제λ₯Ό μ œκ³΅ν•©λ‹ˆλ‹€.

⚠️ μ£Όμ˜μ‚¬ν•­

μ •μ‹μœΌλ‘œ μ§€μ›ν•˜λŠ” 채널톑 Flutter SDKλŠ” μ—†μ§€λ§Œ, 고객사듀이 μ‚¬μš©ν•  수 μžˆλ„λ‘ κ°€μ΄λ“œ 및 μƒ˜ν”Œ ν”„λ‘œμ νŠΈλ₯Ό μ œκ³΅ν•΄λ“œλ¦¬κ³  μžˆμŠ΅λ‹ˆλ‹€. λ‹€λ§Œ, κ°€μ΄λ“œμ™€ μƒ˜ν”Œ ν”„λ‘œμ νŠΈλŠ” λΉ λ₯΄κ²Œ μ΅œμ‹ ν™”λ˜μ§€ μ•Šμ„ 수 μžˆλ‹€λŠ” 점 μ–‘ν•΄ λΆ€νƒλ“œλ¦½λ‹ˆλ‹€.

이 ν”„λ‘œμ νŠΈλŠ” λ„€μ΄ν‹°λΈŒ Android/iOS SDKλ₯Ό Flutterμ—μ„œ μ‚¬μš©ν•  수 μžˆλ„λ‘ λΈŒλ¦¬μ§€ μ½”λ“œλ₯Ό κ΅¬ν˜„ν•œ 비곡식 연동 λ°©λ²•μž…λ‹ˆλ‹€. μ‹€μ œ ν”„λ‘œλ•μ…˜ ν™˜κ²½μ—μ„œ μ‚¬μš©ν•˜μ‹€ λ•ŒλŠ” μΆ©λΆ„ν•œ ν…ŒμŠ€νŠΈμ™€ 검증을 κ±°μΉ˜μ‹œκΈ° λ°”λžλ‹ˆλ‹€.

πŸ—οΈ ν”„λ‘œμ νŠΈ ꡬ쑰

channeltalk_sample/
β”œβ”€β”€ lib/
β”‚   β”œβ”€β”€ constants/
β”‚   β”‚   └── texts.dart                    # μ•± ν…μŠ€νŠΈ μƒμˆ˜
β”‚   β”œβ”€β”€ managers/
β”‚   β”‚   β”œβ”€β”€ channel_io_manager.dart       # Flutter ChannelIO Manager (Singleton)
β”‚   β”‚   └── fcm_manager.dart             # Firebase λ©”μ‹œμ§• λ§€λ‹ˆμ € (FCM + 채널톑 연동)
β”‚   β”œβ”€β”€ viewmodels/
β”‚   β”‚   β”œβ”€β”€ boot_test_viewmodel.dart      # Boot κΈ°λŠ₯ ν…ŒμŠ€νŠΈ ViewModel
β”‚   β”‚   β”œβ”€β”€ event_test_viewmodel.dart     # 이벀트 처리 ν…ŒμŠ€νŠΈ ViewModel
β”‚   β”‚   β”œβ”€β”€ fcm_test_viewmodel.dart       # FCM κΈ°λŠ₯ ν…ŒμŠ€νŠΈ ViewModel
β”‚   β”‚   └── profile_test_viewmodel.dart   # ν”„λ‘œν•„ κΈ°λŠ₯ ν…ŒμŠ€νŠΈ ViewModel
β”‚   β”œβ”€β”€ views/
β”‚   β”‚   β”œβ”€β”€ common/                       # 곡톡 UI μ»΄ν¬λ„ŒνŠΈ (8개 파일)
β”‚   β”‚   β”œβ”€β”€ pages/                        # 메인 μ•± νŽ˜μ΄μ§€λ“€
β”‚   β”‚   β”œβ”€β”€ test_sections/                # ν…ŒμŠ€νŠΈ κΈ°λŠ₯ μ„Ήμ…˜λ“€ (4개 파일)
β”‚   β”‚   └── widgets/                      # μ»€μŠ€ν…€ μœ„μ ―λ“€
β”‚   β”œβ”€β”€ firebase_options.dart            # Firebase μ„€μ • 파일 (FlutterFire CLI 생성)
β”‚   └── main.dart                        # μƒ˜ν”Œ μ•± κ΅¬ν˜„ (UI + 채널톑/FCM ν…ŒμŠ€νŠΈ)
β”œβ”€β”€ android/
β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”œβ”€β”€ build.gradle.kts              # Android 쒅속성 μ„€μ • (Firebase + 채널톑)
β”‚   β”‚   β”œβ”€β”€ google-services.json          # Firebase μ„€μ • 파일
β”‚   β”‚   └── src/main/
β”‚   β”‚       β”œβ”€β”€ AndroidManifest.xml       # μ»€μŠ€ν…€ FCM μ„œλΉ„μŠ€ 등둝
β”‚   β”‚       β”œβ”€β”€ res/values/strings.xml    # FCM 채널 μ„€μ •
β”‚   β”‚       └── kotlin/io/channel/channeltalk_sample/
β”‚   β”‚           β”œβ”€β”€ MainActivity.kt                    # Flutter ↔ Android λΈŒλ¦¬μ§€
β”‚   β”‚           β”œβ”€β”€ ChannelIOManager.kt               # Android λ„€μ΄ν‹°λΈŒ 둜직
β”‚   β”‚           β”œβ”€β”€ MainApplication.kt                # 채널톑 μ΄ˆκΈ°ν™”
β”‚   β”‚           └── ChannelIOFirebaseMessagingService.kt  # μ»€μŠ€ν…€ FCM μ„œλΉ„μŠ€
β”œβ”€β”€ ios/
β”‚   β”œβ”€β”€ Podfile                          # iOS 쒅속성 μ„€μ • (Firebase + 채널톑)
β”‚   β”œβ”€β”€ GoogleService-Info.plist         # Firebase μ„€μ • 파일
β”‚   └── Runner/
β”‚       β”œβ”€β”€ AppDelegate.swift            # Flutter ↔ iOS λΈŒλ¦¬μ§€ (Firebase + FCM)
β”‚       β”œβ”€β”€ ChannelIOManager.swift       # iOS λ„€μ΄ν‹°λΈŒ 둜직 (ChannelPluginDelegate)
β”‚       └── Info.plist                  # FCM λ°±κ·ΈλΌμš΄λ“œ λͺ¨λ“œ μ„€μ •
β”œβ”€β”€ πŸ“š λ¬Έμ„œλ“€/
β”‚   β”œβ”€β”€ README.md                        # 이 파일 (λ‹€κ΅­μ–΄ 지원)
β”‚   └── guide/                          # 언어별 κ°€μ΄λ“œ λ¬Έμ„œ
β”‚       β”œβ”€β”€ ko/                         # ν•œκ΅­μ–΄ κ°€μ΄λ“œ
β”‚       β”‚   β”œβ”€β”€ installation.md                 # SDK μ„€μΉ˜ κ°€μ΄λ“œ
β”‚       β”‚   β”œβ”€β”€ channel_io_manager_guide.md     # ChannelIOManager μ‚¬μš© κ°€μ΄λ“œ
β”‚       β”‚   β”œβ”€β”€ push_notification_guide.md      # ν‘Έμ‹œ μ•Œλ¦Ό 메인 κ°€μ΄λ“œ
β”‚       β”‚   β”œβ”€β”€ push_notification_android.md    # Android ν‘Έμ‹œ μ„€μ • κ°€μ΄λ“œ
β”‚       β”‚   └── push_notification_ios.md        # iOS ν‘Έμ‹œ μ„€μ • κ°€μ΄λ“œ
β”‚       └── en/                         # English guides
β”‚           β”œβ”€β”€ installation.md                 # SDK Installation Guide
β”‚           β”œβ”€β”€ channel_io_manager_guide.md     # ChannelIOManager Usage Guide
β”‚           β”œβ”€β”€ push_notification_guide.md      # Push Notification Main Guide
β”‚           β”œβ”€β”€ push_notification_android.md    # Android Push Setup Guide
β”‚           └── push_notification_ios.md        # iOS Push Setup Guide
└── pubspec.yaml                        # Flutter νŒ¨ν‚€μ§€ (firebase_core, firebase_messaging)

πŸ”§ κ°œλ°œν™˜κ²½ μš”κ΅¬μ‚¬ν•­

μ΅œμ†Œ μš”κ΅¬μ‚¬ν•­

  • Flutter SDK: 3.0 이상
  • iOS: iOS 15.0 이상
  • Android: API 21 이상 (Android 5.0)
  • 채널톑 ν”Œλžœ: 유료 μ„œλΉ„μŠ€ ν”Œλžœ

이 ν”„λ‘œμ νŠΈμ˜ κ°œλ°œν™˜κ²½

Flutter

  • Flutter: 3.35.2 (stable channel)
  • Dart: 3.9.0
  • Firebase Core: 2.32.0
  • Firebase Messaging: 14.7.10

iOS

  • Xcode: 16.3 (Build 16E140)
  • Swift: 6.1
  • CocoaPods: 1.16.2

Android

  • Android Gradle: 8.12
  • Android Target SDK: API 35
  • Android Compile SDK: API 35
  • Android Min SDK: API 21
  • Firebase BOM: 33.1.2
  • Google Services Plugin: Latest (μžλ™)

ChannelIO SDK

  • 채널톑 Android SDK: 12.13.0
  • 채널톑 iOS SDK: Latest (μžλ™ μ΅œμ‹  버전)

πŸš€ SDK κ°€μ΄λ“œ

1. SDK μ„€μΉ˜ κ°€μ΄λ“œ

채널톑 SDK μ„€μΉ˜ 및 ν”„λ‘œμ νŠΈ 섀정에 λŒ€ν•œ μžμ„Έν•œ λ‚΄μš©:

πŸ“‹ ν•œκ΅­μ–΄ μ„€μΉ˜ κ°€μ΄λ“œ - 단계별 μ„€μΉ˜ κ°€μ΄λ“œ

2. ν‘Έμ‹œ μ•Œλ¦Ό μ„€μ •

채널톑 ν‘Έμ‹œ μ•Œλ¦Όμ„ μœ„ν•œ Firebase FCM 연동 μ„€μ •:

πŸ“¬ ν•œκ΅­μ–΄ ν‘Έμ‹œ μ•Œλ¦Ό μ„€μ • κ°€μ΄λ“œ - Firebase FCM + 채널톑 연동

3. ChannelIOManager μ‚¬μš© κ°€μ΄λ“œ

Flutterμ—μ„œ ChannelIOManagerλ₯Ό μ‚¬μš©ν•˜λŠ” 방법과 μ½”λ“œ μž¬μ‚¬μš©μ— λŒ€ν•œ 상세 κ°€μ΄λ“œ:

βš™οΈ ν•œκ΅­μ–΄ ChannelIOManager κ°€μ΄λ“œ - κ΅¬ν˜„ ꡬ쑰, μ‚¬μš©λ²•, μž¬μ‚¬μš© κ°€μ΄λ“œ

4. 곡식 λ¬Έμ„œ

πŸ“ μƒ˜ν”Œ ν”„λ‘œμ νŠΈ μ‹€ν–‰ 방법

⚠️ μ€‘μš”: 이 μƒ˜ν”Œ ν”„λ‘œμ νŠΈλ₯Ό μ‹€ν–‰ν•˜λ €λ©΄ Firebase FCM 섀정이 ν•„μˆ˜μž…λ‹ˆλ‹€. Firebase μ„€μ • μ—†μ΄λŠ” ν‘Έμ‹œ μ•Œλ¦Ό κΈ°λŠ₯이 λ™μž‘ν•˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€.

1. ν”„λ‘œμ νŠΈ 클둠 및 μ„€μ •

# 1. ν”„λ‘œμ νŠΈ 클둠
git clone https://github.com/channel-io/channel-flutter-sample
cd channeltalk_sample

# 2. Flutter 쒅속성 μ„€μΉ˜
flutter pub get

# 3. iOS 쒅속성 μ„€μΉ˜ (iOS λΉŒλ“œμ‹œ)
cd ios && pod install && cd ..

2. 채널톑 μ„€μ •

// lib/main.dart νŒŒμΌμ—μ„œ ν”ŒλŸ¬κ·ΈμΈ ν‚€ μ„€μ •
await channelIO.boot(
  pluginKey: "YOUR_PLUGIN_KEY",  // ← μ‹€μ œ ν”ŒλŸ¬κ·ΈμΈ ν‚€λ‘œ λ³€κ²½
  // ... 기타 μ„€μ •
);

3. Firebase μ„€μ • (ν•„μˆ˜)

  1. Firebase ν”„λ‘œμ νŠΈ 생성 (Firebase Consoleμ—μ„œ)
  2. Android/iOS μ•± μΆ”κ°€
  3. μ„€μ • 파일 λ‹€μš΄λ‘œλ“œ:
    • google-services.json β†’ android/app/
    • GoogleService-Info.plist β†’ ios/Runner/
  4. Firebase Cloud Messaging ν™œμ„±ν™” (Firebase Consoleμ—μ„œ)
  5. ν‘Έμ‹œ μ•Œλ¦Ό 자격증λͺ… μ„€μ • (채널톑 κ΄€λ¦¬μžμ—μ„œ)

4. μ•± μ‹€ν–‰

# Debug λͺ¨λ“œ μ‹€ν–‰
flutter run

# Release λΉŒλ“œ
flutter build apk --release  # Android
flutter build ios --release  # iOS

πŸ› οΈ μ½”λ“œ μž¬μ‚¬μš© κ°€μ΄λ“œ

μƒ˜ν”Œ ν”„λ‘œμ νŠΈμ˜ μ½”λ“œλ₯Ό μž¬μ‚¬μš©ν•˜κΈ°λ³΄λ‹€λŠ” 참고자료둜 μ‚¬μš©ν•˜μ‹œλŠ” 것을 ꢌμž₯λ“œλ¦½λ‹ˆλ‹€. λ§Œμ•½ μž¬μ‚¬μš©μ„ ν•˜λŠ” 경우, μ•„λž˜ λ‚΄μš©μ„ μ°Έμ‘°ν•˜μ—¬ μ½”λ“œλ₯Ό μˆ˜μ •ν•΄μ£Όμ„Έμš”.

핡심 κ΅¬ν˜„ νŒŒμΌλ“€

μ‹€μ œ ν”„λ‘œμ νŠΈμ—μ„œ μ‚¬μš©ν•˜λ €λ©΄ λ‹€μŒ νŒŒμΌλ“€μ„ ν™•μΈν•΄μ£Όμ„Έμš”.

Flutter λ ˆμ΄μ–΄

πŸ“ Flutter
β”œβ”€β”€ lib/managers/channel_io_manager.dart    # 채널톑 SDK Flutter μΈν„°νŽ˜μ΄μŠ€ (MethodChannel + 이벀트 관리)
β”œβ”€β”€ lib/managers/fcm_manager.dart          # Firebase FCM + 채널톑 톡합 κ΄€λ¦¬μž
└── lib/firebase_options.dart             # Firebase μ„€μ • (FlutterFire CLI 생성)

Android λ„€μ΄ν‹°λΈŒ

πŸ“ Android  
β”œβ”€β”€ android/app/src/main/kotlin/.../ChannelIOManager.kt           # 채널톑 λ„€μ΄ν‹°λΈŒ 둜직 (ChannelPluginListener)
β”œβ”€β”€ android/app/src/main/kotlin/.../MainActivity.kt              # Flutter ↔ Android λΈŒλ¦¬μ§€
β”œβ”€β”€ android/app/src/main/kotlin/.../MainApplication.kt           # 채널톑 μ΄ˆκΈ°ν™”
β”œβ”€β”€ android/app/src/main/kotlin/.../ChannelIOFirebaseMessagingService.kt  # μ»€μŠ€ν…€ FCM μ„œλΉ„μŠ€
β”œβ”€β”€ android/app/src/main/AndroidManifest.xml  # FCM μ„œλΉ„μŠ€ 등둝 + κΆŒν•œ μ„€μ •
└── android/app/src/main/res/values/strings.xml  # FCM 채널 μ„€μ •

iOS λ„€μ΄ν‹°λΈŒ

πŸ“ iOS
β”œβ”€β”€ ios/Runner/ChannelIOManager.swift     # 채널톑 λ„€μ΄ν‹°λΈŒ 둜직 (ChannelPluginDelegate)
β”œβ”€β”€ ios/Runner/AppDelegate.swift          # Flutter ↔ iOS λΈŒλ¦¬μ§€ (Firebase + FCM + UNUserNotificationCenter)
└── ios/Runner/Info.plist                # FCM λ°±κ·ΈλΌμš΄λ“œ λͺ¨λ“œ μ„€μ •

μ„€μ • 파일

πŸ“ Firebase μ„€μ •
β”œβ”€β”€ android/app/google-services.json      # Android Firebase μ„€μ •
β”œβ”€β”€ ios/GoogleService-Info.plist          # iOS Firebase μ„€μ •
β”œβ”€β”€ android/app/build.gradle.kts          # Android 쒅속성 (Firebase BOM + 채널톑)
└── ios/Podfile                           # iOS 쒅속성 (Firebase + 채널톑)

μ£Όμš” κ΅¬ν˜„ νŠΉμ§•

  1. ν†΅ν•©λœ ChannelIOManager μ•„ν‚€ν…μ²˜:

    • Flutter: Singleton νŒ¨ν„΄μœΌλ‘œ λ‹¨μΌν™”λœ SDK μΈν„°νŽ˜μ΄μŠ€ 제곡
    • Android: ChannelPluginListener κ΅¬ν˜„μœΌλ‘œ μ‹€μ‹œκ°„ 이벀트 μˆ˜μ‹ 
    • iOS: CHTChannelPluginDelegate κ΅¬ν˜„μœΌλ‘œ μ‹€μ‹œκ°„ 이벀트 μˆ˜μ‹ 
    • MethodChannel: ν”Œλž«νΌ κ°„ μ–‘λ°©ν–₯ 톡신 (λ©”μ†Œλ“œ 호좜 + 이벀트 콜백)
  2. ν”Œλž«νΌλ³„ μ΅œμ ν™”λœ FCM 처리:

    • Android: ChannelIOFirebaseMessagingService (FlutterFirebaseMessagingService 상속)μ—μ„œ λ„€μ΄ν‹°λΈŒ 처리
    • iOS: AppDelegate의 UNUserNotificationCenterDelegateμ—μ„œ Flutter와 연동
  3. 채널톑 λ©”μ‹œμ§€ μ •ν™•ν•œ νŒλ³„: data['provider'] == 'Channel.io' ν‚€λ‘œ ꡬ뢄

  4. Flutter FCM ν˜Έν™˜μ„± μœ μ§€: κΈ°μ‘΄ Flutter FCM κΈ°λŠ₯을 μ™„μ „νžˆ λ³΄μ‘΄ν•˜λ©΄μ„œ 채널톑 λ©”μ‹œμ§€ μΆ”κ°€ 처리

πŸ“– μžμ„Έν•œ ChannelIOManager μ‚¬μš©λ²•: ChannelIOManager κ°€μ΄λ“œμ—μ„œ κ΅¬ν˜„ ꡬ쑰, μ‚¬μš©λ²•, μ½”λ“œ μž¬μ‚¬μš©μ— λŒ€ν•œ 상세 정보λ₯Ό ν™•μΈν•˜μ„Έμš”.

μž¬μ‚¬μš© μ‹œ μ£Όμ˜μ‚¬ν•­

  1. νŒ¨ν‚€μ§€λͺ… λ³€κ²½: 파일 λ‚΄ νŒ¨ν‚€μ§€λͺ…을 μ‹€μ œ ν”„λ‘œμ νŠΈμ— 맞게 μˆ˜μ •
  2. ν”ŒλŸ¬κ·ΈμΈ ν‚€ μ„€μ •: μ±„λ„ν†‘μ—μ„œ λ°œκΈ‰λ°›μ€ μ‹€μ œ ν‚€ μ‚¬μš©
  3. Firebase μ„€μ •: google-services.json / GoogleService-Info.plist νŒŒμΌμ„ μ‹€μ œ ν”„λ‘œμ νŠΈ μ„€μ •μœΌλ‘œ ꡐ체
  4. κΆŒν•œ μ„€μ •: Android 13+ POST_NOTIFICATIONS κΆŒν•œ 및 iOS μ•Œλ¦Ό κΆŒν•œ 확인
  5. ⚠️ ChannelIOManager.swift μž¬μ‚¬μš© μ‹œ 참고사항:
    • ChannelIOManager.swift νŒŒμΌμ€ Xcodeμ—μ„œ 직접 μΆ”κ°€ν•˜λŠ” 것을 ꢌμž₯λ“œλ¦½λ‹ˆλ‹€
    • 파일 νƒμƒ‰κΈ°μ—μ„œ λ³΅μ‚¬ν•˜κ±°λ‚˜ μ™ΈλΆ€ μ—λ””ν„°λ‘œ μƒμ„±ν•˜λ©΄ iOS ν”„λ‘œμ νŠΈμ—μ„œ μΈμ§€ν•˜μ§€ λͺ»ν•  수 μžˆμŠ΅λ‹ˆλ‹€.
    • μžμ„Έν•œ λ‚΄μš©μ€ Apple 개발자 λ¬Έμ„œλ₯Ό μ°Έκ³ ν•˜μ„Έμš”.

🀝 κΈ°μ—¬ 방법

이 ν”„λ‘œμ νŠΈλŠ” ν•™μŠ΅ 및 μ°Έκ³  λͺ©μ μœΌλ‘œ λ§Œλ“€μ–΄μ‘ŒμŠ΅λ‹ˆλ‹€. κ°œμ„  μ‚¬ν•­μ΄λ‚˜ λ¬Έμ œμ μ„ λ°œκ²¬ν•˜μ‹œλ©΄ ν”„λ‘œμ νŠΈμ˜ Issue ν˜Ήμ€ PR을 μš”μ²­ν•΄μ£Όμ…”λ„ μ’‹μ§€λ§Œ, 채널톑 μ„œλΉ„μŠ€λ₯Ό 톡해 문의λ₯Ό μ£Όμ‹œλ©΄ λΉ λ₯Έ 응닡이 κ°€λŠ₯ν•©λ‹ˆλ‹€.

πŸ“„ λΌμ΄μ„ μŠ€

이 ν”„λ‘œμ νŠΈλŠ” ν•™μŠ΅ 및 ν…ŒμŠ€νŠΈ λͺ©μ μœΌλ‘œλ§Œ μ‚¬μš©λ©λ‹ˆλ‹€. 채널톑 SDK의 λΌμ΄μ„ μŠ€λŠ” λ³„λ„λ‘œ μ μš©λ©λ‹ˆλ‹€.