🚀 New Release: Introducing AI Agent for Ecommerce: Sell more. Support faster. Grow smarter.

Book your AI agent demo
Start for free
Table of Content

    Flutter iOS SDK

    • September 17, 2026
    • 3 mins read

    Table of Content

      REVE Chat’s Flutter iOS SDK can be seamlessly integrated with your mobile apps and enable your team deliver in-app messaging to your app users for better engagement and customer support.

      Getting Started with Flutter iOS SDK

      This tutorial shows you how to add Flutter iOS and get started in a few minutes. Necessary or minimum requirements:

      1. Xcode 26 or above
      2. iOS 13 or above

      Important Note:

      iOS testing requires a physical device. The SDK framework is device-only (arm64) and will not link against the iOS Simulator.

      Installation: CocoaPods (recommended)

      # At the top of ios/Podfile
      platform :ios, '13.0'
       
      # Inside your Runner target, make sure use_frameworks! is uncommented
      target 'Runner' do
        use_frameworks!
        pod 'ReveChatSDK', '3.0.2.10'
      end
       
      # Required. Merge into your existing post_install block.
      # Xcode 26+ rejects AFNetworking's <netinet6/in6.h> import (a private system header).
      post_install do |installer|
        installer.pods_project.targets.each do |target|
          flutter_additional_ios_build_settings(target)
        end
       
        af_dir = File.join(installer.sandbox.root, 'AFNetworking', 'AFNetworking')
        if File.directory?(af_dir)
          import_line = '#import <netinet6/in6.h>'
          Dir.glob(File.join(af_dir, '**', '*.{h,m}')).each do |path|
            lines = File.readlines(path)
            filtered = lines.reject { |l| l.strip == import_line }
            next if filtered.size == lines.size
            mode = File.stat(path).mode & 0o7777
            File.chmod(0o644, path)
            File.write(path, filtered.join)
            File.chmod(mode, path)
          end
        end
      end

      Then run pod install.

      Flutter iOS SDK integration process

      To integrate Flutter iOS SDK with your iOS mobile app, please follow the below mentioned steps:

      Update your plist

      The iOS SDK uses the camera and photo library in iOS.

      If your app does not already request permissions for these features, you should update your info.plist file with a usage description for NSPhotoLibraryUsageDescription and NSCameraUsageDescription.

      /* You can do this by adding the following lines in your plist source code */
      <key>NSPhotoLibraryUsageDescription</key>
      <string><description to use photo library></string>
      <key>NSCameraUsageDescription</key>
      <string><description to use camera></string>
      <key>NSAppTransportSecurity</key>        <dict>
      <key>NSAllowsArbitraryLoads</key>
      <true/></dict>
      <key>NSMicrophoneUsageDescription</key>
      <string><Add your description here></string>

      Update Appdelegate.swift

      Delete the entire existing Swift block that starts with let flutterVC = FlutterViewController(). Then add the four pieces below to your existing AppDelegate. Leave your other plugin registration, push-notification setup, and other code untouched.

      1. Add the import alongside your others

      import ReveChatSDK

      2. Add a stored property on your AppDelegate class

      private let reveChatManager = ReveChatManager()

      Note: This must be a property, not a local variable — the manager has to outlive the launch method.

      3. Inside your existing didFinishLaunchingWithOptions, before the return, add

      reveChatManager.setupAccount(with: "account_number") // put your account_number here
      DispatchQueue.main.async { [weak self] in
        self?.configureReveChatChannel()
      }
      

      4. Add this method to your AppDelegate class

      private func configureReveChatChannel() {
        guard
          let scene = UIApplication.shared.connectedScenes.first as? UIWindowScene,
          let rootVC = scene.windows.first?.rootViewController
        else { return }
       
        let flutterVC: FlutterViewController?
        let navigationController: UINavigationController?
       
        if let nav = rootVC as? UINavigationController,
           let flutter = nav.viewControllers.first as? FlutterViewController {
          flutterVC = flutter
          navigationController = nav
        } else if let flutter = rootVC as? FlutterViewController {
          flutterVC = flutter
          navigationController = flutter.navigationController
        } else {
          return
        }
       
        guard let flutterVC else { return }
       
        let channel = FlutterMethodChannel(
          name: "com.revechat.sdk/sdkchannel",
          binaryMessenger: flutterVC.binaryMessenger
        )
       
        channel.setMethodCallHandler { [weak self, weak navigationController] call, result in
          guard let self, call.method == "StartREVEChat" else {
            result(FlutterMethodNotImplemented)
            return
          }
          guard let args = call.arguments as? [String: String],
                let name = args["name"],
                let email = args["email"],
                let phone = args["phone"] else {
            result(FlutterError(code: "INVALID_ARGS",
                                message: "name, email and phone are required",
                                details: nil))
            return
          }
          guard let navController = navigationController else {
            result(FlutterError(code: "NAV_MISSING",
                                message: "Flutter navigation controller not available",
                                details: nil))
            return
          }
          self.reveChatManager.initiateReveChat(
            with: name,
            visitorEmail: email,
            visitorMobile: phone,
            onNavigationViewController: navController
          )
          result("success")
        }
      }
      

      Important Note:

      If your app's root view controller is not a FlutterViewController or a UINavigationController wrapping one, adapt the lookup in configureReveChatChannel() to find your FlutterViewController and the UINavigationController you want the chat UI pushed onto.

      Update main.dart

      • Write startActivity function as like bellow
      Future<void> _startActivity() async {
          try {
            const platform = MethodChannel('com.revechat.sdk/sdkchannel');
       
            final String result = await platform.invokeMethod('StartREVEChat',{
              'email':'[email protected]', // put your email here
              'name':'netzaintest', //put your name here
              'phone':'01409404444', //put your mobile number here
            });
       
            debugPrint('Result: $result ');
          } on PlatformException catch (e) {
            debugPrint("Error: '${e.message}'.");
          }
      }
      • Call this start activity from a button action
      floatingActionButton: FloatingActionButton(
              onPressed: _startActivity,
              tooltip: 'Increment',
              child: const Icon(Icons.add),
       )

      Import ReveChat headers

      // Objective-C
      #import <ReveChatSDK/ReveChatSDK.h>
       
      // Swift
      import ReveChatSDK

      Setup Account ID

      // Objective-C
      [[ReveChatManager sharedManager] setupAccountWith:<your account id>];
       
      // Swift
      /* declare object for reve chat manager class */
      let reveChatManager = ReveChatManager()
      reveChatManager.setupAccount(with: <your account id as string>)

      Initiate ReveChat

      // Objective-C
      [[ReveChatManager sharedManager]
       initiateReveChatWith:<visitor name>
       visitorEmail:<visitor email>
       visitorMobile:<visitor mobile>
       onNavigationViewController:<your navigation controller>];
       
      // Swift
      /* initiate the class with name, email, mobile and parent controller of the sdk as parameters */
      reveChatManager.initiateReveChat(with: <visitor name>,
      visitorEmail: <visitor email>,
      visitorMobile: <visitor mobile>,
      onNavigationViewController: <UINavigationController on which you want it to load>)
      // To initiate video call, the audio parameter should be false

      Enable Notification

      You can enable the notification when the app is in background mode. Use the below code:

      var backgroundUpdateTask: UIBackgroundTaskIdentifier = UIBackgroundTaskIdentifier(rawValue: 0)
       
      // Method name: "sceneDidBecomeActive" or "applicationDidBecomeActive"
      self.endBackgroundUpdateTask()
       
      // Method name: "sceneWillResignActive" or "applicationWillResignActive"
      self.backgroundUpdateTask = UIApplication.shared.beginBackgroundTask(expirationHandler: {
                      self.endBackgroundUpdateTask()
                  })
       
      func endBackgroundUpdateTask() {
              UIApplication.shared.endBackgroundTask(self.backgroundUpdateTask)
              self.backgroundUpdateTask = UIBackgroundTaskIdentifier.invalid
          }

      Additional changes(optional)

      // Objective-C
      /* for title while chatting */
      [ReveChatManager sharedManager].title = @"me talking";
      /* for theme color while chatting */
      [ReveChatManager sharedManager].themeColor = [UIColor blueColor];
      /* for background color */
      [ReveChatManager sharedManager].backgroundColor = [UIColor yellowColor];
      /* for navigation bar color */
      [ReveChatManager sharedManager].navBarColor = [UIColor orangeColor];
      /* for tint color of navigation bar while chatting */
      [ReveChatManager sharedManager].headerTintColor = [UIColor whiteColor];
      /* for title color while chatting */
      [ReveChatManager sharedManager].headerTextColor = [UIColor whiteColor];
      /* for incoming chat bubble color */
      [ReveChatManager sharedManager].incomingBubbleColor = [UIColor blueColor];
      /* for outgoing chat bubble color */
      [ReveChatManager sharedManager].outgoingBubbleColor = [UIColor blueColor];
       
      // Swift
      /* for title while chatting */
      reveChatManager.setChatTitle("Lets chat")
      /* for theme color while chatting */
      reveChatManager.themeColor = UIColor.blue
      /* for background color */
      reveChatManager.backgroundColor = UIColor.yellow
      /* for navigation bar color */
      reveChatManager.navBarColor = UIColor.gray
      /* for tint color of header */
      reveChatManager.headerTintColor = UIColor.red
      /* for title color while chatting */
      reveChatManager.headerTextColor = UIColor.black
      /* for incoming chat bubble color */
      reveChatManager.incomingBubbleColor = UIColor.blue
      /* for outgoing chat bubble color */
      reveChatManager.outgoingBubbleColor = UIColor.yellow

      FAQs (General issues faced while integrating)

      1. I am facing the following error in console ld: library not found for -lAFNetworking Reason: in your pod file use_frameworks! line is commented. Solution: Uncomment use_frameworks! line and build again.
      2. Getting Crash when initiating revechat sdk reason: the pod has been updated on the cocoa pods solution: run ‘pod update‘ in the terminal on your project path.
      3. Build fails with: Use of private header from outside its module: ‘netinet6/in6.h’. Reason: the post_install hook is missing from your Podfile. Solution: add the hook from the Installation section above, then run pod install again.
      4. Build fails on the iOS Simulator with an architecture or “framework not found” error. Reason: the SDK framework is device-only (arm64) and has no Simulator slice. Solution: run on a physical iOS device.
      5. pod install prints deprecation and xcconfig warnings. These are expected and safe to ignore — they do not affect your build.
      [!] Can't merge user_target_xcconfig for pod targets: ["GoogleWebRTC", "ReveChatSDK"].
          Singular build setting EXCLUDED_ARCHS[sdk=iphonesimulator*] has different values.
      [!] AFNetworking has been deprecated in favor of Alamofire
      [!] GoogleWebRTC has been deprecated

      AUTHOR’S BIO

      Khalid Hassan Emran is a Senior Technical Content Writer with more than 5 years of experience in technical documentation, content marketing, and blog writing. He specializes in simplifying complex technical concepts into clear, engaging content. In addition, he is an ...

      0:00 / 0:00
      ×