alamin-karno / flutter-crisp-chat

A flutter plugin package for using crisp chat natively on Android & iOS.
MIT License
7 stars 4 forks source link

Freezes completely on iOS #12

Open frozenlex opened 3 months ago

frozenlex commented 3 months ago

Describe the bug When you press the "open chat" button on IOS, it freezes. It allows us to enter the first characters, we may even have time to send it, but in the end it freezes completely.

To Reproduce Steps to reproduce the behavior:

  1. Press the “open chat” button - the result is freezing.

Expected behavior When opening the chat it should not freeze and everything should work fine

Screenshots

Desktop (please complete the following information):

Smartphone (please complete the following information):

alamin-karno commented 3 months ago

Thanks, @frozenlex for describing your issue. I have tried and it's working fine on my device iPhone 15 Pro Max. Can you make sure that you are using the right WEBSITE_KEY and have add all the necessary permission for iOS.

frozenlex commented 3 months ago

What permissions need to be added? I previously used the SDK https://pub.dev/packages/crisp_chat_sdk - everything worked, but now it started to freeze in the same way on iOS. I decided to try your SDK - it freezes when I try to write to the chat. And for a completely unknown reason. I'm using FlutterFlow for my application. Could this be the case?

frozenlex commented 3 months ago

Will he really not work without permission, for example, on camera?

frozenlex commented 3 months ago

Thanks, @frozenlex for describing your issue. I have tried and it's working fine on my device iPhone 15 Pro Max. Can you make sure that you are using the right WEBSITE_KEY and have add all the necessary permission for iOS.

It hangs like this. Video. In the video I erased the characters, by the end it simply froze.

https://github.com/alamin-karno/flutter-crisp-chat/assets/145661819/cdc043b0-fc0f-4624-a07a-8964186c020e

`// Automatic FlutterFlow imports import '/backend/backend.dart'; import '/flutter_flow/flutter_flow_theme.dart'; import '/flutter_flow/flutter_flow_util.dart'; import '/custom_code/widgets/index.dart'; // Imports other custom widgets import '/custom_code/actions/index.dart'; // Imports custom actions import '/flutter_flow/custom_functions.dart'; // Imports custom functions import 'package:flutter/material.dart'; // Begin custom widget code // DO NOT REMOVE OR MODIFY THE CODE ABOVE!

import 'package:crisp_chat/crisp_chat.dart';

class CrispChatiOS extends StatefulWidget { const CrispChatiOS({ super.key, this.width, this.height, required this.name, required this.uid, required this.avatar, });

final double? width; final double? height; final String name; final String uid; final String avatar;

@override State createState() => _CrispChatiOSState(); }

class _CrispChatiOSState extends State { final String websiteID = 'ALL IS OK, DELETE FROM CODE'; late CrispConfig config;

@override void initState() { super.initState(); config = CrispConfig( websiteID: websiteID, ); }

@override Widget build(BuildContext context) { return MaterialApp( debugShowCheckedModeBanner: false, home: Scaffold( appBar: AppBar( title: const Text('Crisp Chat'), ), body: Center( child: Column( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, children: [ ElevatedButton( onPressed: () async { await FlutterCrispChat.openCrispChat(config: config); }, child: const Text('Open Crisp Chat'), ), const SizedBox(height: 20), ElevatedButton( onPressed: () async { await FlutterCrispChat.resetCrispChatSession(); }, child: const Text('Reset Chat Session'), ), ], ), ), ), ); } }`

alamin-karno commented 3 months ago

I hope this is because of you're using FlutterFlow debug mode Simulator. Try to check on real device it will work fine. Or run the code on Android Studio or VS Code.

frozenlex commented 3 months ago

I hope this is because of you're using FlutterFlow debug mode Simulator. Try to check on real device it will work fine. Or run the code on Android Studio or VS Code.

I haven’t tested your SDK on a real device, but the previous SDK with the same bug was on a real device. 99% will be the same.. I'll check for 30 minutes and write here. Thank you

frozenlex commented 3 months ago

I hope this is because of you're using FlutterFlow debug mode Simulator. Try to check on real device it will work fine. Or run the code on Android Studio or VS Code.

I checked, it’s the same on a real device. Please help :)

frozenlex commented 3 months ago

Please note that there is no such problem on Android! iOS only