overwolf.social.twitter

Provides access to the Twitter social provider

Methods

performUserLogin()

Version added: 0.117.1

Opens the login dialog. There is no callback for this method and the only way to know if the user signed in is via onLoginStateChanged.

performLogout(callback)

Version added: 0.117.1

Performs a “strong” sign out of Twitter, so that even if the user performs a login via the Overwolf Settings / Accounts page, he will be considered signed out.

  • Parameter: callback <function>

getUserInfo(callback)

Version added: 0.117.1

If the user is currently logged into Twitter, this will return user information:

{ 
   avatar: \"http://abs.twimg.com/sticky/...\", 
   id: \"111111111112222222\",
   name: "full name",
   screenName: "screenname123"
}

Otherwise, an error is returned

  • Parameter: callback <function>

share(twitterShareParams, callback)

Version added: 0.117.1

If the user is currently logged into Twitter, this will perform the media share (image or video).

twitterShareParams is of type  TwitterShareParameters.

errors that can occur:

– Disconnected (user isn’t signed in)

  • MissingFile (trying to share a missing file)
  • UnsupportedFile (trying to share an unsupported format)
  • ExceedsMaxSize (the file is too large: > 15 MB for images, > 512 MBfor videos)”

Events How to use events

onLoginStateChanged

Version added: 0.117.1

Fired when the user’s login state changes.

Example callback object:

{ state = "connected" }
{ state = "disconnected" }

Types

overwolf.social.twitter.TwitterShareParameters

This object defines all parameters that can/should be passed to the Twitter share function

Options

file

<string>

The file to share.

message

<string>

The message to include with the shared file.

trimming

<VideoCompositionSegment[]>

An object containing start time and end time for the desired video segment.Optional parameter

tags

<string>

An array of chronological events that occurred during the capture.Optional parameter.

gameClassId

<int>

The associated game's class ID.Optional parameter

gameTitle

<string>

The associated game's title.Optional parameter.

metadata

<object>

Extra information about the game session.Optional parameter.