The image is created and stored on the device. That part is no problem.
Sharing to other social media like instagram works fine.
Sharing to Facebook under Android works find.
Sharing to Facebook under iOS does not work.
here is the code related to the sharing part:
string imageName = $"IHaveBeenThere_{(int)rect.width}x{(int)rect.height}_{System.DateTime.Now}.png";
string filePath = Path.Combine(Application.temporaryCachePath, imageName);
File.WriteAllBytes(filePath, screenShot.EncodeToPNG());
NativeGallery.Permission permission = NativeGallery.SaveImageToGallery(screenShot, "I Have Been There", imageName, (success, path) => Debug.Log("Media save result: " + success + " " + path));
// To avoid memory leaks
Destroy(screenShot);
new NativeShare().AddFile(filePath)
.SetTitle("I Have Been There")
.SetSubject(gameName).SetText(shareMessage).SetUrl("https://chunhuacatherinedong.com/")
.SetCallback((result, shareTarget) => Debug.Log("Share result: " + result + ", selected app: " + shareTarget))
.Share();
The image is created and stored on the device. That part is no problem.
Sharing to other social media like instagram works fine.
Sharing to Facebook under Android works find.
Sharing to Facebook under iOS does not work.
here is the code related to the sharing part: