private static void show( final FragmentWrapper fragmentWrapper, final AppInviteContent appInviteContent) { new AppInviteDialog(fragmentWrapper) .show(appInviteContent); }
@Override public boolean onActivityResult(int resultCode, Intent data) { return ShareInternalUtility.handleActivityResult( getRequestCode(), resultCode, data, resultProcessor); } };
public void presentAppInviteDialog() { AppInviteContent content = new AppInviteContent.Builder() .setApplinkUrl("https://d3uu10x6fsg06w.cloudfront.net/hosting-rps/applink.html") .setPreviewImageUrl("https://d3uu10x6fsg06w.cloudfront.net/hosting-rps/rps-preview-image.jpg") .build(); if (AppInviteDialog.canShow()) { appInviteDialog.show(this, content); } else { showError(R.string.appinvite_error); } }
appInviteDialog = new AppInviteDialog(this); appInviteDialog.registerCallback(callbackManager, appInviteCallback);
/** * @deprecated * AppInvites is deprecated */ @Deprecated public static void show( final android.app.Fragment fragment, final AppInviteContent appInviteContent) { show(new FragmentWrapper(fragment), appInviteContent); }
@Override public AppCall createAppCall(final AppInviteContent content) { final AppCall appCall = createBaseAppCall(); DialogPresenter.setupAppCallForWebFallbackDialog( appCall, createParameters(content), getFeature()); return appCall; } }
/** * @deprecated * AppInvites is deprecated */ @Deprecated public static void show( final Fragment fragment, final AppInviteContent appInviteContent) { show(new FragmentWrapper(fragment), appInviteContent); }
@Override public AppCall createAppCall(final AppInviteContent content) { final AppCall appCall = createBaseAppCall(); DialogPresenter.setupAppCallForNativeDialog( appCall, new DialogPresenter.ParameterProvider() { @Override public Bundle getParameters() { return createParameters(content); } @Override public Bundle getLegacyParameters() { // App Invites are not supported with legacy fb4a devices. // We should never get here Log.e(TAG, "Attempting to present the AppInviteDialog with " + "an outdated Facebook app on the device"); return new Bundle(); } }, getFeature()); return appCall; } }
/** * @deprecated * AppInvites is deprecated */ @Deprecated public static void show( final Activity activity, final AppInviteContent appInviteContent) { new AppInviteDialog(activity) .show(appInviteContent); }
@Override protected AppCall createBaseAppCall() { return new AppCall(getRequestCode()); }
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) { String gesture = ShareInternalUtility.getNativeDialogCompletionGesture(results); if ("cancel".equalsIgnoreCase(gesture)) { callback.onCancel(); } else { 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); }