- Home /
using enum value in cs?
How do you use an enum value in cs? Here's a function in one of the prime31 social networking plugins that asks for an enumerated value.
Here's the documentation from prime31 // Reauthorizes with the requested publish permissions and audience public static void reauthorizeWithPublishPermissions( string[] permissions, FacebookSessionDefaultAudience defaultAudience )
Here's the documentation from facebook
Typedefs FBSessionDefaultAudience enum
Passed to open to indicate which default audience to use for sessions that post data to Facebook.
typedef enum {
FBSessionDefaultAudienceNone = 0,
FBSessionDefaultAudienceOnlyMe = 10,
FBSessionDefaultAudienceFriends = 20,
FBSessionDefaultAudienceEveryone = 30,
} FBSessionDefaultAudience;
Here's my attempt
var permissions = new string[] {"publish_actions" }; FacebookBinding.reauthorizeWithPublishPermissions(permissions,FBSessionDefaultAudienceFriends);
How do I enter the FBSessionDefaultAudience value. I've tried the following and none of them work and give an error of not found in current context.
1. FBSessionDefaultAudienceFriends
2. FBSessionDefaultAudience.FBSessionDefaultAudienceFriends
3. 20
I get `FBSessionDefaultAudience' does not exist in the current context when trying that. The same error.
Answer by Johnnemann · Apr 26, 2013 at 12:27 AM
The function signature you posted:
static void reauthorizeWithPublishPermissions( string[] permissions, FacebookSessionDefaultAudience defaultAudience )
seems to indicate the type is called "FacebookSessionDefaultAudience". Did you try FacebookSessionDefaultAudience.Friends?
hmm I tried it and it got rid of the error. Where did you find that?
I just looked at the code you posted. The function says it takes the type FacebookSessionDefaultAudience, so I believed it. :-)
Your answer
Follow this Question
Related Questions
iOS SocialNetworking (Facebook) not works proper when native facebook app not loged in 0 Answers
Posting an image with a link using Prime31 Social Networking plugin 1 Answer
how to post message on friend wall in facebook? for ios 1 Answer
facebook video upload using prime31 0 Answers
Passing string to facebook api for wall post, ignores newline 0 Answers