ringcentral / engage-digital-messaging-ios

Engage Digital Messaging IOS SDK
Other
10 stars 6 forks source link

Chatbot LCL - IOS - Disparition du champ de saisie de la fenêtre de Chat #20

Closed LCL-BPI closed 6 years ago

LCL-BPI commented 6 years ago

Après l'ouverture de la fenêtre de Chat, si je bascule sur une autre appli comme, par exemple, mon agenda pour vérifier mes dispos, si cela prend un peu de temps (environ 1 min) alors lorsque je reviens sur l'application LCL mes comptes, je n'ai plus le champ de saisie pour discuter avec le Chatbot.

Après plusieurs essais, j'ai vu qu'en appuyant longuement sur une bulle existante, le champ de saisie réapparaît, cela ne me semble pas du tout intuitif.

Est-ce quelque chose qui est paramétrable pour que, par exemple, lorsque l’on ‘’clique’’ n’importe où dans l’écran, le champ de saisie réapparaisse ?

Je suis sur un Iphone 6 IOS11.

Merci pour votre aide.

waelba commented 6 years ago

Bonjour @LCL-BPI ,

Vous avez ce problème avec quelle version de l'SDK ?

LCL-BPI commented 6 years ago

Bonjour,

Nous utilisons la version 1.7.7 du SDK pour IOS.

leonovvalentin commented 6 years ago

If I right understand from the google translate, I have the similar problem.

On the iPhone 6s, iOS 10.3. SDK version is 1.7.7. If I try to send some image or geoposition (it is not necessary to send, just close the appeared dilog for image or geoposition), text field is hidden.

Is it the same problem?

waelba commented 6 years ago

Hi @LCL-BPI, @leonovvalentin , It's fixed in v1.7.8 Thanks

leonovvalentin commented 6 years ago

Thanks for new version!

Unfortunately it is not fully fixed in my case. More detailed description:

First application start (when photos and location is not accessed yet):

1 case: Click “clip” icon -> click dimeloChoosePhotoButton -> alert “Application Would Like to Access Your Photos” is shown -> click ”OK” -> click dimeloCancelButton => all is OK

2 case: Click “clip” icon -> click dimeloLocationButton -> alert “Allow Application to access your location while you use the app” is shown -> click “Allow” -> click dimeloCancelButton => text field is disappeared.

Second application start (when photos and location is already accessed):

1 case: Click “clip” icon -> click dimeloChoosePhotoButton -> click dimeloCancelButton => text field is disappeared.

2 case: Click “clip” icon -> click dimeloLocationButton -> click dimeloCancelButton => text field is disappeared.

waelba commented 6 years ago

Hi @leonovvalentin , You integrated the DimeloChat as UIViewController or as a subView ?

leonovvalentin commented 6 years ago

I use UIViewController returned from -chatViewController method of class Dimelo. It is used as child view controller in my view controller.

waelba commented 6 years ago

@leonovvalentin, I did a test on iPhone 6S iOS 11.3 and I can not reproduce your bug, everything is working properly. Can you give me a snippet of the code you're running ?

leonovvalentin commented 6 years ago

It is approximate code snippet. Hope that nothing important was missed.

import UIKit
import Dimelo
import SnapKit

class ContactChatViewController: UIViewController {
    fileprivate var chatService: ChatService?
    fileprivate var chatViewController: UIViewController?

    override func viewDidLoad() {
        super.viewDidLoad()

        chatService = ChatService()

        chatService?.fetchToken(showChat: { [unowned self] in
                self.presentChat()
            })
    }

    private func presentChat() {
        let chat = Dimelo.sharedInstance().makeChatViewController()

        fixChatViewController(chat)

        self.addChildViewController(chat)
        self.view.addSubview(chat.view)

        chat.view.snp.makeConstraints { make in
                make.leading.trailing.equalToSuperview()
                make.top.equalTo(self.topLayoutGuide.snp.bottom)
                make.bottom.equalTo(self.bottomLayoutGuide.snp.top)
            }

        chat.didMove(toParentViewController: self)

        chatViewController = chat
    }

    private func fixChatViewController(_ viewController: UIViewController) {
        if let navigationController = viewController as? UINavigationController {
            navigationController.isNavigationBarHidden = true
        }
    }
}
waelba commented 6 years ago

Hi @leonovvalentin, I tested your code snippet and everything is working properly. Can you test it again ?

//
//  ViewController.swift
//  Test
//
//  Created by Wael on 05/04/2018.
//  Copyright © 2018 test. All rights reserved.
//

import UIKit
import Dimelo
import SnapKit

class ViewController: UIViewController {

    fileprivate var chatViewController: UIViewController?

    override func viewDidLoad() {
        super.viewDidLoad()
        Dimelo.sharedInstance()?.setApiSecret("your api secret")
        self.presentChat()
    }

    private func fixChatViewController(_ viewController: UIViewController) {
        if let navigationController = viewController as? UINavigationController {
            navigationController.isNavigationBarHidden = true
        }
    }

    private func presentChat() {
        let chat = Dimelo.sharedInstance().chatViewController()!

        fixChatViewController(chat)

        self.addChildViewController(chat)
        self.view.addSubview(chat.view)

        chat.view.snp.makeConstraints { make in
            make.leading.trailing.equalToSuperview()
            make.top.equalTo(self.topLayoutGuide.snp.bottom)
            make.bottom.equalTo(self.bottomLayoutGuide.snp.top)
        }

        chat.didMove(toParentViewController: self)

        chatViewController = chat
    }

    private func addContentController(_ child: UIViewController, to stackView: UIView) {
        addChildViewController(child)
        stackView.addSubview(child.view)
        child.didMove(toParentViewController: self)
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
}
waelba commented 6 years ago

Hi @leonovvalentin, Have you fixed your problem ?

leonovvalentin commented 6 years ago

Hello! Unfortunately no, there are more priority tasks, I'm gonna deal with it later, sorry.

kei-sidorov commented 6 years ago

Hello! Same issue, reproduces only on iOS 10.x. Video may helpful: https://drive.google.com/file/d/1ryUzd6wwcep7WrVPppRbWhUUyk2NPA-k/view?usp=sharing On 11.x everything is fine.

waelba commented 6 years ago

Hello @kei-sidorov, You have this problem with which version of SDK?

kei-sidorov commented 6 years ago

@waelbenabdallah we use latest v1.7.9.
upd: I updated Pod to latest commit and now bottom input bar is permanently hidden after Photo Choose appearance (without animation marked by arrow on my video). Tested on 6s iOS 10.3.1

waelba commented 6 years ago

@kei-sidorov Can you give me a snippet of the code you're running ?

I can not reproduce the problem even with an iPhone 6S iOS 10.3.1

kei-sidorov commented 6 years ago

@waelbenabdallah It's totally same as in leonovvalentin example.

waelba commented 6 years ago

Hello @kei-sidorov,

Can you test this example and tell me if you can reproduce the problem (same as in leonovvalentin example).

DimeloExample.zip

kei-sidorov commented 6 years ago

@waelbenabdallah I tested this example and problem doesn't reproduce. I found that version of framework is the same, so probably problem is on our side.