Search in sources :

Example 1 with CallbackManagerImpl

use of com.facebook.internal.CallbackManagerImpl in project facebook-android-sdk by facebook.

the class CreateAppGroupDialog method registerCallbackImpl.

@Override
protected void registerCallbackImpl(final CallbackManagerImpl callbackManager, final FacebookCallback<Result> callback) {
    final ResultProcessor resultProcessor = (callback == null) ? null : new ResultProcessor(callback) {

        @Override
        public void onSuccess(AppCall appCall, Bundle results) {
            callback.onSuccess(new Result(results.getString("id")));
        }
    };
    CallbackManagerImpl.Callback callbackManagerCallback = new CallbackManagerImpl.Callback() {

        @Override
        public boolean onActivityResult(int resultCode, Intent data) {
            return ShareInternalUtility.handleActivityResult(getRequestCode(), resultCode, data, resultProcessor);
        }
    };
    callbackManager.registerCallback(getRequestCode(), callbackManagerCallback);
}
Also used : AppCall(com.facebook.internal.AppCall) FacebookCallback(com.facebook.FacebookCallback) Bundle(android.os.Bundle) CallbackManagerImpl(com.facebook.internal.CallbackManagerImpl) Intent(android.content.Intent) ResultProcessor(com.facebook.share.internal.ResultProcessor)

Example 2 with CallbackManagerImpl

use of com.facebook.internal.CallbackManagerImpl in project facebook-android-sdk by facebook.

the class GameRequestDialog method registerCallbackImpl.

@Override
protected void registerCallbackImpl(final CallbackManagerImpl callbackManager, final FacebookCallback<Result> callback) {
    final ResultProcessor resultProcessor = (callback == null) ? null : new ResultProcessor(callback) {

        @Override
        public void onSuccess(AppCall appCall, Bundle results) {
            if (results != null) {
                callback.onSuccess(new Result(results));
            } else {
                onCancel(appCall);
            }
        }
    };
    callbackManager.registerCallback(getRequestCode(), new CallbackManagerImpl.Callback() {

        @Override
        public boolean onActivityResult(int resultCode, Intent data) {
            return ShareInternalUtility.handleActivityResult(getRequestCode(), resultCode, data, resultProcessor);
        }
    });
}
Also used : AppCall(com.facebook.internal.AppCall) Bundle(android.os.Bundle) CallbackManagerImpl(com.facebook.internal.CallbackManagerImpl) Intent(android.content.Intent) ResultProcessor(com.facebook.share.internal.ResultProcessor)

Example 3 with CallbackManagerImpl

use of com.facebook.internal.CallbackManagerImpl in project facebook-android-sdk by facebook.

the class JoinAppGroupDialog method registerCallbackImpl.

@Override
protected void registerCallbackImpl(final CallbackManagerImpl callbackManager, final FacebookCallback<Result> callback) {
    final ResultProcessor resultProcessor = (callback == null) ? null : new ResultProcessor(callback) {

        @Override
        public void onSuccess(AppCall appCall, Bundle results) {
            callback.onSuccess(new Result(results));
        }
    };
    CallbackManagerImpl.Callback callbackManagerCallback = new CallbackManagerImpl.Callback() {

        @Override
        public boolean onActivityResult(int resultCode, Intent data) {
            return ShareInternalUtility.handleActivityResult(getRequestCode(), resultCode, data, resultProcessor);
        }
    };
    callbackManager.registerCallback(getRequestCode(), callbackManagerCallback);
}
Also used : AppCall(com.facebook.internal.AppCall) FacebookCallback(com.facebook.FacebookCallback) Bundle(android.os.Bundle) CallbackManagerImpl(com.facebook.internal.CallbackManagerImpl) Intent(android.content.Intent) ResultProcessor(com.facebook.share.internal.ResultProcessor)

Aggregations

Intent (android.content.Intent)3 Bundle (android.os.Bundle)3 AppCall (com.facebook.internal.AppCall)3 CallbackManagerImpl (com.facebook.internal.CallbackManagerImpl)3 ResultProcessor (com.facebook.share.internal.ResultProcessor)3 FacebookCallback (com.facebook.FacebookCallback)2