And after the setup is complete you can use the helper class as:
public class DemoSceneScript : MonoBehaviour
{
public FacebookStoryShareHelper facebookStoryShareHelper;
// Share image to Facebook Story by providing the path to the image file
public void ShareImageToStory()
{
facebookStoryShareHelper.ShareImageToFacebookStory(_imageFilePath);
}
// Share image & sticker to Facebook Story by providing file paths
public void ShareImageAndStickerToStory()
{
facebookStoryShareHelper.ShareImageWithStickerToFacebookStory(_imageFilePath, _stickerFilePath);
}
// Share image with gradient to Facebook Story by providing file paths and color values
public void ShareImageWithGradientToStory()
{
facebookStoryShareHelper.ShareStickerWithGradientToFacebookStory(_imageFilePath, "#CC3322", "#99AE32");
}
// Share video to Facebook Story by providing file path
public void ShareVideo()
{
facebookStoryShareHelper.ShareVideoToFacebookStory(_videoFilePath);
}
// Share video & sticker to Facebook Story by providing file paths
public void ShareVideoWithSticker()
{
facebookStoryShareHelper.ShareVideoWithStickerToFacebookStory(_videoFilePath, _stickerFilePath);
}
// Share video to Facebook Reel by providing file path
public void ShareVideoReel()
{
facebookStoryShareHelper.ShareVideoReel(_videoFilePath);
}
// Share video & sticker to Facebook Reel by providing file path
public void ShareVideoReelWithSticker()
{
facebookStoryShareHelper.ShareVideoReelWithSticker(_videoFilePath, _stickerFilePath);
}
}
Build Errors
If you encounter an issue: unexpected element <queries> found in <manifest>
There is an easy fix for that: go to File -> Build Settings -> Player Settings -> Publishing Settings and select Custom Base Gradle Template. After that open the generated file baseProjectTemplate.gradle under Assets/Plugins/Android folder and change com.android.tools.build:gradle:*** to