yasirkula / UnityNativeShare

A Unity plugin to natively share files (images, videos, documents, etc.) and/or plain text on Android & iOS
MIT License
891 stars 131 forks source link

I need to share Multiple files using NativeShare(). How do i add path of second file? #84

Closed CharlieBradbury0 closed 3 years ago

CharlieBradbury0 commented 3 years ago

I need to share Multiple files using NativeShare(). How do i add path of second file? I need to attach two text files on a single button press in unity. I can send single file. Here's the code:

using System.Collections; using System.Collections.Generic; using UnityEngine; using System.IO; using System;

public class ShareButton : MonoBehaviour { // Start is called before the first frame update public void ClickShare() { StartCoroutine(Share()); }

private IEnumerator Share()
{
    yield return new WaitForEndOfFrame();
    new NativeShare().AddFile(filePath).SetSubject("Vologram Results").SetText("Here are the results").Share();
    //new NativeShare().AddFile(ffilePath).SetSubject("Vologram Results").SetText("Here are the results").Share();

}

}

yasirkula commented 3 years ago

You can call AddFile multiple times, one call per file.

CharlieBradbury0 commented 3 years ago

Thank You So Much!