本文将为您提供关于php–FacebookFQL查询让所有用户在线的详细介绍,我们还将为您解释如何查询facebook域名的相关知识,同时,我们还将为您提供关于#import"facebookSDK/
本文将为您提供关于php – Facebook FQL查询让所有用户在线的详细介绍,我们还将为您解释如何查询facebook域名的相关知识,同时,我们还将为您提供关于#import
- php – Facebook FQL查询让所有用户在线(如何查询facebook域名)
- #import
"facebookSDK/FacebookSDK.h file not found" - android – Facebook SDK 3.0 – 获取Facebook用户名和访问令牌
- android – 在设备/模拟器上安装Facebook应用程序时,发布到用户Facebook墙不能正常工作
- com.facebook.FacebookGraphObjectException的实例源码
php – Facebook FQL查询让所有用户在线(如何查询facebook域名)
如何获得所有用户的在线状态?
我目前使用的方法是分别查询每个用户:
$facebook->api(array ( 'access_token' => 'x','method' => 'fql.query','query' => "SELECT uid,name,first_name,last_name,online_presence FROM user WHERE uid = x" ));
但这是150个用户的时间.我甚至不谈400或1000.
附: multiquery对我不起作用,因为要求用户存在需要提供access_token.
解决方法
SELECT name,uid,online_presence FROM user WHERE uid=me()
#import "facebookSDK/FacebookSDK.h file not found"
第一种可能: 从window下上传到mac 下 facebook sdk出错!【这个是系统的错误,只能从其他地方拷贝 FacebookSDK.framework 文件夹 就ok】,下图是正常状态,【不正常的状态下,这几个文件直接是物理文件了】
第二种可能 ,设置读取路径错误
在mac下 project下找到build setting ,再找 searchPath,点击Framework search paths 设置路径即可
"$(SRCROOT)/xxx/xxx/FacebookSDK.framework"
android – Facebook SDK 3.0 – 获取Facebook用户名和访问令牌
我正在跟随facebook本地登录 – http://developers.facebook.com/docs/tutorials/androidsdk/3.0/scrumptious/authenticate/
我使用Session.getAccesstoken获取访问令牌,我得到一些访问令牌,但是这是无效的.实际程序是什么?我做错了吗
如何使用Facebook SDK 3.0在Native登录中获取UserId
解决方法
final Session session = Session.getActiveSession(); if (session != null && session.isOpened()) { // If the session is open,make an API call to get user data // and define a new callback to handle the response Request request = Request.newMeRequest(session,new Request.GraphUserCallback() { @Override public void onCompleted(GraphUser user,Response response) { // If the response is successful if (session == Session.getActiveSession()) { if (user != null) { user_ID = user.getId();//user id profileName = user.getName();//user's profile name userNameView.setText(user.getName()); } } } }); Request.executeBatchAsync(request); }
user_ID& profileName是字符串.
对于accesstoken:
String token = session.getAccesstoken();
EDITED:(13/1/2014)
对于用户电子邮件(我没有通过在设备或模拟器上运行来检查此代码):
这些只是我的意见,或者你可以称之为建议
setReadPermissions(Arrays.asList("email",...other permission...)); //by analyzing the links bellow,i think you can set the permission in loginbutton as: loginButton.setReadPermissions(Arrays.asList("email",...other permission...)); user.asMap().get("email");
更多信息请看:
link1,link2,link3,link4,
android – 在设备/模拟器上安装Facebook应用程序时,发布到用户Facebook墙不能正常工作
如果模拟器/手机没有安装Facebook应用程序,它没有问题.
如果模拟器/手机安装了Facebook应用程序,Facebook应用程序加载登录屏幕,但在尝试登录后,Facebook应用程序刚刚消失,将我带回我的应用程序.
安装Facebook应用程序时有没有人有这种体验?
我的代码:
public class AchievementActivity extends Activity implements DialogListener,OnClickListener{ private Facebook facebook; Button facebookPostButton; String defaultFacebookPost; @Override public void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); requestwindowFeature(Window.FEATURE_CUSTOM_TITLE); setContentView(R.layout.achievements); getwindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE,R.layout.custom_title_layout); View achievementDivider = (View)findViewById(R.id.achievementDivider); int[] colors = {0,0xff00ffff,0}; achievementDivider.setBackgroundDrawable(new GradientDrawable(Orientation.RIGHT_LEFT,colors)); //get the title of the achievement from the intent that started this activity from the activity StatisticsActivity String achievementTitleString = getIntent().getStringExtra("title"); String achievementTextTodisplay = getAchievementTextTodisplay(achievementTitleString); defaultFacebookPost = getDefaultPost(achievementTitleString); //ImageView achievementActivityAchievementBadgeImageView = (ImageView)findViewById(R.id.achievementActivityAchievementBadgeImageView); TextView achievementActivityBadgeTitleTextView = (TextView)findViewById(R.id.achievementActivityBadgeTitleTextView); achievementActivityBadgeTitleTextView.setText(achievementTitleString); TextView achievementActivityAchievementText = (TextView)findViewById(R.id.achievementActivityAchievementText); achievementActivityAchievementText.setText(achievementTextTodisplay); facebookPostButton = (Button)findViewById(R.id.facebookPostButton); facebookPostButton.setonClickListener(this); } @Override public void onComplete(Bundle values) { if (values.isEmpty()) { Toast.makeText(getApplicationContext(),"Empty",Toast.LENGTH_SHORT); return; } if (!values.containsKey("post_id")) { try { Bundle parameters = new Bundle(); parameters.putString("message",defaultFacebookPost);// the message to post to the wall facebook.dialog(AchievementActivity.this,"stream.publish",parameters,this);// "stream.publish" is an API call } catch (Exception e) { // Todo: handle exception System.out.println(e.getMessage()); } } try { facebook.logout(getApplicationContext()); } catch (MalformedURLException e) { // Todo Auto-generated catch block e.printstacktrace(); } catch (IOException e) { // Todo Auto-generated catch block e.printstacktrace(); } } @Override public void onFacebookError(FacebookError error) { Toast.makeText(AchievementActivity.this,"onFacebookError",Toast.LENGTH_LONG); } @Override public void onError(DialogError e) { Toast.makeText(AchievementActivity.this,"onError",Toast.LENGTH_LONG); } @Override public void onCancel() { Toast.makeText(AchievementActivity.this,"onCancel",Toast.LENGTH_LONG); } @Override public void onClick(View v) { if (v == facebookPostButton) { facebook = new Facebook("my_facebook_api"); // replace APP_API_ID with your own facebook.authorize(this,new String[] {"publish_stream","read_stream","offline_access"},this); } } private String getDefaultPost(String defaultTitleString) { //do some stuff here to get a string to post to wall return defaultPost; } private String getAchievementTextTodisplay(String achievementTitleString) { String achievementTextTodisplay = "DEFAULT"; //do some stuff here to get text to display in the activity //this has nothing to do with the facebook post... return achievementTextTodisplay; } }
Logcat告诉我这个:
05-11 13:03:34.076: INFO/ActivityManager(98): Starting activity: Intent { cmp=com.facebook.katana/.ProxyAuth (has extras) } 05-11 13:03:34.246: INFO/ActivityManager(98): displayed activity com.facebook.katana/.ProxyAuth: 158 ms (total 158 ms) 05-11 13:03:35.166: DEBUG/dalvikvm(12390): GC_FOR_MALLOC freed 6729 objects / 418424 bytes in 44ms 05-11 13:03:35.166: DEBUG/webviewglue(12390): nativeDestroy view: 0x527e20 05-11 13:03:35.166: DEBUG/NativeCrypto(12390): Freeing OpenSSL session
编辑
:在过去一年中必须在多台机器上安装Android开发平台并且在创建新的开发环境后总是遇到Facebook的问题,我发现这个简单的答案可能是Facebook实现在一个设备上工作的原因不是另一个……
秘密的Facebook API密钥(您在developer.facebook.com上列出的密钥)对于您使用不同证书打包的每个版本的应用程序都会有所不同.例如,假设您有两台开发机器.由于这两台计算机都将使用不同的证书构建您的应用程序,因此您必须确保为每台计算机生成一个Facebook API密钥,并将它们列在developer.facebook.com上.
解决方法
com.facebook.FacebookGraphObjectException的实例源码
@Override public final <U extends GraphObject> GraphObjectList<U> castTolistof(Class<U> graphObjectClass) { if (GraphObject.class.isAssignableFrom(itemType)) { if (graphObjectClass.isAssignableFrom(itemType)) { @SuppressWarnings("unchecked") GraphObjectList<U> result = (GraphObjectList<U>)this; return result; } return createList(state,graphObjectClass); } else { throw new FacebookGraphObjectException("Can't cast GraphObjectCollection of non-GraphObject type " + itemType); } }
@Override public final <U extends GraphObject> GraphObjectList<U> castTolistof(Class<U> graphObjectClass) { if (GraphObject.class.isAssignableFrom(itemType)) { if (graphObjectClass.isAssignableFrom(itemType)) { @SuppressWarnings("unchecked") GraphObjectList<U> result = (GraphObjectList<U>)this; return result; } return createList(state,graphObjectClass); } else { throw new FacebookGraphObjectException("Can't cast GraphObjectCollection of non-GraphObject type " + itemType); } }
@Override public final <U extends GraphObject> GraphObjectList<U> castTolistof(Class<U> graphObjectClass) { if (GraphObject.class.isAssignableFrom(itemType)) { if (graphObjectClass.isAssignableFrom(itemType)) { @SuppressWarnings("unchecked") GraphObjectList<U> result = (GraphObjectList<U>)this; return result; } return createList(state,graphObjectClass); } else { throw new FacebookGraphObjectException("Can't cast GraphObjectCollection of non-GraphObject type " + itemType); } }
void updateObjectAttachmentUrls(String objectProperty,List<String> attachmentUrls,boolean isUserGenerated) { final OpenGraphObject object; try { object = action.getPropertyAs(objectProperty,OpenGraphObject.class); if (object == null) { throw new IllegalArgumentException("Action does not contain a property '" + objectProperty + "'"); } } catch (FacebookGraphObjectException exception) { throw new IllegalArgumentException("Property '" + objectProperty + "' is not a graph object"); } if (!object.getCreateObject()) { throw new IllegalArgumentException( "The Open Graph object in '" + objectProperty + "' is not marked for creation"); } GraphObjectList<GraphObject> attachments = object.getimage(); if (attachments == null) { attachments = GraphObject.Factory.createList(GraphObject.class); } for (String url : attachmentUrls) { GraphObject graphObject = GraphObject.Factory.create(); graphObject.setProperty(NativeProtocol.IMAGE_URL_KEY,url); if (isUserGenerated) { graphObject.setProperty(NativeProtocol.IMAGE_USER_GENERATED_KEY,true); } attachments.add(graphObject); } object.setimage(attachments); }
@Override public final <U extends GraphObject> GraphObjectList<U> castTolistof(Class<U> graphObjectClass) { if (GraphObject.class.isAssignableFrom(itemType)) { if (graphObjectClass.isAssignableFrom(itemType)) { @SuppressWarnings("unchecked") GraphObjectList<U> result = (GraphObjectList<U>)this; return result; } return createList(state,graphObjectClass); } else { throw new FacebookGraphObjectException("Can't cast GraphObjectCollection of non-GraphObject type " + itemType); } }
@Override public final <U extends GraphObject> GraphObjectList<U> castTolistof(Class<U> graphObjectClass) { if (GraphObject.class.isAssignableFrom(itemType)) { if (graphObjectClass.isAssignableFrom(itemType)) { @SuppressWarnings("unchecked") GraphObjectList<U> result = (GraphObjectList<U>)this; return result; } return createList(state,graphObjectClass); } else { throw new FacebookGraphObjectException("Can't cast GraphObjectCollection of non-GraphObject type " + itemType); } }
@Override public final <U extends GraphObject> GraphObjectList<U> castTolistof(Class<U> graphObjectClass) { if (GraphObject.class.isAssignableFrom(itemType)) { if (graphObjectClass.isAssignableFrom(itemType)) { @SuppressWarnings("unchecked") GraphObjectList<U> result = (GraphObjectList<U>)this; return result; } return createList(state,graphObjectClass); } else { throw new FacebookGraphObjectException("Can't cast GraphObjectCollection of non-GraphObject type " + itemType); } }
@Override public final <U extends GraphObject> GraphObjectList<U> castTolistof(Class<U> graphObjectClass) { if (GraphObject.class.isAssignableFrom(itemType)) { if (graphObjectClass.isAssignableFrom(itemType)) { @SuppressWarnings("unchecked") GraphObjectList<U> result = (GraphObjectList<U>)this; return result; } return createList(state,graphObjectClass); } else { throw new FacebookGraphObjectException("Can't cast GraphObjectCollection of non-GraphObject type " + itemType); } }
@Override public final <U extends GraphObject> GraphObjectList<U> castTolistof(Class<U> graphObjectClass) { if (GraphObject.class.isAssignableFrom(itemType)) { if (graphObjectClass.isAssignableFrom(itemType)) { @SuppressWarnings("unchecked") GraphObjectList<U> result = (GraphObjectList<U>)this; return result; } return createList(state,graphObjectClass); } else { throw new FacebookGraphObjectException("Can't cast GraphObjectCollection of non-GraphObject type " + itemType); } }
@Override public final <U extends GraphObject> GraphObjectList<U> castTolistof(Class<U> graphObjectClass) { if (GraphObject.class.isAssignableFrom(itemType)) { if (graphObjectClass.isAssignableFrom(itemType)) { @SuppressWarnings("unchecked") GraphObjectList<U> result = (GraphObjectList<U>)this; return result; } return createList(state,graphObjectClass); } else { throw new FacebookGraphObjectException("Can't cast GraphObjectCollection of non-GraphObject type " + itemType); } }
@SmallTest @MediumTest @LargeTest public void testCantWrapBadPropertyNameOverrides() { try { GraphObject.Factory.create(BadPropertyOverrideInterfaceGraphObject.class); fail("Expected exception"); } catch (FacebookGraphObjectException exception) { } }
public final <U extends GraphObject> GraphObjectList<U> castTolistof(Class<U> paramClass) { if (GraphObject.class.isAssignableFrom(this.itemType)) { if (paramClass.isAssignableFrom(this.itemType)) return this; return GraphObject.Factory.createList(this.state,paramClass); } throw new FacebookGraphObjectException("Can't cast GraphObjectCollection of non-GraphObject type " + this.itemType); }
@SmallTest @MediumTest @LargeTest public void testCantWrapBadGetterName() { try { GraphObject.Factory.create(BadGetterNameGraphObject.class); fail("Expected exception"); } catch (FacebookGraphObjectException exception) { } }
@Override public final <U extends GraphObject> GraphObjectList<U> castTolistof(Class<U> graphObjectClass) { if (GraphObject.class.isAssignableFrom(itemType)) { if (graphObjectClass.isAssignableFrom(itemType)) { @SuppressWarnings("unchecked") GraphObjectList<U> result = (GraphObjectList<U>)this; return result; } return createList(state,graphObjectClass); } else { throw new FacebookGraphObjectException("Can't cast GraphObjectCollection of non-GraphObject type " + itemType); } }
@Override public final <U extends GraphObject> GraphObjectList<U> castTolistof(Class<U> graphObjectClass) { if (GraphObject.class.isAssignableFrom(itemType)) { if (graphObjectClass.isAssignableFrom(itemType)) { @SuppressWarnings("unchecked") GraphObjectList<U> result = (GraphObjectList<U>)this; return result; } return createList(state,graphObjectClass); } else { throw new FacebookGraphObjectException("Can't cast GraphObjectCollection of non-GraphObject type " + itemType); } }
@Override public final <U extends GraphObject> GraphObjectList<U> castTolistof(Class<U> graphObjectClass) { if (GraphObject.class.isAssignableFrom(itemType)) { if (graphObjectClass.isAssignableFrom(itemType)) { @SuppressWarnings("unchecked") GraphObjectList<U> result = (GraphObjectList<U>)this; return result; } return createList(state,graphObjectClass); } else { throw new FacebookGraphObjectException("Can't cast GraphObjectCollection of non-GraphObject type " + itemType); } }
@Override public final <U extends GraphObject> GraphObjectList<U> castTolistof(Class<U> graphObjectClass) { if (GraphObject.class.isAssignableFrom(itemType)) { if (graphObjectClass.isAssignableFrom(itemType)) { @SuppressWarnings("unchecked") GraphObjectList<U> result = (GraphObjectList<U>)this; return result; } return createList(state,graphObjectClass); } else { throw new FacebookGraphObjectException("Can't cast GraphObjectCollection of non-GraphObject type " + itemType); } }
@SmallTest @MediumTest @LargeTest public void testCantWrapBadZeroParameterMethodName() { try { GraphObject.Factory.create(BadnoparameterMethodNameGraphObject.class); fail("Expected exception"); } catch (FacebookGraphObjectException exception) { } }
@Override public final <U extends GraphObject> GraphObjectList<U> castTolistof(Class<U> graphObjectClass) { if (GraphObject.class.isAssignableFrom(itemType)) { if (graphObjectClass.isAssignableFrom(itemType)) { @SuppressWarnings("unchecked") GraphObjectList<U> result = (GraphObjectList<U>)this; return result; } return createList(state,graphObjectClass); } else { throw new FacebookGraphObjectException("Can't cast GraphObjectCollection of non-GraphObject type " + itemType); } }
@Override public final <U extends GraphObject> GraphObjectList<U> castTolistof(Class<U> graphObjectClass) { if (GraphObject.class.isAssignableFrom(itemType)) { if (graphObjectClass.isAssignableFrom(itemType)) { @SuppressWarnings("unchecked") GraphObjectList<U> result = (GraphObjectList<U>)this; return result; } return createList(state,graphObjectClass); } else { throw new FacebookGraphObjectException("Can't cast GraphObjectCollection of non-GraphObject type " + itemType); } }
@Override public final <U extends GraphObject> GraphObjectList<U> castTolistof(Class<U> graphObjectClass) { if (GraphObject.class.isAssignableFrom(itemType)) { if (graphObjectClass.isAssignableFrom(itemType)) { @SuppressWarnings("unchecked") GraphObjectList<U> result = (GraphObjectList<U>)this; return result; } return createList(state,graphObjectClass); } else { throw new FacebookGraphObjectException("Can't cast GraphObjectCollection of non-GraphObject type " + itemType); } }
@SmallTest @MediumTest @LargeTest public void testCantWrapBadSetterName() { try { GraphObject.Factory.create(BadSetterNameGraphObject.class); fail("Expected exception"); } catch (FacebookGraphObjectException exception) { } }
@Override public final <U extends GraphObject> GraphObjectList<U> castTolistof(Class<U> graphObjectClass) { if (GraphObject.class.isAssignableFrom(itemType)) { if (graphObjectClass.isAssignableFrom(itemType)) { @SuppressWarnings("unchecked") GraphObjectList<U> result = (GraphObjectList<U>)this; return result; } return createList(state,graphObjectClass); } else { throw new FacebookGraphObjectException("Can't cast GraphObjectCollection of non-GraphObject type " + itemType); } }
@Override public final <U extends GraphObject> GraphObjectList<U> castTolistof(Class<U> graphObjectClass) { if (GraphObject.class.isAssignableFrom(itemType)) { if (graphObjectClass.isAssignableFrom(itemType)) { @SuppressWarnings("unchecked") GraphObjectList<U> result = (GraphObjectList<U>)this; return result; } return createList(state,graphObjectClass); } else { throw new FacebookGraphObjectException("Can't cast GraphObjectCollection of non-GraphObject type " + itemType); } }
@Override public final <U extends GraphObject> GraphObjectList<U> castTolistof(Class<U> graphObjectClass) { if (GraphObject.class.isAssignableFrom(itemType)) { if (graphObjectClass.isAssignableFrom(itemType)) { @SuppressWarnings("unchecked") GraphObjectList<U> result = (GraphObjectList<U>)this; return result; } return createList(state,graphObjectClass); } else { throw new FacebookGraphObjectException("Can't cast GraphObjectCollection of non-GraphObject type " + itemType); } }
@SmallTest @MediumTest @LargeTest public void testCantWrapBadGetterParams() { try { GraphObject.Factory.create(BadGetterParamsGraphObject.class); fail("Expected exception"); } catch (FacebookGraphObjectException exception) { } }
@Override public final <U extends GraphObject> GraphObjectList<U> castTolistof(Class<U> graphObjectClass) { if (GraphObject.class.isAssignableFrom(itemType)) { if (graphObjectClass.isAssignableFrom(itemType)) { @SuppressWarnings("unchecked") GraphObjectList<U> result = (GraphObjectList<U>)this; return result; } return createList(state,graphObjectClass); } else { throw new FacebookGraphObjectException("Can't cast GraphObjectCollection of non-GraphObject type " + itemType); } }
@Override public final <U extends GraphObject> GraphObjectList<U> castTolistof(Class<U> graphObjectClass) { if (GraphObject.class.isAssignableFrom(itemType)) { if (graphObjectClass.isAssignableFrom(itemType)) { @SuppressWarnings("unchecked") GraphObjectList<U> result = (GraphObjectList<U>)this; return result; } return createList(state,graphObjectClass); } else { throw new FacebookGraphObjectException("Can't cast GraphObjectCollection of non-GraphObject type " + itemType); } }
@SmallTest @MediumTest @LargeTest public void testCantWrapBadBaseInterface() { try { GraphObject.Factory.create(BadBaseInterfaceGraphObject.class); fail("Expected exception"); } catch (FacebookGraphObjectException exception) { } }
@Override public final <U extends GraphObject> GraphObjectList<U> castTolistof(Class<U> graphObjectClass) { if (GraphObject.class.isAssignableFrom(itemType)) { if (graphObjectClass.isAssignableFrom(itemType)) { @SuppressWarnings("unchecked") GraphObjectList<U> result = (GraphObjectList<U>)this; return result; } return createList(state,graphObjectClass); } else { throw new FacebookGraphObjectException("Can't cast GraphObjectCollection of non-GraphObject type " + itemType); } }
@Override public final <U extends GraphObject> GraphObjectList<U> castTolistof(Class<U> graphObjectClass) { if (GraphObject.class.isAssignableFrom(itemType)) { if (graphObjectClass.isAssignableFrom(itemType)) { @SuppressWarnings("unchecked") GraphObjectList<U> result = (GraphObjectList<U>)this; return result; } return createList(state,graphObjectClass); } else { throw new FacebookGraphObjectException("Can't cast GraphObjectCollection of non-GraphObject type " + itemType); } }
@Override public final <U extends GraphObject> GraphObjectList<U> castTolistof(Class<U> graphObjectClass) { if (GraphObject.class.isAssignableFrom(itemType)) { if (graphObjectClass.isAssignableFrom(itemType)) { @SuppressWarnings("unchecked") GraphObjectList<U> result = (GraphObjectList<U>)this; return result; } return createList(state,graphObjectClass); } else { throw new FacebookGraphObjectException("Can't cast GraphObjectCollection of non-GraphObject type " + itemType); } }
@SmallTest @MediumTest @LargeTest public void testCantWrapBadSingleParameterMethodName() { try { GraphObject.Factory.create(BadSingleParameterMethodNameGraphObject.class); fail("Expected exception"); } catch (FacebookGraphObjectException exception) { } }
@Override public final <U extends GraphObject> GraphObjectList<U> castTolistof(Class<U> graphObjectClass) { if (GraphObject.class.isAssignableFrom(itemType)) { if (graphObjectClass.isAssignableFrom(itemType)) { @SuppressWarnings("unchecked") GraphObjectList<U> result = (GraphObjectList<U>)this; return result; } return createList(state,graphObjectClass); } else { throw new FacebookGraphObjectException("Can't cast GraphObjectCollection of non-GraphObject type " + itemType); } }
@Override public final <U extends GraphObject> GraphObjectList<U> castTolistof(Class<U> graphObjectClass) { if (GraphObject.class.isAssignableFrom(itemType)) { if (graphObjectClass.isAssignableFrom(itemType)) { @SuppressWarnings("unchecked") GraphObjectList<U> result = (GraphObjectList<U>)this; return result; } return createList(state,graphObjectClass); } else { throw new FacebookGraphObjectException("Can't cast GraphObjectCollection of non-GraphObject type " + itemType); } }
@Override public final <U extends GraphObject> GraphObjectList<U> castTolistof(Class<U> graphObjectClass) { if (GraphObject.class.isAssignableFrom(itemType)) { if (graphObjectClass.isAssignableFrom(itemType)) { @SuppressWarnings("unchecked") GraphObjectList<U> result = (GraphObjectList<U>)this; return result; } return createList(state,graphObjectClass); } else { throw new FacebookGraphObjectException("Can't cast GraphObjectCollection of non-GraphObject type " + itemType); } }
@Override public final <U extends GraphObject> GraphObjectList<U> castTolistof(Class<U> graphObjectClass) { if (GraphObject.class.isAssignableFrom(itemType)) { if (graphObjectClass.isAssignableFrom(itemType)) { @SuppressWarnings("unchecked") GraphObjectList<U> result = (GraphObjectList<U>)this; return result; } return createList(state,graphObjectClass); } else { throw new FacebookGraphObjectException("Can't cast GraphObjectCollection of non-GraphObject type " + itemType); } }
@SmallTest @MediumTest @LargeTest public void testCantWrapNonInterface() { try { GraphObject.Factory.create(GraphObjectClass.class); fail("Expected exception"); } catch (FacebookGraphObjectException exception) { } }
@SmallTest @MediumTest @LargeTest public void testCantWrapBadZeroParameterMethodName() { try { GraphObject.Factory.create(BadnoparameterMethodNameGraphObject.class); fail("Expected exception"); } catch (FacebookGraphObjectException exception) { } }
今天的关于php – Facebook FQL查询让所有用户在线和如何查询facebook域名的分享已经结束,谢谢您的关注,如果想了解更多关于#import
本文标签: