I have initialized correctly the CometChatApp with their settings as you can see in the code below:
AppSettings appSettings = (AppSettingsBuilder()
..subscriptionType = CometChatSubscriptionType.allUsers
..region = Env.cometChatRegion
..autoEstablishSocketConnection = true)
.build();
CometChat.init(Env.cometChatAppId, appSettings,
onSuccess: (String successMessage) {
debugPrint(
"CometChat initialization completed successfully $successMessage");
}, onError: (CometChatException excep) {
debugPrint(
"CometChat initialization failed with exception: ${excep.message}");
});
And then added the UIKitSettings and CometChatUiKit init method for Flutter as stated in the doc: Integration of Flutter UiKit V4, code below:
UIKitSettings uiKitSettings = (UIKitSettingsBuilder()
..subscriptionType = CometChatSubscriptionType.allUsers
..autoEstablishSocketConnection = true
..region = Env.cometChatRegion
..appId = Env.cometChatAppId
..authKey = Env.cometChatAuthKey
..extensions = CometChatUIKitChatExtensions.getDefaultExtensions())
.build();
CometChatUIKit.init(
uiKitSettings: uiKitSettings,
onSuccess: (String successMessage) {
debugPrint(
"CometChatUIKit initialization completed successfully $successMessage");
},
onError: (CometChatException e) {
debugPrint(
"CometChatUIKit initialization failed with exception: ${e.message}");
});
And the messaging part works perfect, I can send and receive messages (text and media) between users without a problem. but when I add the CallUiKit for Flutter as stated in the doc (which is basically the same UiKit method adding this line:
..callingExtension = CometChatCallingExtension()
)
I expect to see this behaviour, as the doc says:
On successful initialization of the Chat and Calls UI Kit, Call Buttons will be added in the appBarOptions of CometChatMessageHeader. This will allow users to initiate voice or video calls to other chat participants. Apart from Call Buttons, the Calls UI Kit also provides fully functional UI components for Incoming, Outgoing and Ongoing Calls. But I'm not seeing the buttons appearing in the AppBar only the default ProfileInfo one.
I have tried adding the init method from the Flutter SDKs (Chat and Call, both) as well, even though I'm only interested on working with the FlutterUiKit library, I have tried using the old flutter SDK suggested by the doc, and messing around with the code as well. So far, nothing worked.
PS:I have added the dependencies in my puspec.yaml file correctly as well:
cometchat_chat_uikit: ^4.0.0-beta.2
cometchat_sdk: ^4.0.0-beta1
cometchat_calls_uikit: ^4.0.0-beta.1
After a chat with the CometChat support team through their email, they managed to figure out what I was doing wrong. So, here are the fixes:
..callingExtension = CometChatCallingExtension()
..extensions = CometChatUIKitChatExtensions.getDefaultExtensions()