Skip to content
This repository has been archived by the owner on Mar 9, 2024. It is now read-only.

Share to Slack #92

Open
EdwardTeach68 opened this issue Sep 23, 2020 · 11 comments
Open

Share to Slack #92

EdwardTeach68 opened this issue Sep 23, 2020 · 11 comments
Labels

Comments

@EdwardTeach68
Copy link

EdwardTeach68 commented Sep 23, 2020

Hi there.
After sharing image to slack it doesn't hide share dialogue.ShareResult also NotShared,but image was shared.How can i hide share dialogue? Testing on IOS 13.6 (iphone x)

@yasirkula
Copy link
Owner

Are there any error messages in Xcode console?

@EdwardTeach68
Copy link
Author

I don't see any errors in the console.

@EdwardTeach68
Copy link
Author

The app becomes non-clickable with black bars around the edges. Swiping down makes it clickable again and full screen.This issue with slack only

@yasirkula
Copy link
Owner

Can you see the "Shared to %@ with result: %d" log in Xcode console for Slack or any other apps? If so, does this log appear before or after the share result log that is Debug.Log'ed from Unity?

@EdwardTeach68
Copy link
Author

3dAssistant[14888:3781953] Shared to com.tinyspeck.chatlyio.share with result: 0
NotShared
UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object)
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:Log(Object)
Data.Scripts.ScreenShots.<>c:b__2_0(ShareResult, String)
ShareResultCallback:Invoke(ShareResult, String)
NativeShareNamespace.NSShareResultCallbackiOS:OnShareCompleted(String)

(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
Ok,i see that after slack sharing my app is not focused,only after swiping down it showes this debug.Looks like slack does not exit from his sharing dialogue and a swipe down closes it

@yasirkula
Copy link
Owner

yasirkula commented Sep 23, 2020

Result of 0 should actually point to ShareResult.Unknown. I'm not sure why it resolves to NotShared in your case. Can you insert Debug.Log("Share message received: " + message); to this line and see what it outputs?

P.S. I don't have any control over the shared apps' behaviours, so I don't think that we can avoid Slack's strange behaviour.

@EdwardTeach68
Copy link
Author

Yeah,its slack problem.I have shared an image from Telegram to Slack and get the same issue.Thank you for helping)

@yasirkula
Copy link
Owner

I'm still unsure about the cause of NotShared permission. It should've been Unknown. Did you get a chance to insert the Debug.Log line I've mentioned to the code?

@EdwardTeach68
Copy link
Author

Ok,one moment

@EdwardTeach68
Copy link
Author

Share message received: 2com.tinyspeck.chatlyio.share (show first)
after shows debug.log from callback "NotShared"
and Share message received: 2(null)

@yasirkula
Copy link
Owner

Ah, I completely forgot about the completed ? 1 : 2 line here. So the issue is that Slack is returning false as BOOL completed parameter. I haven't seen other apps having this issue, though. If you are rewarding the player in ShareResultCallback, you can query result != NativeShare.ShareResult.NotShared || !string.IsNullOrEmpty(shareTarget) for maximum compatibility. This way, you'll make sure that the user has at least selected an app from the share sheet.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants