当前位置: 首页>>代码示例>>Java>>正文


Java FaceBookAccess.setClientId方法代码示例

本文整理汇总了Java中com.codename1.facebook.FaceBookAccess.setClientId方法的典型用法代码示例。如果您正苦于以下问题:Java FaceBookAccess.setClientId方法的具体用法?Java FaceBookAccess.setClientId怎么用?Java FaceBookAccess.setClientId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.codename1.facebook.FaceBookAccess的用法示例。


在下文中一共展示了FaceBookAccess.setClientId方法的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.setClientId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。