chat-sdk-android icon indicating copy to clipboard operation
chat-sdk-android copied to clipboard

Doesn't work on few devices

Open shishram opened this issue 9 years ago • 4 comments

I have Nexus and Xiaomi device but this code works on Nexus but not on other device.

I tried logging but no help!! Please resolve or suggest something.

Thanks,

shishram avatar Aug 18 '17 11:08 shishram

Can you provide me with the error messages / stack trace that you are receiving? It would also be helpful for you to provide me with the steps to reproduce the issue.

bensmiley avatar Aug 22 '17 13:08 bensmiley

Step1. running app on Nexus6 device. Step2. logging-in/Register with email password Step-3 app has been redirected to MainActivity

so in the above process no error at all.

Step1. running app on Xiaomi Redmi3s device. Step2. logging-in/Register with email password Step3. app is stuck on Connection Progress dialog.

I tried debugging the code where its failing so i have found this below code which is not executing and going to onFail without any error. BUserWrapper.java->Promise

public Promise<BUser, BError, Void> once(){

    final Deferred<DataSnapshot, BError, Void> deferred = new DeferredObject<>();

    final Deferred<BUser, BError, Void> promise = new DeferredObject<>();

    DatabaseReference ref = ref();

    if (DEBUG) Timber.v("once, EntityID: %s, Ref Path: %s", entityId, ref.toString());
    
    ref.addListenerForSingleValueEvent(new ValueEventListener() {
        @Override
        public void onDataChange(DataSnapshot snapshot) {
            if (DEBUG) Timber.v("once, onDataChange");
            deferred.resolve(snapshot);
        }

        @Override
        public void onCancelled(DatabaseError firebaseError) {
            if (DEBUG) Timber.v("once, onCancelled");
            deferred.reject(BFirebaseNetworkAdapter.getFirebaseError(firebaseError));
        }
    });

    deferred.done(new DoneCallback<DataSnapshot>() {
        @Override
        public void onDone(DataSnapshot snapshot) {
            deserialize((Map<String, Object>) snapshot.getValue());
            
            promise.resolve(model);
        }
    }).fail(new FailCallback<BError>() {
        @Override
        public void onFail(BError bError) {
            promise.reject(bError);
        }
    });
    
    return promise;
}

in above code it doesn't execute ref.addListenerForSingleValueEvent and deferred.done(new DoneCallback() { goes to .fail(new FailCallback() without any error in @Override public void onFail(BError bError) { promise.reject(bError); } on onFail Override method jDeffered.

I could debug this much only, didnt find any root cause of it. kindly please check and let me know. Thanks.

shishram avatar Aug 25 '17 10:08 shishram

bensmiley i have my issues can you help me

jay2342 avatar Sep 15 '17 10:09 jay2342

This needs to be re-tested with v4.0 and reopened if necessary.

bensmiley avatar Oct 19 '17 16:10 bensmiley