clevertap-flutter
clevertap-flutter copied to clipboard
Getting warning regarding platform channel in ios
While running the project in ios (I tried from simulator) I get this console output regarding Clevertap.
The 'clevertap_plugin/native_to_dart' channel sent a message from native to Flutter on a non-platform thread. Platform channel messages must be sent on the platform thread. Failure to do so may result in data loss or crashes, and must be fixed in the plugin or application code creating that channel
Clevertap Version: clevertap_plugin: ^1.8.1
import UIKit
import Flutter
import GoogleMaps
import CleverTapSDK
import clevertap_plugin
@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
GeneratedPluginRegistrant.register(with: self)
CleverTap.autoIntegrate()
registerForPush()
CleverTapPlugin.sharedInstance()?.applicationDidLaunch(options: launchOptions)
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
func registerForPush() {
UNUserNotificationCenter.current().delegate = self
}
override func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) {
completionHandler([.sound, .alert, .badge])
}
}
public func shouldHandleCleverTap(_ url: URL?, for channel: CleverTapChannel) -> Bool {
// print("Handling URL: \(url!) for channel: \(channel)")
return true
}
Hi @ShashankSMayya,
Can you please provide some more details on this -
- Are you getting this warning during App launch or any custom steps?
- Can you provide steps which will reproduce this warning, also provide full console logs with debug enabled to investigate it.
any update ?
i got same issues
- Are you getting this warning during App launch or any custom steps?
- app launch
- Can you provide steps which will reproduce this warning, also provide full console logs with debug enabled to investigate it.
- launch the apps
Launching lib/main.dart on iPhone 15 Pro Max in debug mode... Xcode build done. 29.1s [ERROR:flutter/shell/platform/darwin/graphics/FlutterDarwinContextMetalImpeller.mm(42)] Using the Impeller rendering backend. [ERROR:flutter/shell/common/shell.cc(1015)] The 'clevertap_plugin/native_to_dart' channel sent a message from native to Flutter on a non-platform thread. Platform channel messages must be sent on the platform thread. Failure to do so may result in data loss or crashes, and must be fixed in the plugin or application code creating that channel. See https://docs.flutter.dev/platform-integration/platform-channels#channels-and-platform-threading for more information.
Hi @rifdi123, Which flutter version are you using? Also Is this a warning or build error?
Hi @rifdi123 @ShashankSMayya We are working on this. We will update you when new version will be released with the fix.
The fix for this has been released on our latest v2.4.1. Please update to our latest version: https://github.com/CleverTap/clevertap-flutter/releases/tag/2.4.1