Skip to content

Instantly share code, notes, and snippets.

@dmitriy-chernysh
Created August 12, 2022 12:21
Show Gist options
  • Save dmitriy-chernysh/90575f79071a839e1cf97de1492424f1 to your computer and use it in GitHub Desktop.
Save dmitriy-chernysh/90575f79071a839e1cf97de1492424f1 to your computer and use it in GitHub Desktop.
val accessToken : AccessToken =
AccessToken(
// String token you saved from Pages list
token,
// replace it by your applicationId
"com.app.packagename",
// ID you saved from Pages list
pageId,
// The same permissions list we used for Login flow at point 4
listOf("public_profile", "pages_manage_posts"),
null,
null,
AccessToken.getCurrentAccessToken()?.source,
AccessToken.getCurrentAccessToken()?.expires,
AccessToken.getCurrentAccessToken()?.lastRefresh,
null
)
}
}
AccessToken.setCurrentAccessToken(accessToken)
val shareBuilder = ShareVideo.Builder()
.setLocalUrl(localVideoFile.toUri())
val videoContentBuilder = ShareVideoContent.Builder()
.setContentDescription("Post desctiption here")
.setContentTitle("Post title here")
.setVideo(shareBuilder.build())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment