Kommunicate-io / Kommunicate-Flutter-Plugin

A flutter plugin for Kommunicate customer support live chat.
BSD 3-Clause "New" or "Revised" License
16 stars 23 forks source link

[HELP] Cannot build ios using flutter #92

Closed AzamudinInnoractive closed 12 months ago

AzamudinInnoractive commented 1 year ago
Screenshot 2023-09-19 at 4 57 32 PM
joshi-kt commented 1 year ago

@AzamudinInnoractive This issue is due to the latest XCode 15 beta version and it will be fixed in the next flutter release. Until then you can use latest app store version of XCode for building your app.

AzamudinInnoractive commented 1 year ago
Screenshot 2023-09-19 at 5 32 02 PM

Im using latest app store version @himanshujoshi848

joshi-kt commented 1 year ago

@AzamudinInnoractive We will be releasing a fix for this XCode 15 build issue with the next flutter release. Till then, you can use XCode 14 for building your project.

joshi-kt commented 1 year ago

@AzamudinInnoractive We will be releasing a fix for this XCode 15 build issue with the next flutter release. Till then, you can use XCode 14 for building your project.

For your reference the issue is listed here. We are releasing the updated flutter plugin with all XCode 15 related issues fixed on 21 September. Thanks for your patience.

AzamudinInnoractive commented 1 year ago

@himanshujoshi848 thanks for the update. will wait for new plugin release.

AzamudinInnoractive commented 12 months ago

after revert to 14.3, the error resolved but app crash when starting the chat @himanshujoshi848

joshi-kt commented 12 months ago

can we get your implementation code ?

AzamudinInnoractive commented 12 months ago
void startInquiry(BuildContext context, WidgetRef ref) {
if (ref.watch(inquiryEmailProvider).isEmpty) {
  ref.read(inquiryEmailProvider.notifier).state =
      ref.read(publicDashboardDataProvider.notifier).kommunicateUserEmail;
}

if (ref.watch(inquiryNameProvider).isEmpty) {
  ref.read(inquiryNameProvider.notifier).state = ref
      .read(publicDashboardDataProvider.notifier)
      .kommunicateUserFullName;
}

if (ref.watch(inquiryPhoneProvider).isEmpty) {
  ref.read(inquiryPhoneProvider.notifier).state = ref
      .read(publicDashboardDataProvider.notifier)
      .kommunicateUserContactNumber;
}

dynamic user = {
  'userId': ref.watch(
      inquiryEmailProvider), //Replace it with the userId of the logged in user
  'password': '', //Put password here if user has password, ignore otherwise
  'email': ref.watch(inquiryEmailProvider),
  'displayName': ref.watch(inquiryNameProvider),
  'contactNumber': ref.watch(inquiryPhoneProvider),
};

dynamic conversationObject = {
  'appId': dotenv.env[
      "KOMMUNICATE_APP_ID"], // The [APP_ID](https://dashboard.kommunicate.io/settings/install) obtained from Kommunicate dashboard.
  'kmUser': jsonDecode(jsonEncode(user)),
  'isSingleConversation': false,
};

if (ref.watch(conversationIdProvider).isNotEmpty) {
  KommunicateFlutterPlugin.openParticularConversation(
      ref.watch(conversationIdProvider));
  ref.read(isLoadingProvider.notifier).state = false;
  return;
}

KommunicateFlutterPlugin.buildConversation(conversationObject)
    .then((clientConversationId) {
  debugPrint(
      "Conversation builder success : " + clientConversationId.toString());
  ref.read(isLoadingProvider.notifier).state = false;
  ref.read(conversationIdProvider.notifier).state =
      clientConversationId.toString();
}).catchError((error) {
  debugPrint("Conversation builder error : " + error.toString());
}).whenComplete(() {
  debugPrint("Conversation builder when completed");
});

}

AzamudinInnoractive commented 12 months ago

this is the error i received before crash

Could not cast value of type '__NSDictionaryI' (0x1128c8bf8) to 'NSString' (0x1128c87d0).

joshi-kt commented 12 months ago

@AzamudinInnoractive don't decode the User object before passing it to 'kmUser'. You can use this conversation object :

dynamic conversationObject = {
  'appId': dotenv.env[
      "KOMMUNICATE_APP_ID"], // The [APP_ID](https://dashboard.kommunicate.io/settings/install) obtained from Kommunicate dashboard.
  'kmUser': jsonEncode(user),
  'isSingleConversation': false,
};

If the issue still persists or if you face any other issue you can contact our support team and book a call. Thanks !

joshi-kt commented 12 months ago

@AzamudinInnoractive We have resolved all issues related to XCode 15 in our latest flutter release 1.7.2 . Thanks for your patience.

waheed45103 commented 12 months ago

@himanshujoshi848 I have checked, this issue resolved in 1.7.2. Thanks