-
-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Visual issues in Landscape mode when sharing on iOS #72
Comments
It does appear possible to tell unity to change the auto rotation settings to portrait, wait a frame, then invoke this plugin and this will fix the issues. Of course you also need to know when you can change your view back to landscape, and as of now this plugin doesn't furnish a callback. I tested it, and if we add this to the activity before showing the share dialog, it does invoke when the controller is dismissed.
So maybe a good fix is to have an optional delegate arg from ShareScreenshotAndText and ShareText which will be invoked on completion, see "Using Delegates" on https://docs.unity3d.com/Manual/PluginsForIOS.html |
I started looking at Unity callbacks a while ago, the issue is I need to write a wrapper that allows Actions to be passed into Obj-C in a friendly way. The link you provided touches on how I'll do it, which is to create some typedefs like I'd also need to write the Android version at the same time in order to make it consistent across platforms |
I might be able to help, depending on timing as I think I need this in a little over a week. On the other hand, I don't want to get in your way and I also don't want to figure out android as that currently works fine in landscape. If you think you won't be doing it this week just give this post a thumbs up and I'll try doing at least iOS in a fork. |
Feel free to add and patch what you like and submit it as a pull request |
I'll try and get my Mac environment setup again for the weekend Some of the calls need a refactor, I'd rather pass around 1 object with all the variables needed for sharing rather than passing through each variable as optional parameters. But I'll do that after this as it'll be a breaking API change so I'll need to bump the version to v1.1.0 when I do |
All tests on Unity 2020.3f15 / Xcode 12.5
Building the example out to an iPhone 6S on iOS 14 we can see the Instagram share has no keyboard:
Similar for building to an iPad Pro on iOS 14 (external keyboard works, but no on screen keyboard will appear)
On these devices, sharing images to instagram from the Photos app does bring up the keyboard, so it's likely something about the unity root view controller.
Oddly, in my own unity app when embedding this plugin, things are a bit worse. This is a screenshot of trying to share from the same iPhone 6S:
I've closely compared the build settings in both projects and I can't figure out why the share window would be smaller and off the screen in my app and not the example project in this repo, but I do wonder if they might have the same root cause.
I'd either be happy to see the landscape share view work as well as it does in Apple Photos or have a strategy for selectively turning on portrait mode when launching this sharing dialog to sidestep the issue.
The text was updated successfully, but these errors were encountered: