Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stuck on loading #26

Closed
cecq opened this issue Oct 25, 2019 · 22 comments
Closed

Stuck on loading #26

cecq opened this issue Oct 25, 2019 · 22 comments

Comments

@cecq
Copy link

cecq commented Oct 25, 2019

Hello, I tried to setup Crisp (v0.1.14) as documented, but the first time it loads the webview everything goes smooth while all the subsequent times it get stuck on loading:

Logcat reports just this warning:

I/chromium: [INFO:CONSOLE(1)] "Uncaught ReferenceError: initialize is not defined", source: (1)

Let me know if you need any additional logs or info to solve the issue.
Thanks

@hrossi
Copy link

hrossi commented Apr 23, 2020

Hi there.

I'm having the same problem.

@cecq did you find any workaround?

@gianpaolodn
Copy link

We decided to not integrate crispy in our android app and use just messenger.

@mathieudebrito
Copy link

@hrossi Did you find a workaround for this ? Thanks :)

@hrossi
Copy link

hrossi commented Apr 28, 2020

Hi @mathieudebrito

Sadly, I didn't find any solution :(

@mathieudebrito
Copy link

mathieudebrito commented Apr 28, 2020

Hi @hrossi, just found a fix that works for me (I hope it helps ;) ) :

My first thoughts were that the webview was just not well deleted. So I tried to ensure the deletion of the fragment (and its webview). I run into several issues including Duplicate ID, tag null, or parent id with another fragment for CrispFragment.

So I managed to create my own fragment that will contain the CrispFragment, and handle the CrispFragment instance's "Lifecycle" :

@EFragment(R.layout.my_useful_crisp_fragment)
public class MyUsefulCrispFragment extends Fragment {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        initCrispSDK();
    }

    public void initCrispSDK() {

        //initialize Crisp-SDK
    }

    @Override
    public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        FragmentManager fragmentManager = getActivity().getFragmentManager();

        CrispFragment fragment = (CrispFragment) fragmentManager.findFragmentByTag("crispFragment");

        if (fragment == null) {
            fragment = new CrispFragment();
            FragmentTransaction ft = fragmentManager.beginTransaction();
            ft.add(R.id.crispFragmentContainer, fragment, "crispFragment");
            ft.commit();
            fragmentManager.executePendingTransactions();
        } else {
            Logs.debug(this, "Creating new CrispFragment");
        }
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();

        if (getFragmentManager() != null) {
            FragmentManager fragmentManager = getActivity().getFragmentManager();
            CrispFragment fragment = (CrispFragment) fragmentManager.findFragmentByTag("crispFragment");
            if (fragment != null) {
                fragmentManager.beginTransaction().remove(fragment).commit();
            }
        }
    }
}

(layouts/my_useful_crisp_fragment)

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:id="@+id/crispFragmentContainer"
    android:orientation="horizontal">

</FrameLayout>

@walterholohan
Copy link

Hey @mathieudebrito do you think it would be possible to use this approach in my React Native library(https://github.com/walterholohan/react-native-crisp-chat-sdk) for this SDK. At the moment I just inflate the Fragment into a linear layout view (https://github.com/walterholohan/react-native-crisp-chat-sdk/blob/master/android/src/main/java/com/reactnativecrispchatsdk/CrispChatView.java) but if I render the screen for a second time I get the Duplicate ID, tag null, or parent id with another fragment for CrispFragment error. Android development wouldn't be my expertise so any help in fixing this would be very grateful. I am using this SDK in a React-Native project of mine.

@mbaochaEHA
Copy link

This bug have been on for a year. Why is the crisp team so uninterested in resolving this. we had to abandon crisp for this singular reason. Every other works perfectly for us. Its so annoying. They rarely respond to email or are they out of business? Great product. zero customer service

@mathieudebrito
Copy link

@walterholohan No idea :( The main thing to ensure is to delete everything and recreate everything between 2 display of the CrispFragment

@baptistejamin
Copy link
Member

We are working on a brand new version of the Crisp SDK. It's currently in development and should be released in the coming weeks.

I do agree this current release is obviously unperfect.

The next version will be fully native

@mathieudebrito
Copy link

mathieudebrito commented May 22, 2020

Thank you @baptistejamin ! Is there an ETA for the new version ? Could you also and in the meanwhile accept merge requests ?

@walterholohan
Copy link

Great stuff @baptistejamin. I look forward to the new version. Once it's released I will integrate it into the react-native wrapper.

@walterholohan
Copy link

@walterholohan No idea :( The main thing to ensure is to delete everything and recreate everything between 2 display of the CrispFragment

Thanks for the reply @mathieudebrito. I will give it a go and let you know how I get on.

@TayyabaAslam3317
Copy link

Did anyone find a solution for that fragment issue?

@kendallshain
Copy link

@baptistejamin Thanks! Do you have an ETA on the release? Re: your comment on May 22

@baptistejamin
Copy link
Member

baptistejamin commented Jul 2, 2020 via email

@anjar10
Copy link

anjar10 commented Aug 3, 2020

Hello @baptistejamin, is beta version already released?

@gardyna
Copy link

gardyna commented Nov 2, 2020

It's been well over a year since this has been opened. I'm also getting infinite loading. Is there ANY estimate on when the native version cause the current version is barely useable. or at least something to fix this infinite loading thing

@mathieudebrito
Copy link

I'm not 100% sure of what I will tell you, but I still hope it will help :
Since they are working on a new SDK, I guess they won't really look at this issue since it may become irrelevant.

@walterholohan
Copy link

@baptistejamin any update on when you are going to release the new version of the android SDK?

@eliottvincent
Copy link
Member

Hello there. We published the early beta of the Crisp Android native SDK. You can find it here: https://github.com/crisp-im/crisp-sdk-android/tree/beta

@walterholohan
Copy link

Hey @eliottvincent. Thank you. I am now using the new beta version in https://github.com/walterholohan/react-native-crisp-chat-sdk and it works great. When do you expect to release a stable version? And will the stable version include the API methods just like the iOS sdk does?

@eliottvincent
Copy link
Member

Awesome!
I don't have any ETA for the stable version. The goal is indeed to have the same possibilities between Android and iOS versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests