Support » Plugin: PWA » How to start using this in my own plugin?

  • Resolved guanzo

    (@guanzo)


    I’m completely new to WordPress development.

    I get the sense that this plugin is meant to be used as a library, so other plugin developers can import this plugin. However, I don’t see any instructions on how to import/install this plugin? If I’m developing my own plugin, how do I add this pwa plugin to my own, so that I may begin calling its API?

    • This topic was modified 1 year, 10 months ago by guanzo.
    • This topic was modified 1 year, 10 months ago by guanzo.
    • This topic was modified 1 year, 10 months ago by guanzo.
    • This topic was modified 1 year, 10 months ago by guanzo.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Weston Ruter

    (@westonruter)

    Thread Starter guanzo

    (@guanzo)

    Sorry, where exactly in the readme does it describe how to import this plugin? Perhaps this quote?

    > If you are developing a plugin or theme that includes a service worker, consider relying on this PWA plugin, or at least only use the built-in implementation as a fallback for when the PWA plugin is not available.

    Do i just copy & paste the plugin’s files into my own plugins directory?

    That’s what I’m trying now, and it “works”, but I get this warning in the admin plugin page

    > You appear to have installed the PWA plugin incorrectly. It is currently installed in the test-plugin directory, but it needs to be placed in a directory named pwa. Please rename the directory. This is important for WordPress plugin auto-updates.

    So it seems like the pwa plugin must be installed as a separate plugin? Does that mean the end user has to install 2 plugins? The PWA one, and the one I’m making?

    • This reply was modified 1 year, 10 months ago by guanzo.
    • This reply was modified 1 year, 10 months ago by guanzo.
    • This reply was modified 1 year, 10 months ago by guanzo.
    Plugin Author Weston Ruter

    (@westonruter)

    @guanzo You should be installing the plugin via the WordPress plugin directory. Just go to the WP Admin and then Plugins, Add New, search for the PWA plugin, and install.

    If you are developing a plugin or theme that includes a service worker, consider relying on this PWA plugin, or at least only use the built-in implementation as a fallback for when the PWA plugin is not available.

    You can then use the hooks as shown in https://gist.github.com/westonruter/1a63d052beb579842461f6ad837715fb to integrate with the PWA plugin.

    So the end user must install the PWA plugin along with my plugin. Got it, thanks

    Plugin Author Weston Ruter

    (@westonruter)

    Yes. The plan is to propose merging the PWA into core, so then you would only need your own plugin at that time.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to start using this in my own plugin?’ is closed to new replies.