crisp-im / crisp-sdk-android

:package: Crisp Android SDK, add a chat in any Android app and communicate with your users.
https://docs.crisp.chat/guides/chatbox-sdks/android-sdk/
Other
55 stars 17 forks source link

Inifite loop #13

Closed mpopolin closed 6 years ago

mpopolin commented 6 years ago

Every second and later time I try to open the activity containing the CrispFragment, there is an infinite loop - the first load works perfectly, showing all messages and so on. Tried with the example and the problem occurred as well.

baptistejamin commented 6 years ago

Are you sure to have the latest release ?

On 2 Jan 2018, at 23:20, Marcel Cunha notifications@github.com wrote:

Every second and later time I try to open the activity containing the CrispFragment, there is an infinite loop - the first load works perfectly, showing all messages and so on. Tried with the example and the problem occurred as well.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

mpopolin commented 6 years ago

Using compile 'im.crisp:crisp-sdk:0.1.0'

baptistejamin commented 6 years ago

Do you have any output in your logs?

mpopolin commented 6 years ago

Not really. Do you have some tag to filter the logs? Filtering by crisp there is the following log for the first time only - nothing appears after the first:

01-03 08:51:24.318 18024 18024 I art : at android.view.View im.crisp.sdk.ui.CrispFragment.onCreateView(android.view.LayoutInflater, android.view.ViewGroup, android.os.Bundle) (SourceFile:59) 01-03 08:51:24.318 18024 18024 I art : at android.view.View im.crisp.sdk.ui.CrispFragment.onCreateView(android.view.LayoutInflater, android.view.ViewGroup, android.os.Bundle) (SourceFile:59)

baptistejamin commented 6 years ago

Did you initiate properly the SDK? Can I can a copy of your initialisation script?

What is your android version?

Baptiste Jamin CEO, Crisp https://crisp.im/ - Connect your customers to your team.

On 3 Jan 2018, at 11:52, Marcel Cunha notifications@github.com wrote:

Not really. Do you have some tag to filter the logs? Filtering by crisp there is the following log for the first time only - nothing appears after the first:

01-03 08:51:24.318 18024 18024 I art : at android.view.View im.crisp.sdk.ui.CrispFragment.onCreateView(android.view.LayoutInflater, android.view.ViewGroup, android.os.Bundle) (SourceFile:59) 01-03 08:51:24.318 18024 18024 I art : at android.view.View im.crisp.sdk.ui.CrispFragment.onCreateView(android.view.LayoutInflater, android.view.ViewGroup, android.os.Bundle) (SourceFile:59)

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/crisp-im/crisp-sdk-android/issues/13#issuecomment-354984339, or mute the thread https://github.com/notifications/unsubscribe-auth/AA04w4uL_lhgOr7bEgFJzTQMrM8t-DSdks5tG1vjgaJpZM4RRJTS.

mpopolin commented 6 years ago

Yes, I think I did (the very first time I open the activity, everything works fine, the chat is loaded and so on - the problem just happens in the second and so on attempt).

public class BaseApplication extends Application {

    @Override
    public void onCreate() {
        super.onCreate();
        Crisp.initialize(this);
        Crisp.getInstance().setWebsiteId(BuildConfig.CRISP_KEY);
    }

And the Activity .xml layout:

<?xml version="1.0" encoding="utf-8"?>

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
                xmlns:app="http://schemas.android.com/apk/res-auto"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                app:layout_behavior="@string/appbar_scrolling_view_behavior">

    <fragment
        android:name="im.crisp.sdk.ui.CrispFragment"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_margin="0dp"
        android:tag="crisp_fragment"/>
</RelativeLayout>
baptistejamin commented 6 years ago

What is the android version?

Baptiste Jamin CEO, Crisp https://crisp.im/ - Connect your customers to your team.

On 3 Jan 2018, at 12:15, Marcel Cunha notifications@github.com wrote:

Yes, I think I did (the very first time I open the activity, everything works fine, the chat is loaded and so on - the problem just happens in the second and so on attempt).

public class BaseApplication extends Application {

@Override
public void onCreate() {
    super.onCreate();
    Crisp.initialize(this);
    Crisp.getInstance().setWebsiteId(BuildConfig.CRISP_KEY);
}

And the Activity .xml layout:

<?xml version="1.0" encoding="utf-8"?>

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" app:layout_behavior="@string/appbar_scrolling_view_behavior">

<fragment
    android:name="im.crisp.sdk.ui.CrispFragment"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_margin="0dp"
    android:tag="crisp_fragment"/>

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/crisp-im/crisp-sdk-android/issues/13#issuecomment-354988502, or mute the thread https://github.com/notifications/unsubscribe-auth/AA04w_12uArlZEJ7OeTvmPRsNOgUyhceks5tG2FEgaJpZM4RRJTS.

mpopolin commented 6 years ago

Android 7.1.1

mpopolin commented 6 years ago

@mywaystar not sure why yet (maybe flushing the queue wrongly for the second time?), but removing the static modifier from the isLoaded (and related methods) on CrispFragment solved the problem.

baptistejamin commented 6 years ago

Could you chat with us on crisp.chat , I have very specific questions

mpopolin commented 6 years ago

Hi, started the chat but no responses.

baptistejamin commented 6 years ago

It has been fixed. Thank you for your help!