@Override protected AppCall createBaseAppCall() { return new AppCall(getRequestCode()); }
@Override public Bundle getParameters() { return NativeDialogParameters.create( appCall.getCallId(), content, shouldFailOnDataError); }
private static AppCall getAppCallFromActivityResult(int requestCode, int resultCode, Intent data) { UUID callId = NativeProtocol.getCallIdFromIntent(data); if (callId == null) { return null; } return AppCall.finishPendingCall(callId, requestCode); }
public static synchronized AppCall finishPendingCall( UUID callId, int requestCode) { AppCall pendingCall = getCurrentPendingCall(); if (pendingCall == null || !pendingCall.getCallId().equals(callId) || pendingCall.getRequestCode() != requestCode) { return null; } setCurrentPendingCall(null); return pendingCall; }
public static void present(AppCall appCall, Activity activity) { activity.startActivityForResult(appCall.getRequestIntent(), appCall.getRequestCode()); appCall.setPending(); }
public static void setupAppCallForErrorResult(AppCall appCall, FacebookException exception) { if (exception == null) { return; } Validate.hasFacebookActivity(FacebookSdk.getApplicationContext()); Intent errorResultIntent = new Intent(); errorResultIntent.setClass(FacebookSdk.getApplicationContext(), FacebookActivity.class); errorResultIntent.setAction(FacebookActivity.PASS_THROUGH_CANCEL_ACTION); NativeProtocol.setupProtocolRequestIntent( errorResultIntent, appCall.getCallId().toString(), null, NativeProtocol.getLatestKnownVersion(), NativeProtocol.createBundleForException(exception)); appCall.setRequestIntent(errorResultIntent); }
private static synchronized boolean setCurrentPendingCall( AppCall appCall) { AppCall oldAppCall = getCurrentPendingCall(); currentPendingCall = appCall; return oldAppCall != null; }
/** * * @return Returns true if there was another AppCall that was * already pending and is now canceled */ public boolean setPending() { return setCurrentPendingCall(this); } }
public static void setupAppCallForWebDialog( AppCall appCall, String actionName, Bundle parameters) { Validate.hasFacebookActivity(FacebookSdk.getApplicationContext()); Validate.hasInternetPermissions(FacebookSdk.getApplicationContext()); Bundle intentParameters = new Bundle(); intentParameters.putString(NativeProtocol.WEB_DIALOG_ACTION, actionName); intentParameters.putBundle(NativeProtocol.WEB_DIALOG_PARAMS, parameters); Intent webDialogIntent = new Intent(); NativeProtocol.setupProtocolRequestIntent( webDialogIntent, appCall.getCallId().toString(), actionName, NativeProtocol.getLatestKnownVersion(), intentParameters); webDialogIntent.setClass(FacebookSdk.getApplicationContext(), FacebookActivity.class); webDialogIntent.setAction(FacebookDialogFragment.TAG); appCall.setRequestIntent(webDialogIntent); }
public static void present(AppCall appCall, FragmentWrapper fragmentWrapper) { fragmentWrapper.startActivityForResult( appCall.getRequestIntent(), appCall.getRequestCode()); appCall.setPending(); }
@Override public Bundle getLegacyParameters() { return LegacyNativeDialogParameters.create( appCall.getCallId(), content, shouldFailOnDataError); } },
appCall.getCallId().toString(), protocolVersion, parameters); NativeProtocol.setupProtocolRequestIntent( webDialogIntent, appCall.getCallId().toString(), feature.getAction(), NativeProtocol.getLatestKnownVersion(), webDialogIntent.setAction(FacebookDialogFragment.TAG); appCall.setRequestIntent(webDialogIntent);
@Override protected AppCall createBaseAppCall() { return new AppCall(getRequestCode()); }
@Override public Bundle getParameters() { return NativeDialogParameters.create( appCall.getCallId(), content, shouldFailOnDataError); }
appCall.getCallId().toString(), action, protocolVersionResult, appCall.setRequestIntent(intent);
@Override protected AppCall createBaseAppCall() { return new AppCall(getRequestCode()); }
@Override public Bundle getLegacyParameters() { return LegacyNativeDialogParameters.create( appCall.getCallId(), content, shouldFailOnDataError); } },
@Override protected AppCall createBaseAppCall() { return new AppCall(getRequestCode()); }
@Override public Bundle getParameters() { return NativeDialogParameters.create( appCall.getCallId(), content, shouldFailOnDataError); }
@Override protected AppCall createBaseAppCall() { return new AppCall(getRequestCode()); }