yasirkula / UnityNativeShare

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

Error On Oculus Quest2 #153

Open dickredone opened 1 year ago

dickredone commented 1 year ago

The error dialog frame opened when I try to share a local picture.

"Unable to share.There was a probblem sharing your item.Please try again later."

Reproduction steps

public void OnClickShare()
        {
            FileInfo[] allFiles = FileSaveAndLoad.LoadPics("Pics");
            NativeShare share = new NativeShare();
            share.AddFile(allFiles[0].FullName).Share();
        }

Run the Method "OnClickShare".

Platform specs

Additional info

Logcat (Android)

Can't find param: oculus_shared_social:oculus_social_parental_control 
Invalid input pram: oculus_shared_social:oculus_social_parental_control 
Can't find param: oculus_shared_social:oculus_social_parental_control 
Invalid input pram: oculus_shared_social:oculus_social_parental_control 
[error]: 'UniversalShareSheet', [ 'Error constructing share object from params: {}, type: external_link},
source: android_2d_app,
payload: ,
overrides: {}' ]
yasirkula commented 1 year ago

I haven't tested the plugin in VR actually. The error messages look pretty useful but googling them didn't reveal any search results and I don't know why some parental controls would interfere with the sharing and how to overcome it. I couldn't even find any documentation about sharing in VR 😞

This issue will probably remain open for some time.

hybridherbst commented 1 year ago

Came here because of the same issue.

Some more info:

This is also logged:

2022/11/03 22:02:54.016 2471 3159 Info [OAO] DialogControllerManager New dialog: type: social_host_share_sheet, uri "?type=external_link&source=android_2d_app&payload=&overrides=%7B%7D"
2022/11/03 22:02:55.124 19059 19132 Error RCTVR_HERMES [error]: 'UniversalShareSheet', [ 'Error constructing share object from params: {}, type: external_link},\n      source: android_2d_app,\n      payload: ,\n      overrides: {}' ]
yasirkula commented 1 year ago

Is it possible to share files via Oculus Quest 2's own Gallery app or Files app (if exists)? I wonder if file sharing isn't possible at all on Oculus Quest 2. PS. If sharing is possible from stock apps, could you check their share logs as well? Maybe we can spot a difference in logs.

hybridherbst commented 1 year ago

I believe it's possible - the share sheet pops up and has three options, "Facebook", "Facebook groups" and "Messenger" - and if one shares via that, a post appears in that place just fine. Only the image is missing (depending on the parameters, as outlined above).

I don't think other apps like Gallery use that share functionally though, they don't have a direct button to share as far as I'm aware, but will check.

Tangentially related, the new Instagram app on Quest doesn't support file sharing intents yet (it's a PWA and the file handler protocols are not supported yet).

yasirkula commented 1 year ago

This example code uses Uri.parse instead of a ContentProvider; could you see if Uri.parse works on Quest 2: http://www.daniel4d.com/blog/sharing-image-unity-android. You'll need to replace the file path with your own file path and "image/jpeg" mimetype with your file's mimetype.