當前位置: 首頁>>代碼示例>>Java>>正文


Java FaceBookAccess.setRedirectURI方法代碼示例

本文整理匯總了Java中com.codename1.facebook.FaceBookAccess.setRedirectURI方法的典型用法代碼示例。如果您正苦於以下問題:Java FaceBookAccess.setRedirectURI方法的具體用法?Java FaceBookAccess.setRedirectURI怎麽用?Java FaceBookAccess.setRedirectURI使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.codename1.facebook.FaceBookAccess的用法示例。


在下文中一共展示了FaceBookAccess.setRedirectURI方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: actionPerformed

import com.codename1.facebook.FaceBookAccess; //導入方法依賴的package包/類
/**
 * {@inheritDoc}
 */
public void actionPerformed(ActionEvent evt) {
    if(!FaceBookAccess.getInstance().isAuthenticated()) {
        FaceBookAccess.setClientId(appId);
        FaceBookAccess.setRedirectURI(redirectURI);
        FaceBookAccess.setClientSecret(clientSecret);
        if(permissions != null) {
            FaceBookAccess.setPermissions(permissions);            
        }
        FaceBookAccess.getInstance().showAuthentication(this);
        return;
    }
    if(evt.getSource() instanceof Exception) {
        return;
    }
    try {
        FaceBookAccess.getInstance().postLike(getPostId());
    } catch (IOException ex) {
        Log.e(ex);
    }
}
 
開發者ID:codenameone,項目名稱:CodenameOne,代碼行數:24,代碼來源:LikeButton.java

示例2: actionPerformed

import com.codename1.facebook.FaceBookAccess; //導入方法依賴的package包/類
/**
 * @inheritDoc
 */
public void actionPerformed(ActionEvent evt) {
    if(!FaceBookAccess.getInstance().isAuthenticated()) {
        FaceBookAccess.setClientId(appId);
        FaceBookAccess.setRedirectURI(redirectURI);
        FaceBookAccess.setClientSecret(clientSecret);
        if(permissions != null) {
            FaceBookAccess.setPermissions(permissions);            
        }
        FaceBookAccess.getInstance().showAuthentication(this);
        return;
    }
    if(evt.getSource() instanceof Exception) {
        return;
    }
    try {
        FaceBookAccess.getInstance().postLike(getPostId());
    } catch (IOException ex) {
        ex.printStackTrace();
    }
}
 
開發者ID:shannah,項目名稱:cn1,代碼行數:24,代碼來源:LikeButton.java

示例3: signIn

import com.codename1.facebook.FaceBookAccess; //導入方法依賴的package包/類
private static void signIn(final Form main) {
    FaceBookAccess.setClientId("132970916828080");
    FaceBookAccess.setClientSecret("6aaf4c8ea791f08ea15735eb647becfe");
    FaceBookAccess.setRedirectURI("http://www.codenameone.com/");
    FaceBookAccess.setPermissions(new String[]{"user_location", "user_photos", "friends_photos", "publish_stream", "read_stream", "user_relationships", "user_birthday",
                "friends_birthday", "friends_relationships", "read_mailbox", "user_events", "friends_events", "user_about_me"});
    
    FaceBookAccess.getInstance().showAuthentication(new ActionListener() {
        
        public void actionPerformed(ActionEvent evt) {
            if (evt.getSource() instanceof String) {
                String token = (String) evt.getSource();
                String expires = Oauth2.getExpires();
                TOKEN = token;
                System.out.println("recived a token " + token + " which expires on " + expires);
                //store token for future queries.
                Storage.getInstance().writeObject("token", token);
                if (main != null) {
                    main.showBack();
                }
            } else {
                Exception err = (Exception) evt.getSource();
                err.printStackTrace();
                Dialog.show("Error", "An error occurred while logging in: " + err, "OK", null);
            }
        }
    });
}
 
開發者ID:codenameone,項目名稱:codenameone-demos,代碼行數:29,代碼來源:Login.java

示例4: createOauth2

import com.codename1.facebook.FaceBookAccess; //導入方法依賴的package包/類
@Override
protected Oauth2 createOauth2() {
    FaceBookAccess.setClientId(clientId);
    FaceBookAccess.setClientSecret(clientSecret);
    FaceBookAccess.setRedirectURI(redirectURI);
    FaceBookAccess.setPermissions(permissions);
    return FaceBookAccess.getInstance().createOAuth();        
}
 
開發者ID:codenameone,項目名稱:CodenameOne,代碼行數:9,代碼來源:FacebookConnect.java


注:本文中的com.codename1.facebook.FaceBookAccess.setRedirectURI方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。