@Override public WebDialog build() { Bundle parameters = getParameters(); parameters.putString(ServerProtocol.DIALOG_PARAM_REDIRECT_URI, REDIRECT_URI); parameters.putString(ServerProtocol.DIALOG_PARAM_CLIENT_ID, getApplicationId()); parameters.putString(ServerProtocol.DIALOG_PARAM_E2E, e2e); parameters.putString(ServerProtocol.DIALOG_PARAM_RESPONSE_TYPE, ServerProtocol.DIALOG_RESPONSE_TYPE_TOKEN); parameters.putString(ServerProtocol.DIALOG_PARAM_RETURN_SCOPES, ServerProtocol.DIALOG_RETURN_SCOPES_TRUE); // Only set the rerequest auth type for non legacy requests if (isRerequest && !Settings.getPlatformCompatibilityEnabled()) { parameters.putString(ServerProtocol.DIALOG_PARAM_AUTH_TYPE, ServerProtocol.DIALOG_REREQUEST_AUTH_TYPE); } return new WebDialog(getContext(), OAUTH_DIALOG, parameters, getTheme(), getListener()); }
private void share_caip() { Session session = Session.getActiveSession(); if (session != null){ String sesija = session.toString(); Log.w ("ss", sesija);} final MySQLiteHelper db = new MySQLiteHelper(getActivity()); List<Avisos_Caip> avisos = db.getAllAvisos(); int listcounter=0; Avisos_Caip avi = avisos.get(listcounter); aviso = avi.getTitle(); Bundle bundle = new Bundle(); bundle.putString("caption", "Fique informado!"); bundle.putString("description", aviso); bundle.putString("name", "Aviso do Caip IPRJ"); bundle.putString("picture", "http://www.labcor.iprj.uerj.br/imagens/logo_uerj.jpg"); new WebDialog.FeedDialogBuilder(this.getActivity(), session, bundle).build().show(); }
private void share_lembrete() { Session session = Session.getActiveSession(); if (session != null){ String sesija = session.toString(); Log.w ("ss", sesija);} final MySQLiteHelper db = new MySQLiteHelper(getActivity()); List<Atividade> ativ = db.getAllAtividades(); int listcounter=0; Atividade atv = ativ.get(listcounter); lembretes = atv.getTitle(); Bundle bundle = new Bundle(); bundle.putString("caption", "Lembrete Importante!"); bundle.putString("description", lembretes); bundle.putString("name", "Minhas Atividades"); bundle.putString("picture", "http://www.labcor.iprj.uerj.br/imagens/logo_uerj.jpg"); new WebDialog.FeedDialogBuilder(this.getActivity(), session, bundle).build().show(); }
private void share_aviso_prof() { Session session = Session.getActiveSession(); if (session != null){ String sesija = session.toString(); Log.w ("ss", sesija);} final MySQLiteHelper db = new MySQLiteHelper(getActivity()); List<Atividade> ativ = db.getAllAtividades(); int listcounter=0; Atividade atv = ativ.get(listcounter); lembretes = atv.getTitle(); Bundle bundle = new Bundle(); bundle.putString("caption", "Fique Informado!"); bundle.putString("description", aviso_professor); bundle.putString("name", "Mural do Professor"); bundle.putString("picture", "http://www.labcor.iprj.uerj.br/imagens/logo_uerj.jpg"); new WebDialog.FeedDialogBuilder(this.getActivity(), session, bundle).build().show(); }
private void sendRequestDialog() { Bundle params = new Bundle(); params.putString("title", "Solicitação de Aplicativo"); params.putString("message", "Experimente o IPRJapp"); params.putString("link","https://play.google.com/store/apps/details?id=com.wb.goog.batman.brawler2013"); params.putString("data", "{\"badge_of_awesomeness\":\"1\"," + "\"social_karma\":\"5\"}"); WebDialog requestsDialog = ( new WebDialog.RequestsDialogBuilder(this.getActivity(), Session.getActiveSession(), params)) .setOnCompleteListener(new OnCompleteListener() { @Override public void onComplete(Bundle values, FacebookException error) { } }) .build(); requestsDialog.show(); }
public void publishFeedDialog(String name, String caption, String description, String linkUrl, String pictureUrl, OnCompleteListener onPostCompleteListener) { if(facebook.isSessionValid()) { Bundle params = new Bundle(); params.putString("name", name); params.putString("caption", caption); params.putString("description", description); params.putString("link", linkUrl); params.putString("picture", pictureUrl); WebDialog feedDialog = ( new WebDialog.FeedDialogBuilder(activity, facebook.getSession(), params)) .setOnCompleteListener(onPostCompleteListener) .build(); feedDialog.show(); } }
@Override public Dialog onCreateDialog(final Bundle savedInstanceState) { final FacebookShareDialogFragment parentFragment = (FacebookShareDialogFragment)getParentFragment(); final Payload payload = parentFragment.getPayload(); return new WebDialog.FeedDialogBuilder(getActivity(), Session.getActiveSession()) .setCaption(payload.getCaption()) .setDescription(payload.getDescription()) .setLink(payload.getLink()) .setName(payload.getName()) .setPicture(payload.getPicture()) .setOnCompleteListener(new WebDialog.OnCompleteListener() { @Override public void onComplete(final Bundle values, final FacebookException error) { parentFragment.onShareFinished(); } }) .build(); }
private void share( Intent intent ) { Entry entry = (Entry) intent.getSerializableExtra( EXTRAS_SHARED_ENTRY ); switch( intent.getIntExtra( EXTRAS_TYPE, TYPE_NORMAL ) ) { case TYPE_FACEBOOK: Bundle postParams = new Bundle(); final WebDialog fbDlg = new WebDialog.FeedDialogBuilder( NotificationShareService.this, getString( R.string.applicationId ), postParams ).setCaption( entry.getTitle() ) .setDescription( entry.getKwic() ).setLink( mSharedEntryUrl ).build(); fbDlg.setOnCompleteListener( new OnCompleteListener() { @Override public void onComplete( Bundle bundle, FacebookException e ) { fbDlg.dismiss(); ActivityCompat.finishAfterTransition( NotificationShareService.this ); } } ); fbDlg.show(); break; default: String subject = getString( R.string.lbl_share_entry_title, getString( R.string.application_name ), entry.getTitle() ); String text = getString( R.string.lbl_share_entry_content, entry.getKwic(), mSharedEntryUrl, Prefs.getInstance().getAppDownloadInfo() ); Intent i = com.chopping.utils.Utils.getShareInformation( subject, text ); i.addFlags( Intent.FLAG_ACTIVITY_NEW_TASK|Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT ); startActivity( i ); ActivityCompat.finishAfterTransition( NotificationShareService.this ); break; } }
@Override boolean tryAuthorize(final AuthorizationRequest request) { applicationId = request.getApplicationId(); Bundle parameters = new Bundle(); if (!Utility.isNullOrEmpty(request.getPermissions())) { String scope = TextUtils.join(",", request.getPermissions()); parameters.putString(ServerProtocol.DIALOG_PARAM_SCOPE, scope); addLoggingExtra(ServerProtocol.DIALOG_PARAM_SCOPE, scope); } String previousToken = request.getPreviousAccessToken(); if (!Utility.isNullOrEmpty(previousToken) && (previousToken.equals(loadCookieToken()))) { parameters.putString(ServerProtocol.DIALOG_PARAM_ACCESS_TOKEN, previousToken); // Don't log the actual access token, just its presence or absence. addLoggingExtra(ServerProtocol.DIALOG_PARAM_ACCESS_TOKEN, AppEventsConstants.EVENT_PARAM_VALUE_YES); } else { // The call to clear cookies will create the first instance of CookieSyncManager if necessary Utility.clearFacebookCookies(context); addLoggingExtra(ServerProtocol.DIALOG_PARAM_ACCESS_TOKEN, AppEventsConstants.EVENT_PARAM_VALUE_NO); } WebDialog.OnCompleteListener listener = new WebDialog.OnCompleteListener() { @Override public void onComplete(Bundle values, FacebookException error) { onWebDialogComplete(request, values, error); } }; e2e = getE2E(); addLoggingExtra(ServerProtocol.DIALOG_PARAM_E2E, e2e); WebDialog.Builder builder = new AuthDialogBuilder(getStartActivityDelegate().getActivityContext(), applicationId, parameters) .setE2E(e2e) .setOnCompleteListener(listener); loginDialog = builder.build(); loginDialog.show(); return true; }
@Override public WebDialog build() { Bundle parameters = getParameters(); parameters.putString(ServerProtocol.DIALOG_PARAM_REDIRECT_URI, REDIRECT_URI); parameters.putString(ServerProtocol.DIALOG_PARAM_CLIENT_ID, getApplicationId()); parameters.putString(ServerProtocol.DIALOG_PARAM_E2E, e2e); return new WebDialog(getContext(), OAUTH_DIALOG, parameters, getTheme(), getListener()); }
public static boolean presentWebFallback(final Context context, String dialogUrl, String applicationId, final FacebookDialog.PendingCall appCall, final FacebookDialog.Callback callback) { if (Utility.isNullOrEmpty(dialogUrl)) { return false; } String redirectUrl = String.format("fb%s://bridge/", applicationId); // Show the webdialog. FacebookWebFallbackDialog fallbackWebDialog = new FacebookWebFallbackDialog( context, dialogUrl, redirectUrl); fallbackWebDialog.setOnCompleteListener(new WebDialog.OnCompleteListener() { @Override public void onComplete(Bundle values, FacebookException error) { Intent dummyIntent = new Intent(); dummyIntent.putExtras(values == null ? new Bundle() : values); FacebookDialog.handleActivityResult( context, appCall, appCall.getRequestCode(), dummyIntent, callback); } }); fallbackWebDialog.show(); return true; }