Skip to content

Commit

Permalink
Potential fix for #313 ("No such proxy method" error)
Browse files Browse the repository at this point in the history
  • Loading branch information
yasirkula committed Mar 8, 2024
1 parent 535827c commit ae2ebf6
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@ public NGMediaReceiveCallbackAndroid( NativeGallery.MediaPickCallback callback,
callbackHelper = new GameObject( "NGCallbackHelper" ).AddComponent<NGCallbackHelper>();
}

[UnityEngine.Scripting.Preserve]
public void OnMediaReceived( string path )
{
callbackHelper.CallOnMainThread( () => callback( !string.IsNullOrEmpty( path ) ? path : null ) );
}

[UnityEngine.Scripting.Preserve]
public void OnMultipleMediaReceived( string paths )
{
string[] result = null;
Expand Down
2 changes: 2 additions & 0 deletions Plugins/NativeGallery/Android/NGPermissionCallbackAndroid.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public NGPermissionCallbackAndroid( object threadLock ) : base( "com.yasirkula.u
this.threadLock = threadLock;
}

[UnityEngine.Scripting.Preserve]
public void OnPermissionResult( int result )
{
Result = result;
Expand All @@ -37,6 +38,7 @@ public NGPermissionCallbackAsyncAndroid( NativeGallery.PermissionCallback callba
callbackHelper = new GameObject( "NGCallbackHelper" ).AddComponent<NGCallbackHelper>();
}

[UnityEngine.Scripting.Preserve]
public void OnPermissionResult( int result )
{
callbackHelper.CallOnMainThread( () => callback( (NativeGallery.Permission) result ) );
Expand Down
4 changes: 2 additions & 2 deletions Plugins/NativeGallery/NativeGallery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -596,13 +596,13 @@ private static Permission GetMediaFromGallery( MediaPickCallback callback, Media
if( ( mediaType & MediaType.Video ) == MediaType.Video )
{
editorFilters.Add( "Video files" );
editorFilters.Add( "mp4,mov,wav,avi" );
editorFilters.Add( "mp4,mov,webm,avi" );
}

if( ( mediaType & MediaType.Audio ) == MediaType.Audio )
{
editorFilters.Add( "Audio files" );
editorFilters.Add( "mp3,aac,flac" );
editorFilters.Add( "mp3,wav,aac,flac" );
}

editorFilters.Add( "All files" );
Expand Down
2 changes: 1 addition & 1 deletion Plugins/NativeGallery/README.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
= Native Gallery for Android & iOS (v1.7.9) =
= Native Gallery for Android & iOS (v1.8.0) =

Documentation: https://github.com/yasirkula/UnityNativeGallery
FAQ: https://github.com/yasirkula/UnityNativeGallery#faq
Expand Down
2 changes: 2 additions & 0 deletions Plugins/NativeGallery/iOS/NGMediaReceiveCallbackiOS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ private void Update()
}
}

[UnityEngine.Scripting.Preserve]
public void OnMediaReceived( string path )
{
IsBusy = false;
Expand All @@ -77,6 +78,7 @@ public void OnMediaReceived( string path )
_callback( path );
}

[UnityEngine.Scripting.Preserve]
public void OnMultipleMediaReceived( string paths )
{
IsBusy = false;
Expand Down
2 changes: 2 additions & 0 deletions Plugins/NativeGallery/iOS/NGMediaSaveCallbackiOS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public static void Initialize( NativeGallery.MediaSaveCallback callback )
instance.callback = callback;
}

[UnityEngine.Scripting.Preserve]
public void OnMediaSaveCompleted( string message )
{
NativeGallery.MediaSaveCallback _callback = callback;
Expand All @@ -30,6 +31,7 @@ public void OnMediaSaveCompleted( string message )
_callback( true, null );
}

[UnityEngine.Scripting.Preserve]
public void OnMediaSaveFailed( string error )
{
NativeGallery.MediaSaveCallback _callback = callback;
Expand Down
1 change: 1 addition & 0 deletions Plugins/NativeGallery/iOS/NGPermissionCallbackiOS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public static void Initialize( NativeGallery.PermissionCallback callback )
instance.callback = callback;
}

[UnityEngine.Scripting.Preserve]
public void OnPermissionRequested( string message )
{
NativeGallery.PermissionCallback _callback = callback;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "com.yasirkula.nativegallery",
"displayName": "Native Gallery",
"version": "1.7.9",
"version": "1.8.0",
"documentationUrl": "https://github.com/yasirkula/UnityNativeGallery",
"changelogUrl": "https://github.com/yasirkula/UnityNativeGallery/releases",
"licensesUrl": "https://github.com/yasirkula/UnityNativeGallery/blob/master/LICENSE.txt",
Expand Down

0 comments on commit ae2ebf6

Please sign in to comment.