本文整理匯總了Java中com.codename1.facebook.FaceBookAccess.setClientSecret方法的典型用法代碼示例。如果您正苦於以下問題:Java FaceBookAccess.setClientSecret方法的具體用法?Java FaceBookAccess.setClientSecret怎麽用?Java FaceBookAccess.setClientSecret使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.codename1.facebook.FaceBookAccess
的用法示例。
在下文中一共展示了FaceBookAccess.setClientSecret方法的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();
}