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

Plugin not working on Xiaomi devices in landscape mode #56

Closed play123 closed 3 years ago

play123 commented 4 years ago

Hi, This plugin not working on android 9 or up. I'm using unity 18.3. it's work in android 8. It's not showing app list. It's showing share with other devices.im attached image. Please help.

![Uploading Screenshot_2019-11-30-21-48-38-172_android.jpg…]()

Best regards, Anil Solanki

yasirkula commented 4 years ago

Can you reupload the image? It can't be loaded on my side. Also check out logcat for any meaningful error messages so that I might be able to pinpoint the issue.

play123 commented 4 years ago

HI, sorry for the delay. I'm uploading the image again please check. Screenshot_2019-11-30-21-48-52-701_android

yasirkula commented 4 years ago

It is the first time I'm seeing this share sheet UI, actually.

play123 commented 4 years ago

HI, I'm getting the same screen after adding the mime parameter. I'm sanding log text and my sharing code for extra details.

LOG CAT

12-04 18:08:54.638 2067 2094 W ActivityManager: Ignoring remove of inactive process: ProcessRecord{c4ecfdc 0:com.google.process.gservices/u0a19} 12-04 18:09:16.469 2067 2089 I ActivityManager: Process com.google.process.gservices (pid 14857) has died: cch+6CEM 12-04 18:09:16.625 2067 10551 I ActivityManager: START u0 {act=android.intent.action.CHOOSER cmp=android/com.android.internal.app.ChooserActivity (has extras)} from uid 10291 12-04 18:09:16.649 13439 13439 I Unity : onPause 12-04 18:09:16.974 13439 13458 D Unity : Sensor : Accelerometer ( 1) ; 0.001190 / 0.00s ; ICM20607 Accelerometer / InvenSense 12-04 18:09:17.045 2067 2096 I ActivityManager: Start proc 15097:android:ui/1000 for activity android/com.android.internal.app.ChooserActivity caller=com.d.design 12-04 18:09:17.112 13439 13439 I Unity : windowFocusChanged: false 12-04 18:09:18.153 2067 2102 I ActivityManager: Displayed android/com.android.internal.app.ChooserActivity: +1s138ms

MY CODE

public void StartSharing(ListFiles) { NativeShare share = new NativeShare();

    share.SetSubject("D-Design");
    share.SetText("D-Design file share");
    share.SetTitle("D-Design file share");

    for (int i = 0; i < Files.Count; i++)
    {
        string fileName = Files[i].Replace("\\", "/");
        string mineType = "image/jpeg";

        if (fileName.ToLower().Contains(".mp4"))
        {
            mineType = "video/mp4";
        }

        share.AddFile(fileName, mineType);
    }

    share.Share();      
}

best regards, Anil Solanki

yasirkula commented 4 years ago

Hmm, try replacing fileName with System.IO.Path.GetFullPath(fileName) in AddFile. If that doesn't work, I won't be able to pinpoint this issue since there are no error messages in logcat either. I'd recommend you to also try out the example code and see if you can share screenshots properly: https://github.com/yasirkula/UnityNativeShare/#example-code

play123 commented 4 years ago

HI, Thanks for your quick replay. this issue is reproduced in MI Note 5 pro. other devices I check its work fine. thanks for your quick support.

best regards, Anil Solanki

yasirkula commented 4 years ago

I'm assuming that the example code didn't work on MI Note 5 Pro either, am I correct?

play123 commented 4 years ago

Yes, this is not working but I deeply investigate then I found this. 01_When I Use facebook. And Click on sharing then I got this share window.

Screenshot_2019-12-06-11-56-11-447_android

And when I use your plugin then I got this share window.

Screenshot_2019-12-06-11-58-19-264_android

Issue: May Be I think the window does not open fullscreen this an issue. if this helps you. Also, you can close this issue because this is an I think device-specific issue.

Best regards, Anil Solanki

yasirkula commented 4 years ago

Thanks for all the info! I can't promise any solutions at the moment because I still don't know what might be causing this issue but will update the plugin if I find a fix. The Issue should stay open in the meantime.

yasirkula commented 4 years ago

P.S. Does removing these lines affect the outcome:

share.SetSubject("D-Design");
share.SetText("D-Design file share");
share.SetTitle("D-Design file share");
yasirkula commented 4 years ago

Update: It is reported that this issue occurs in landscape mode only.

bngbog commented 4 years ago

Hello Yasirkula,

any updates to this issue since January? I seem to run into the same thing with landscape mode on Samsung S9+

Regards.

yasirkula commented 4 years ago

Sadly not. I don't know the cause of the issue. Maybe other solutions don't suffer from this issue?

fdtdev commented 4 years ago

I can confirm that I tested it today with https://assetstore.unity.com/packages/tools/integration/cross-platform-native-plugins-lite-version-37272 and the same happens, in a xiaomi mi 9. PD: I couldn't make the one that you suggested to work because it has a crash building 64 bit il2cpp android now.

Divyanshu-del commented 4 years ago

I am facing the same issue in some devices. Is there an update or do I need to switch to another plugin?

yasirkula commented 4 years ago

Unfortunately, there are no updates. The only related topics I could find on the internet are these:

If you find a working plugin, please also let me know.

Divyanshu-del commented 4 years ago

Update: It is reported that this issue occurs in landscape mode only.

Exactly... U right.. i performed all kinds of test and I figured the same

When are you fixing it?

yasirkula commented 4 years ago

Sadly not. I don't know the cause of the issue.

vipulpatel0911 commented 4 years ago

Thanks @yasirkula for a wonderful plugin. I think this issue is at MI level and not related with this plugin. As you can see they have removed entire section of other applications in landscape mode, might be because of space issue. Can we all unite and start bombarding on MI to solve this issue asap?

Because @yasirkula has done a great work and this problem is not in his hand. So instead of asking a solution from him, we should ask it from MI.

Thanks.