本文整理汇总了Java中com.facebook.Session.OpenRequest类的典型用法代码示例。如果您正苦于以下问题:Java OpenRequest类的具体用法?Java OpenRequest怎么用?Java OpenRequest使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
OpenRequest类属于com.facebook.Session包,在下文中一共展示了OpenRequest类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: connect
import com.facebook.Session.OpenRequest; //导入依赖的package包/类
@Override
public void connect(Activity activity)
{
Session session = Session.getActiveSession();
// TODO: I think we should validate the session here, but to what
// extent?
MadFacebookStatusCallback statusCallback =
new MadFacebookStatusCallback();
// Check if the session is already open.
if (!session.isOpened() && !session.isClosed())
{
OpenRequest openRequest = new OpenRequest(activity);
session.openForRead(openRequest
.setCallback(statusCallback));
}
else
{
Session.openActiveSession(activity, true,
statusCallback);
}
}
开发者ID:netanelkl,项目名称:guitar_guy,代码行数:26,代码来源:FacebookProfileConnector.java
示例2: openSession
import com.facebook.Session.OpenRequest; //导入依赖的package包/类
private void openSession(String paramString, List<String> paramList, SessionLoginBehavior paramSessionLoginBehavior, int paramInt, SessionAuthorizationType paramSessionAuthorizationType)
{
if (this.sessionTracker != null)
{
Session localSession1 = this.sessionTracker.getSession();
Object localObject = localSession1;
if ((localSession1 == null) || (((Session)localObject).getState().isClosed()))
{
Session localSession2 = new Session.Builder(getActivity()).setApplicationId(paramString).build();
Session.setActiveSession(localSession2);
localObject = localSession2;
}
if (!((Session)localObject).isOpened())
{
Session.OpenRequest localOpenRequest = new Session.OpenRequest(this).setPermissions(paramList).setLoginBehavior(paramSessionLoginBehavior).setRequestCode(paramInt);
if (SessionAuthorizationType.PUBLISH.equals(paramSessionAuthorizationType))
{
((Session)localObject).openForPublish(localOpenRequest);
return;
}
((Session)localObject).openForRead(localOpenRequest);
}
}
}
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:25,代码来源:FacebookFragment.java
示例3: getUserSession
import com.facebook.Session.OpenRequest; //导入依赖的package包/类
/**
* Get an opened Facebook user session. The method checks whether the uid
* param is an ID of a user or page and always returns the session of user.
*
* @param uid
* ID of a user or page who shares the post
* @return user's session
*/
private Session getUserSession(String uid) {
Session session;
if (!StaticUtilities.isFBPage(uid))
session = StaticUtilities.getFBSessionForUser(uid);
else
session = StaticUtilities.getFBSessionForUser(StaticUtilities
.getPageOwnerID(uid));
if (session == null || !session.isOpened())
session.openForPublish(new OpenRequest(act));
if (!session.isOpened())
throw new IllegalStateException("Couldn't open Facebook session");
return session;
}
开发者ID:LupineDevelopment,项目名称:Social-Share-Utils,代码行数:24,代码来源:Facebook.java
示例4: getOpenRequest
import com.facebook.Session.OpenRequest; //导入依赖的package包/类
private static OpenRequest getOpenRequest(StatusCallback callback, List<String> permissions) {
OpenRequest req = new OpenRequest(getActivity());
req.setCallback(callback);
req.setPermissions(permissions);
req.setDefaultAudience(SessionDefaultAudience.FRIENDS);
return req;
}
开发者ID:mirhoseini,项目名称:aquaplay,代码行数:9,代码来源:FB.java
示例5: authorize
import com.facebook.Session.OpenRequest; //导入依赖的package包/类
private void authorize(Activity paramActivity, String[] paramArrayOfString, int paramInt, SessionLoginBehavior paramSessionLoginBehavior, final DialogListener paramDialogListener)
{
checkUserSession("authorize");
this.pendingOpeningSession = new Session.Builder(paramActivity).setApplicationId(this.mAppId).setTokenCachingStrategy(getTokenCache()).build();
this.pendingAuthorizationActivity = paramActivity;
String[] arrayOfString;
if (paramArrayOfString != null)
arrayOfString = paramArrayOfString;
else
arrayOfString = new String[0];
this.pendingAuthorizationPermissions = arrayOfString;
Session.StatusCallback local1 = new Session.StatusCallback()
{
public void call(Session paramAnonymousSession, SessionState paramAnonymousSessionState, Exception paramAnonymousException)
{
Facebook.this.onSessionCallback(paramAnonymousSession, paramAnonymousSessionState, paramAnonymousException, paramDialogListener);
}
};
Session.OpenRequest localOpenRequest = new Session.OpenRequest(paramActivity).setCallback(local1).setLoginBehavior(paramSessionLoginBehavior).setRequestCode(paramInt).setPermissions(Arrays.asList(this.pendingAuthorizationPermissions));
Session localSession = this.pendingOpeningSession;
boolean bool;
if (this.pendingAuthorizationPermissions.length > 0)
bool = true;
else
bool = false;
openSession(localSession, localOpenRequest, bool);
}
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:28,代码来源:Facebook.java
示例6: openSession
import com.facebook.Session.OpenRequest; //导入依赖的package包/类
private void openSession(Session paramSession, Session.OpenRequest paramOpenRequest, boolean paramBoolean)
{
paramOpenRequest.setIsLegacy(true);
if (paramBoolean)
{
paramSession.openForPublish(paramOpenRequest);
return;
}
paramSession.openForRead(paramOpenRequest);
}
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:11,代码来源:Facebook.java
示例7: getOpenRequest
import com.facebook.Session.OpenRequest; //导入依赖的package包/类
private static OpenRequest getOpenRequest(StatusCallback callback, List<String> permissions, Activity activity) {
OpenRequest req = new OpenRequest(activity);
req.setCallback(callback);
req.setPermissions(permissions);
req.setDefaultAudience(SessionDefaultAudience.FRIENDS);
return req;
}
开发者ID:stevesolomon,项目名称:DualRunner,代码行数:9,代码来源:FBLogin.java
示例8: openActiveSession
import com.facebook.Session.OpenRequest; //导入依赖的package包/类
private Session openActiveSession(Activity activity, boolean allowLoginUI, StatusCallback callback,
List<String> permissions) {
OpenRequest openRequest = new OpenRequest(activity).setPermissions(permissions).setCallback(callback);
Session session = new Session.Builder(activity).build();
if (SessionState.CREATED_TOKEN_LOADED.equals(session.getState()) || allowLoginUI) {
Session.setActiveSession(session);
session.openForPublish(openRequest);
return session;
}
return null;
}
开发者ID:mastersoftwaresolutions,项目名称:android_socialmedia,代码行数:12,代码来源:MainActivity.java
示例9: getSession
import com.facebook.Session.OpenRequest; //导入依赖的package包/类
@Deprecated
public final Session getSession()
{
while (true)
{
String str;
Session localSession2;
synchronized (this.lock)
{
if (this.userSetSession != null)
{
Session localSession7 = this.userSetSession;
return localSession7;
}
if ((this.session != null) || (!this.sessionInvalidated))
{
Session localSession1 = this.session;
return localSession1;
}
str = this.accessToken;
localSession2 = this.session;
}
if (str == null)
return null;
List localList;
if (localSession2 != null)
localList = localSession2.getPermissions();
else if (this.pendingAuthorizationPermissions != null)
localList = Arrays.asList(this.pendingAuthorizationPermissions);
else
localList = Collections.emptyList();
Session localSession3 = new Session.Builder(this.pendingAuthorizationActivity).setApplicationId(this.mAppId).setTokenCachingStrategy(getTokenCache()).build();
if (localSession3.getState() != SessionState.CREATED_TOKEN_LOADED)
return null;
Session.OpenRequest localOpenRequest = new Session.OpenRequest(this.pendingAuthorizationActivity).setPermissions(localList);
boolean bool;
if (!localList.isEmpty())
bool = true;
else
bool = false;
openSession(localSession3, localOpenRequest, bool);
Session localSession4;
Session localSession5;
synchronized (this.lock)
{
if (!this.sessionInvalidated)
{
Session localSession6 = this.session;
localSession4 = null;
localSession5 = null;
if (localSession6 != null);
}
else
{
localSession4 = this.session;
this.session = localSession3;
localSession5 = localSession3;
this.sessionInvalidated = false;
}
}
if (localSession4 != null)
localSession4.close();
if (localSession5 != null)
return localSession5;
}
}
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:67,代码来源:Facebook.java
注:本文中的com.facebook.Session.OpenRequest类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论