Created
August 30, 2019 13:28
-
-
Save voxelbustersold/e89a3af4d9230ddd5b097e78285ca240 to your computer and use it in GitHub Desktop.
CPNP 2.0 Mail Sharing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
using VoxelBusters.NativePlugins; | |
public class ExampleClass : MonoBehaviour | |
{ | |
public void Start() | |
{ | |
if (MailComposer.CanSendMail()) | |
{ | |
// create new instance and populate fields | |
new MailComposer() | |
.SetSubject("Example") | |
.SetBody("Lorem ipsum dolor sit amet") | |
.AddScreenshot("screenshot.jpg") | |
.SetCompletionCallback(OnMailComposerClosed) //Call AddImage with byte array and more options | |
.Show(); | |
} | |
else | |
{ | |
// device doesn't support sending emails | |
} | |
} | |
private void OnMailComposerClosed(IMailComposerClosedCallbackResult result) | |
{ | |
// add your code | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment