Sharing: Introduction

The Sharing module helps you easily share texts and images to social networks including Facebook, Twitter and Google+ using the native sharing functionality. In addition, it also provides convenient methods to capture the screenshots to be shared.

Below are the sharing interfaces on iOS and Android, respectively.

[iOS] Request Photo Library Access Permission

Since iOS 10, in order to use the "Save Image" feature of the sharing utility, the app needs to ask for user permission before it can access the photo library. Failure to do so will cause the app to crash as soon as the user selects the option. To request the photo library access permission, you need to add the Privacy - Photo Library Usage Description and Privacy - Photo Library Additions Usage Description properties to the Info.plist of your Xcode project.

As of this writing, out tests show that on iOS 10, the Privacy - Photo Library Usage Description property is required. While iOS 11 asks for the Privacy - Photo Library Additions Usage Description property. Therefore it's recommended to add both properties if your target platforms including iOS 10 and above.

In your generated Xcode project open the Info.plist file.

Click the + button on the right of Information Property List to add a new key.

Scroll down to find the Privacy - Photo Library Usage Description key.

Enter a value for the key, this message will be displayed as the app requests access permission when the user selects the "Save Image" option.

Repeat the process to add the Privacy - Photo Library Additions Usage Description property.

[Android] Enable External Write Permission

For this module to function on Android, it is necessary to enable the permission to write to external storage. To do so, go to Edit > Project Settings > Player, select Android settings tab, then locate the Configuration section and set the Write Permission to External (SDCard).

results matching ""

    No results matching ""