本文整理汇总了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);
}
}
示例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();
}
}
示例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);
}
}
});
}
示例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();
}