pwa-for-wp icon indicating copy to clipboard operation
pwa-for-wp copied to clipboard

Sharing Media in Progressive Web Apps

Open Sanjeevsetu opened this issue 5 years ago • 1 comments

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

Sanjeevsetu avatar Aug 05 '19 06:08 Sanjeevsetu

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.

AllARTSoftworks avatar Sep 15 '19 05:09 AllARTSoftworks

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

Sanjeevsetu avatar May 17 '24 11:05 Sanjeevsetu

pushed in PWA for wp 1.7.71 and BuddyPress for PWA 1.4.3

akshaywali avatar Jul 03 '24 13:07 akshaywali