Skip to content
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

[Experimental] WebChromeClient for <input type="file"> #77

Merged
merged 42 commits into from
Apr 12, 2020

Conversation

KojiNakamaru
Copy link
Member

An experimental implementation for <input type="file"> on Android. It utilizes Fragment for implementing onActivityResult() and it should work for Android 3.0 or later, except 4.4.0-4.4.2 (because a bug introduced since 4.4.0).

References

@nekochannofukkin
Copy link

CWebViewPlugin.javaをコンパイルしたところAndroid5で正常に画像ファイルの選択・アップロードができました。
しかし、今まで動いていいたJavaScriptのUnity.call()が、
「Method not found」というエラーのためUnityにコールバックできなくなりました。
原因は何が考えられますか?

window.addEventListener('load', function() {`
    try{
        Unity.call('message');
    }catch(e){
        alert(e.message);
    }
}, false);

@KojiNakamaru KojiNakamaru force-pushed the experimental/android_input_type_file branch from ba7d5c1 to 4532900 Compare June 6, 2016 02:54
@KojiNakamaru
Copy link
Member Author

報告ありがとうございます。この実験的な実装自体の問題ではなく、
#75
の拡張の際に生じた問題でした。
#80
で修正し、こちらのブランチにも反映しました。

@nekochannofukkin
Copy link

ありがとうございます。正常に動作いたしました。

@torut
Copy link

torut commented Oct 16, 2018

こちらのPRのものを利用しているのですが、masterのものを再びマージしていただくのは難しいのでしょうか。

というのもこちらのブランチのものを使っているとAndroidでソフトキーボードを表示した際のwebviewのサイズ変更がちょうど反映されていないようでして。。。
874b311

ぜひご一考いただければと思います。

@KojiNakamaru
Copy link
Member Author

masterをマージしてバイナリを更新してみました。

@KojiNakamaru
Copy link
Member Author

a91bad3 now supports the camera input. You need the followings to utilize it:

  • Set Android Minimum API level Android 5.0 'Lollipop' (API Level 21) or later.
  • Add <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> and <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> in AndroidManifest.xml.

@KojiNakamaru KojiNakamaru force-pushed the experimental/android_input_type_file branch from c0524ed to 8454209 Compare June 14, 2019 05:58
@antoniohof
Copy link

antoniohof commented Apr 9, 2020

Hi, I would very much like to use this and also the features current in master.
Would it be possible to merge master into this branch and update binaries?

Thank you

Antonio

@KojiNakamaru KojiNakamaru merged commit a1a2a89 into master Apr 12, 2020
@KojiNakamaru KojiNakamaru deleted the experimental/android_input_type_file branch April 12, 2020 12:03
@KojiNakamaru
Copy link
Member Author

@antoniohof Almost all recent devices should work well with this experimental implementation, so I've merged it into the master branch, finally. Could you please try the latest on the master branch.

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

Successfully merging this pull request may close these issues.

4 participants