Phiên bản iOS SDK

FBSDKGameRequestDialog

@interfaceFBSDKGameRequestDialog:NSObject
A dialog for sending game requests.
  • Undocumented

    Declaration

    Objective-C
    -(instancetype)initNS_DESIGNATED_INITIALIZERNS_SWIFT_UNAVAILABLE("Use init(content:delegate:) instead");
  • Unavailable
    Undocumented

    Declaration

    Objective-C
    +(instancetype)newNS_UNAVAILABLE;
  • Convenience method to build up a game request with content and a delegate.

    Declaration

    Objective-C
    +(nonnullinstancetype)dialogWithContent:(nonnullFBSDKGameRequestContent*)contentdelegate:(nullableid<FBSDKGameRequestDialogDelegate>)delegate;

    Parameters

  • Convenience method to build up and show a game request with content and a delegate.

    Declaration

    Objective-C
    +(nonnullinstancetype)showWithContent:(nonnullFBSDKGameRequestContent*)contentdelegate:(nullableid<FBSDKGameRequestDialogDelegate>)delegate;

    Parameters

  • The receiver’s delegate or nil if it doesn’t have a delegate.

    Declaration

    Objective-C
    @property(nonatomic,weak,readwrite,nullable)id<FBSDKGameRequestDialogDelegate>delegate;
  • The content for game request.

    Declaration

    Objective-C
    @property(nonatomic,copy,readwrite)FBSDKGameRequestContent*_Nonnullcontent;
    Swift
    @NSCopyingvarcontent:GameRequestContent{getset}
  • Specifies whether frictionless requests are enabled.

    Declaration

    Objective-C
    @property(nonatomic,assign,unsafe_unretained,readwrite,getter=isFrictionlessRequestsEnabled)BOOLfrictionlessRequestsEnabled;
    Swift
    varisFrictionlessRequestsEnabled:Bool{getset}
  • A Boolean value that indicates whether the receiver can initiate a game request.
    May return NO if the appropriate Facebook app is not installed and is required or an access token is required but not available. This method does not validate the content on the receiver, so this can be checked before building up the content.
    See
    validateWithError:

    Declaration

    Objective-C
    @property(nonatomic,readonly)BOOLcanShow;
    Swift
    varcanShow:Bool{get}

    Return Value

    YES if the receiver can share, otherwise NO.
  • Begins the game request from the receiver.

    Declaration

    Objective-C
    -(BOOL)show;
    Swift
    funcshow()->Bool

    Return Value

    YES if the receiver was able to show the dialog, otherwise NO.
  • Validates the content on the receiver.

    Declaration

    Objective-C
    -(BOOL)validateWithError:(NSError*_Nullable*_Nullable)errorRef;
    Swift
    funcvalidate()throws

    Parameters

    Return Value

    YES if the content is valid, otherwise NO.