-
-
Notifications
You must be signed in to change notification settings - Fork 199
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
When I use the AR camera I can't use the method "GetImageFromGallery" to select the picture, and call back is null #323
Comments
It invokes the callback if the native image picker is silently closed. Can you describe the image picker UI's behaviour with and without this code? |
with this code:When I use the AR camera I can't use the method "GetImageFromGallery" to select any picture, and call back is null,But I found that I can open the phone album normally, and there is a picture path back before update method runs; |
Thank you for the elaboration.
What I understand here is that the callback is invoked with a proper path before that Update method runs? |
Yes, I'm sorry I'm not good at English. |
I couldn't give it a thought due to my current schedule. This is still in my mind. |
Thank you very much |
I'm trying to pinpoint the root of the issue. Were you testing on an iPad? If so, did the problem occur on an iPhone, as well? |
I only tested it on an iPhone. |
Can you put NSLogs inside this function to see how it returns 0: UnityNativeGallery/Plugins/NativeGallery/iOS/NativeGallery.mm Lines 670 to 699 in 66157bd
For starters, you should log imagePickerState, whether or not imagePicker/imagePickerNew is nil, whether or not its presentingViewController is UnityGetGLViewController() (if not, what is it? Is it nil?) |
sorry,I was very busy recently. I ran some tests, but they didn't seem out of the ordinary, did they?
test result: imagePickerState:1 |
Yes it looks ordinary. I was suspecting that the imagePicker's presentingViewController check was somehow failing in AR but the logs say otherwise. I'll investigate the parts where imagePickerState is set to 0. Were you receiving the null callback immediately after invoking GetImageFromGallery or after picking an image from the gallery? |
Yes,I received the null callback immediately after picking an image from the gallery. |
Hello again. I'm trying to debug this issue once again. On AR, does the app pause/stop while the image picker is visible? If you get the chance, could you put Debug.Log(Time.frameCount) inside NGMediaReceiveCallbackiOS.Update and NGMediaReceiveCallbackiOS.OnMediaReceived so that we can understand which one is called when? |
After careful investigation, the problem was found in the NGMediaReceiveCallbackiOS class,
private void Update()
{
if( IsBusy )
{
if( Time.realtimeSinceStartup >= nextBusyCheckTime )
{
nextBusyCheckTime = Time.realtimeSinceStartup + 1f;
So I would like to know what the above method means, and will it have any effect after disabling it?Thank you so much!
The text was updated successfully, but these errors were encountered: