Reputation: 491
I'm unable to add permission for birthday, please help me out... thanks in advance.
sample source code is :
Session.openActiveSession(this, true, new Session.StatusCallback() {
// callback when session changes state
@SuppressWarnings("deprecation")
@Override
public void call(Session session, SessionState state,
Exception exception) {
if (session.isOpened()) {
// make request to the /me API
Request.executeMeRequestAsync(session,
new Request.GraphUserCallback() {
// callback after Graph API response with user
// object
@Override
public void onCompleted(GraphUser user,
Response response) {
if (user != null) {
}
}
});
}
}
});
Upvotes: 0
Views: 771
Reputation: 1444
private static final List PERMISSIONS = Arrays.asList(""user_birthday""); //declaration
onClickPostStatusUpdate();// on button click call this function
private void onClickPostStatusUpdate() {
performPublish(PendingAction.POST_STATUS_UPDATE);
}
private void performPublish(PendingAction action) {
Session session = Session.getActiveSession();
if (session != null) {
pendingAction = action;
if (hasPublishPermission()) {
// We can do the action right away.
handlePendingAction();
} else {
// We need to get new permissions, then complete the action when we get called back.
session.requestNewPublishPermissions(new Session.NewPermissionsRequest(this, PERMISSIONS));
}
}
}
Upvotes: 1
Reputation: 2006
Try this,
.setPermissions(Arrays.asList("user_birthday","email"))
Upvotes: 2
Reputation: 2621
user.getBirthday();
I remeber using that and storing it as a string.
Upvotes: 0