ahmedkaludi / pwa-for-wp

PWA plugin is bringing the power of the Progressive Web Apps to the WP & AMP to take the user experience to the next level! You can give the APP-like experience to your audience which will get your website to their home screen and works instantly like an APP with offline support.
https://wordpress.org/plugins/pwa-for-wp/
76 stars 22 forks source link

Sharing Media in Progressive Web Apps #159

Closed Sanjeevsetu closed 3 months ago

Sanjeevsetu commented 5 years ago

https://developers.google.com/web/updates/2018/12/web-share-target

AllARTSoftworks commented 5 years ago

Just managed to do it by adding these lines to your code in /pwa-for-wp/service-work/class-file-creation.php, line 477

$manifest['share_target']     = array(
                    'action' => '/my-target-link',
                    'method' => 'post',
                    'enctype' => 'multipart/form-data',
                    'params' => array(
                        'files' => array(
                            'name' => 'file',
                            'accept' => array('image/*')
                            )
                        )
                    );

Obviously you need to change "my-target-link" and mime type accordingly as well as writing server side code to handle the file.

Sanjeevsetu commented 4 months ago

One more user requested the same feature. https://github.com/ahmedkaludi/pwa-for-wp/issues/887

akshaywali commented 3 months ago

pushed in PWA for wp 1.7.71 and BuddyPress for PWA 1.4.3