• Extensions
  • Progressive Web App (PWA) and Push Notifications

Oh my god, how to fix it 🤣

[http@archlinux clinux]$ composer require minishlink/web-push
Using version ^6.0 for minishlink/web-push
./composer.json has been updated
Running composer update minishlink/web-push
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - askvortsov/flarum-pwa v2.0.4 conflicts with minishlink/web-push v6.0.3.
    - askvortsov/flarum-pwa v2.0.4 conflicts with minishlink/web-push v6.0.2.
    - askvortsov/flarum-pwa v2.0.4 conflicts with minishlink/web-push v6.0.1.
    - askvortsov/flarum-pwa v2.0.4 conflicts with minishlink/web-push v6.0.0.
    - askvortsov/flarum-pwa is locked to version v2.0.4 and an update of this package was not requested.
    - Root composer.json requires minishlink/web-push ^6.0 -> satisfiable by minishlink/web-push[v6.0.0, v6.0.1, v6.0.2, v6.0.3].


Installation failed, reverting ./composer.json and ./composer.lock to their original content.
[http@archlinux clinux]$ composer update
Loading composer repositories with package information
Updating dependencies
Nothing to modify in lock file
Installing dependencies from lock file (including require-dev)
Nothing to install, update or remove
Generating autoload files
71 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
[http@archlinux clinux]$
[http@archlinux clinux]$ php flarum info
Flarum core 0.1.0-beta.15
PHP version: 7.4.15
Loaded extensions: Core, date, libxml, openssl, pcre, zlib, ctype, dom, fileinfo, filter, hash, json, mbstring, pcntl, SPL, PDO, session, posix, readline, Reflection, standard, SimpleXML, Phar, tokenizer, xml, xmlreader, xmlwriter, mysqlnd, curl, gd, gmp, pdo_mysql, zip
+-------------------------------+------------------+--------+
| Flarum Extensions             |                  |        |
+-------------------------------+------------------+--------+
| ID                            | Version          | Commit |
+-------------------------------+------------------+--------+
| flarum-approval               | v0.1.0-beta.15   |        |
| flarum-emoji                  | v0.1.0-beta.15   |        |
| flarum-flags                  | v0.1.0-beta.15   |        |
| flarum-likes                  | v0.1.0-beta.15   |        |
| flarum-lock                   | v0.1.0-beta.15   |        |
| flarum-markdown               | v0.1.0-beta.15   |        |
| flarum-statistics             | v0.1.0-beta.15   |        |
| flarum-sticky                 | v0.1.0-beta.15.1 |        |
| flarum-subscriptions          | v0.1.0-beta.15   |        |
| flarum-suspend                | v0.1.0-beta.15   |        |
| flarum-tags                   | v0.1.0-beta.15   |        |
| flarum-lang-english           | v0.1.0-beta.15   |        |
| flarum-mentions               | v0.1.0-beta.15   |        |
| fof-upload                    | 0.11.3           |        |
| fof-nightmode                 | 0.7.1            |        |
| lcinhk-acgembed               | v0.5.2           |        |
| flarum-akismet                | v0.1.0-beta.15   |        |
| ffans-lang-simplified-chinese | v0.1.0-beta.15.1 |        |
| askvortsov-pwa                | v2.0.4           |        |
+-------------------------------+------------------+--------+

Debug mode: off
[http@archlinux clinux]$

    Install minishlink/web-push lower than version 6 first, then try again. I had same problem. Got it fixed that way.

    lakshya the icons upload able in this extension are only used inside the actual PWA, iirc. Could you please elaborate as to what part isn't working, and share screenshots if possible?

      askvortsov I meant to say...that the icon/badge used to send push notifications to browsers is set to default browser icon....not what i uploaded in PWA......for example its default chrome icon in chrome browser.

        I've got the extension to work on my test forum, it works really well! Great job, looking forward to more updates and features from this extension, as the simple setup makes it... simply awesome

        4 days later

        Any way we can have it force refresh each time the app is opened? Sometimes I open it and it's stale and I don't see new posts unless I pull down to refresh

        For me name of app is not displayed properly the name od forum is displayed instead. Plus while trying to answear in existing discussion my screen moves towards bottom of site so I cant really see what am I writing. Tested from IOS.

        Edit: Screen behaves like crazy (moving bottom) only when I were "at bottom of site" while clicking answear. It behaves normally while sligtly above.

        • [deleted]

        • Edited

        Can anyone please help. I am trying to install this extension, but keep getting this error (logs):

        Info:
        FLARUM 0.1.0-BETA.15
        PHP 7.4.11
        MySQL 10.1.41-MariaDB
        askvortsov/flarum-pwa (v2.0.4)
        minishlink web push v5.2.5

        Next Illuminate\Database\QueryException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'xxxxx_xxxxx.mfpush_subscriptions' doesn't exist (SQL: alter tablemfpush_subscriptionsdrop indexmfpush_subscriptions_endpoint_unique) in /home/xxx/xxx/vendor/illuminate/database/Connection.php:669
        Stack trace:
        #0 /home/xxx/xxx/vendor/illuminate/database/Connection.php(629): Illuminate\Database\Connection->runQueryCallback('alter table
        mf...', Array, Object(Closure))
        #1 /home/xxx/xxx/vendor/illuminate/database/Connection.php(464): Illuminate\Database\Connection->run('alter table mf...', Array, Object(Closure))
        #2 /home/xxx/xxx/vendor/illuminate/database/Schema/Blueprint.php(97): Illuminate\Database\Connection->statement('alter table
        mf...')
        #3 /home/xxx/xxx/vendor/illuminate/database/Schema/Builder.php(290): Illuminate\Database\Schema\Blueprint->build(Object(Illuminate\Database\MySqlConnection), Object(Illuminate\Database\Schema\Grammars\MySqlGrammar))
        #4 /home/xxx/xxx/vendor/illuminate/database/Schema/Builder.php(151): Illuminate\Database\Schema\Builder->build(Object(Illuminate\Database\Schema\Blueprint))
        #5 /home/xxx/xxx/vendor/askvortsov/flarum-pwa/migrations/2020_08_02_000001_remove_unique_constraint.php(19): Illuminate\Database\Schema\Builder->table('push_subscripti...', Object(Closure))
        #6 [internal function]: Illuminate\Filesystem\Filesystem->{closure}(Object(Illuminate\Database\Schema\MySqlBuilder))`

        (...)

        Tried this:
        php flarum migrate:reset --extension askvortsov-pwa

        after this got error:

        [2021-02-27 18:28:38] flarum.ERROR: Doctrine\DBAL\Schema\SchemaException: There is no column with name 'endpoint' on table 'mfpush_subscriptions'. in /home/xxx/xxx/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/SchemaException.php:86
        Stack trace:
        #0 /home/xxx/xxx/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Table.php(711): Doctrine\DBAL\Schema\SchemaException::columnDoesNotExist('endpoint', 'mfpush_subscrip...')
        #1 /home/xxx/xxx/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Table.php(342): Doctrine\DBAL\Schema\Table->getColumn('endpoint')
        #2 /home/xxx/xxx/vendor/illuminate/database/Schema/Grammars/ChangeColumn.php(106): Doctrine\DBAL\Schema\Table->changeColumn('endpoint', Array)
        #3 /home/xxx/xxx/vendor/illuminate/database/Schema/Grammars/ChangeColumn.php(76): Illuminate\Database\Schema\Grammars\ChangeColumn::getDoctrineColumn(Object(Doctrine\DBAL\Schema\Table), Object(Illuminate\Database\Schema\ColumnDefinition))
        #4 /home/xxx/xxx/vendor/illuminate/database/Schema/Grammars/ChangeColumn.php(60): Illuminate\Database\Schema\Grammars\ChangeColumn::getTableWithColumnChanges(Object(Illuminate\Database\Schema\Blueprint), Object(Doctrine\DBAL\Schema\Table))
        #5 /home/xxx/xxx/vendor/illuminate/database/Schema/Grammars/ChangeColumn.php(37): Illuminate\Database\Schema\Grammars\ChangeColumn::getChangedDiff(Object(Illuminate\Database\Schema\Grammars\MySqlGrammar), Object(Illuminate\Database\Schema\Blueprint), Object(Doctrine\DBAL\Schema\MySqlSchemaManager))
        #6 /home/xxx/xxx/vendor/illuminate/database/Schema/Grammars/Grammar.php(55): Illuminate\Database\Schema\Grammars\ChangeColumn::compile(Object(Illuminate\Database\Schema\Grammars\MySqlGrammar), Object(Illuminate\Database\Schema\Blueprint), Object(Illuminate\Support\Fluent), Object(Illuminate\Database\MySqlConnection))
        #7 /home/xxx/xxx/vendor/illuminate/database/Schema/Blueprint.php(123): Illuminate\Database\Schema\Grammars\Grammar->compileChange(Object(Illuminate\Database\Schema\Blueprint), Object(Illuminate\Support\Fluent), Object(Illuminate\Database\MySqlConnection))
        #8 /home/xxx/xxx/vendor/illuminate/database/Schema/Blueprint.php(96): Illuminate\Database\Schema\Blueprint->toSql(Object(Illuminate\Database\MySqlConnection), Object(Illuminate\Database\Schema\Grammars\MySqlGrammar))
        #9 /home/xxx/xxx/vendor/illuminate/database/Schema/Builder.php(290): Illuminate\Database\Schema\Blueprint->build(Object(Illuminate\Database\MySqlConnection), Object(Illuminate\Database\Schema\Grammars\MySqlGrammar))
        #10 /home/xxx/xxx/vendor/illuminate/database/Schema/Builder.php(151): Illuminate\Database\Schema\Builder->build(Object(Illuminate\Database\Schema\Blueprint))
        #11 /home/xxx/xxx/vendor/askvortsov/flarum-pwa/migrations/2020_08_02_000000_change_endpoint_collation.php(19): Illuminate\Database\Schema\Builder->table('push_subscripti...', Object(Closure))
        #12 [internal function]: Illuminate\Filesystem\Filesystem->{closure}(Object(Illuminate\Database\Schema\MySqlBuilder))

          [deleted] It looks like your setup is messed up, so we'll have to do a reset. Do the following:

          • Manually remove the push_subscriptions (it might have a prefix) table from your DB
          • Go into your migrations table, and remove any entries caused by this extension. Be EXTREMELY careful not to remove anything else.

          Then try enabling it again.

            • [deleted]

            • Edited

            askvortsov

            Found this:
            2020_05_29_000000_add_push_subscriptions_table

            but I cannot delete this entry/row since this message is presented:

            Current selection does not contain a unique column. Grid edit, checkbox, Edit, Copy and Delete features are not available.

            Update:
            Solved it. Thanks @askvortsov 😀

            5 days later

            It works in version 5.2.5. Will you add support for current versions? Could you create the requirements section for the first post and add the following commands? The commands are for the Ubuntu server.

            sudo apt install php7.4-gmp
            composer require minishlink/web-push:5.2.5 -W
            composer require minishlink/web-push -W
            Do not run Composer as root/super user! See https://getcomposer.org/root for details
            Continue as root/super user [yes]? 
            Using version ^6.0 for minishlink/web-push
            ./composer.json has been updated
            Running composer update minishlink/web-push --with-all-dependencies
            Loading composer repositories with package information
            Updating dependencies
            Your requirements could not be resolved to an installable set of packages.
            
              Problem 1
                - askvortsov/flarum-pwa v2.0.4 conflicts with minishlink/web-push v6.0.3.
                - askvortsov/flarum-pwa v2.0.4 conflicts with minishlink/web-push v6.0.2.
                - askvortsov/flarum-pwa v2.0.4 conflicts with minishlink/web-push v6.0.1.
                - askvortsov/flarum-pwa v2.0.4 conflicts with minishlink/web-push v6.0.0.
                - askvortsov/flarum-pwa is locked to version v2.0.4 and an update of this package was not requested.
                - Root composer.json requires minishlink/web-push ^6.0 -> satisfiable by minishlink/web-push[v6.0.0, v6.0.1, v6.0.2, v6.0.3].
            
            
            Installation failed, reverting ./composer.json and ./composer.lock to their original content
            composer require minishlink/web-push:5.2.5 -W
            Do not run Composer as root/super user! See https://getcomposer.org/root for details
            Continue as root/super user [yes]? 
            ./composer.json has been updated
            Running composer update minishlink/web-push --with-all-dependencies
            Loading composer repositories with package information
            Updating dependencies
            Lock file operations: 13 installs, 1 update, 1 removal
              - Removing psr/http-client (1.0.1)
              - Locking fgrosse/phpasn1 (v2.2.0)
              - Downgrading guzzlehttp/guzzle (7.2.0 => 6.5.5)
              - Locking minishlink/web-push (v5.2.5)
              - Locking paragonie/sodium_compat (v1.14.0)
              - Locking spomky-labs/base64url (v2.0.4)
              - Locking web-token/jwt-core (v1.3.10)
              - Locking web-token/jwt-key-mgmt (v1.3.10)
              - Locking web-token/jwt-signature (v1.3.10)
              - Locking web-token/jwt-signature-algorithm-ecdsa (v1.3.10)
              - Locking web-token/jwt-signature-algorithm-eddsa (v1.3.10)
              - Locking web-token/jwt-signature-algorithm-hmac (v1.3.10)
              - Locking web-token/jwt-signature-algorithm-none (v1.3.10)
              - Locking web-token/jwt-signature-algorithm-rsa (v1.3.10)
              - Locking web-token/jwt-util-ecc (v1.3.10)
            Writing lock file
            Installing dependencies from lock file (including require-dev)
            Package operations: 13 installs, 1 update, 1 removal
              - Removing psr/http-client (1.0.1)
              - Installing fgrosse/phpasn1 (v2.2.0): Extracting archive
              - Downgrading guzzlehttp/guzzle (7.2.0 => 6.5.5): Extracting archive
              - Installing web-token/jwt-signature (v1.3.10): Extracting archive
              - Installing web-token/jwt-signature-algorithm-rsa (v1.3.10): Extracting archive
              - Installing web-token/jwt-signature-algorithm-none (v1.3.10): Extracting archive
              - Installing web-token/jwt-signature-algorithm-hmac (v1.3.10): Extracting archive
              - Installing web-token/jwt-signature-algorithm-eddsa (v1.3.10): Extracting archive
              - Installing web-token/jwt-signature-algorithm-ecdsa (v1.3.10): Extracting archive
              - Installing web-token/jwt-util-ecc (v1.3.10): Extracting archive
              - Installing spomky-labs/base64url (v2.0.4): Extracting archive
              - Installing web-token/jwt-core (v1.3.10): Extracting archive
              - Installing paragonie/sodium_compat (v1.14.0): Extracting archive
              - Installing web-token/jwt-key-mgmt (v1.3.10): Extracting archive
              - Installing minishlink/web-push (v5.2.5): Extracting archive
            6 package suggestions were added by new dependencies, use `composer suggest` to see details.
            Generating autoload files
            110 packages you are using are looking for funding.
            Use the `composer fund` command to find out more!

            so much happy that @askvortsov revived the PWA extension 🙂 Thank you so much. Hope we get more stuffs in the updates.

            Hi folks! I have a doubt about the push notifications:

            Whats the correct way to do it?

            Use only the PWA extension

            OR

            togheter with the Pusher extension??