Delite Studio
Five-star iPhone, iPad, Android, and OS X apps
  • Home
  • WordPress
    • Push Notifications for WordPress
      • Documentazione
      • FAQ
      • Libreria per iOS
      • Libreria per Android
  • App
    • Picture Transfer
    • Local Cloud
      • Per iOS
      • Per Android
    • File Storage
    • File Transfer
      • Per iOS
      • Per Mac
      • Per Android
      • Per Windows
    • File Extractor
    • Localizable Strings Merge
    • Delite Blocks
    • Push>
  • Info
  • Contattaci
  • Account
    • Carrello
  • Italiano
    • English
Select Page ...

FAQs

← Back to Push Notifications for WordPress

Answers to some common questions about Push Notifications for WordPress.

General

Does Push Notifications for WordPress supports the HTTP/2‑based Apple Push Notification service?
Yes, starting from version 5.1 Push Notifications for WordPress supports HTTP/2-based Apple Push Notification service (APNs).

Please make sure your server supports the following requirements:

  • PHP >= 7.2
  • lib-curl >= 7.46.0 (with HTTP/2 support enabled)
  • lib-openssl >= 1.0.2e
  • PHP's cURL and GMP support

Ubuntu 20.04 meets all of these requirements.

How is this plugin different from other push notifications plugins?
Other plugins use third-party server's that send notifications for a fee. This plugin has a built in hub, allowing WordPress to send out the push notifications directly. For free.
Can I see Push Notifications for WordPress in action?
Of course: we have created a couple of videos that demonstrates how it works.

For Web Push notifications:

For mobile notifications:

Who is this plugin for?
Push Notifications for WordPress is primarily intended for mobile developers who do not want to develop their server-side back-end. Supporting push notifications is incredibly complicated. This plugin lets you focus on creating the apps, without the hassle.

Oh, and if you use only Safari and Web Push (Chrome, Firefox, Edge, Opera and others) notifications, you do not need to create the apps! When visiting a site that supports notifications, the user will receive a prompt asking you if he would like to turn them on.

The Web Push notifications also work on Android, even if the browser isn't currently active--just like an installed native app. That's a big deal!

What are the system requirements for Push Notifications for WordPress?
Push Notifications for WordPress requires:

  • WordPress 5.0 or later with "pretty" permalinks.
  • PHP 5.3 or later (PHP 7.2 for iOS, Safari and Web Push notifications).
  • PHP's cURL and GMP support (for Web Push notifications).
  • PHP's cURL with HTTP/2 support enabled (for iOS and Safari notifications)
  • An app (for iOS and Android notifications).

Moreover, to activate Safari and Web Push notifications on your multisite, we strongly recommend it uses sub-domains instead of sub-directories (i.e. https://site1.yournetwork.com instead of https://yournetwork.com/site1).

More requirements for Safari and Web Push notifications here.

Do I need to be an Apple developer to send notifications?
If you want to send iOS and/or Safari notifications: yes. In this case you need a push notification token, which requires the Apple Developer Program membership.
Does it support Firebase Cloud Messaging (FCM)?
Yes. Starting from version 3.0, for Android notifications it supports the Firebase Cloud Messaging (FCM) who has taken the place of Google Cloud Messaging (GCM). To upgrade from GCM to FCM please see the official migration guide.
You are selling on Code Canyon a plugin called Push Notifications for Posts. What’s the difference?
Push Notification for Posts has been discontinued on February 2016 in order to focus entirely on Push Notifications for WordPress. If you purchased Push Notification for Posts contact us to get a discount.
How can I build the apps?
Building an app is difficult and you need to be a developer. But... if you use only Safari, Web Push (Chrome, Firefox, Edge, Opera and others) and Telegram notifications, you do not need to create the apps!
Can I send a test notification to a specific device?
You can test a push notification through the Tokens page:

Test Push Notification

Does it work with W3 Total Cache?
Yes, but it requires a great deal of caution.

Two things in particular:

  1. In Performance → Page cache → Rejected user agents you have to add the user agent of your app so that it is never sent a cached copy:

Push Notifications for WordPress and W3 Total Cach

  1. In Performance → Database cache → Never cache the following pages you have to add /pnfw/* and push_sw.js
Does it work with WP Super Cache?
Yes, but it requires a great deal of caution.

Two things in particular:

  1. In Advanced → Rejected User Agents you have to add the user agent of your app so that it is never sent a cached copy.
  2. In Advanced → Add here strings (not a filename) that forces a page not to be cached you have to add /pnfw/ and push_sw.js
Does it work with WPML?
Yes, it supports WPML.
Does it work with Polylang?
No. Polylang mimics the WPML behavior, but without fully replacing it. This causes compatibility problems with Push Notifications for WordPress.
Does it work with nginx?
Yes, it supports nginx but you must add these lines in the virtual host configuration file to support rewrite rules:

server {
	[...]
	location / {
		try_files $uri $uri/ /index.php?$args;
	}
	[...]
}
What send rate can I expect?
The maximum send rate depends on many conditions, especially the performance of your server and the operating system to which you are sending notifications. We strongly suggest to use PHP 7.2+ for better results.

To give you an idea, with a basic VPS hosting and older PHP versions you can expect:

  • iOS: 15/20 notifications per second
  • Android: 20/25 notifications per second
  • Safari: 15/20 notifications per second
  • Web Push: 20/25 notifications per second

Of course, you can get better performances with higher level servers and PHP 7.2+.

Desktop Notifications

Does it support desktop notifications?
Yes. It supports Safari push notifications on macOS to send notifications to your website users, right on their Mac desktop--even when Safari isn’t running. And it supports Web Push (Chrome, Firefox, Edge, Opera and others) notifications.

Safari and Web Push notifications work just like push notifications for apps, but you don't need to build an app (see requirements below).

What are the requirements for Safari push notifications?
Safari push notifications require:

  • An Apple Developer Program account (info here).
  • A website under HTTPS protocol.
  • PHP 7.2 or greater.
  • lib-curl >= 7.46.0 (with HTTP/2 support enabled).
  • lib-openssl >= 1.0.2e.

HTTPS is obligatory for serving the push package. You do not need to spend a fortune for the SSL certificate--there are some cheap options available. For example, Namecheap offers domain-level SSL certificates starting from $9.00/yr. Please note a dedicated IP is also highly recommended.

Beyond the Safari notifications going HTTPS is a good thing: Google has announced that it will give you a ranking boost (more info here).

Who can receive Safari push notifications?
macOS 10.9 Mavericks and later and Safari 7 and later users.

Please note all Safari users will be anonymous (info here).

What is the reliability of the Safari notifications?
The underlying Safari Push Notifications service on Apple’s end has some bugs on older macOS. The bug has been reported to Apple, and appears to be confirmed by a few sources. With macOS High Sierra the main problems have been fixed.

To enable logging on macOS, as reported in the Technical Note TN2265, use the following commands:

$ sudo defaults write /Library/Preferences/com.apple.apsd APSWriteLogs -bool TRUE
$ sudo defaults write /Library/Preferences/com.apple.apsd APSLogLevel -int 7
$ sudo killall apsd

The logs are stored in /Library/Logs/apsd.log.

What are the requirements for Web Push notifications?
Web Push (Chrome, Firefox, Edge, Opera and others) notifications require:

  • PHP 7.2 or greater with GMP extension.
  • A website under HTTPS protocol.

Service workers require secure origins to ensure that the service worker script is from the intended origin and hasn’t come about from a man-in-the-middle attack. That means using HTTPS on live sites. You do not need to spend a fortune for the SSL certificate--there are some cheap options available. For example, Namecheap offers domain-level SSL certificates starting from $9.00/yr. Please note a dedicated IP is also highly recommended.

Beyond the Web Push notifications going HTTPS is a good thing: Google has announced that it will give you a ranking boost (more info here).

Who can receive Web Push notifications?
Users with:

  • Chrome 50 and later.
  • Firefox 46 and later.
  • Edge from Windows 10 April 2018 Update and later.
  • Opera mobile version 37 and later, desktop version 42 and later.

Please note all Web Push users will be anonymous (info here).

What are the limitations of Web Push notifications?
Web Push notifications, unlike Safari notification, are only delivered when the browser is running. If your browser isn't running, notifications will be received when it is opened the first time. The only exception is Android: in such a case they are received and displayed even if the browser isn't currently active--just like an installed native app.

Moreover, web push notifications are not supported in private browsing mode.

Licensing

My subscription has expired, can I still use Push Notifications for WordPress?
Yes. After the expiration date your plugin will continue to work but you won't have access to updates and support.

Please note you can only download Push Notifications for WordPress if you have an active subscription. Hence, please download your updates as they come out.

Troubleshooting

Why am I getting the error Sorry, this file type is not permitted for security reasons while uploading the P12 file?
WordPress 5.0.1 changed the MIME type verification for uploaded files. As a temporary workaround you can use this plugin.
When I send a test notifications everything works properly, while when I publish a post nothing is sent. What should I do?
If you've already checked that all settings are correct, it could be a hosting or WordPress configuration problem.

In short, to send in the background push notifications, we use the WordPress standard function wp_schedule_single_event(). We have verified that it does not work properly if:

  • Your hosting is blocking the call to fsockopen(). WordPress uses the fsockopen PHP function to make a request to the wp-cron.php file that's located in the WordPress installation directory.
  • You are using CloudFlare or a caching plugin which does not trigger the WP Cron.
  • Your server is unable to resolve itself.

Our advice is to contact your hosting provider.

To debug, you can force to run a cron job by launching:

$ wget --delete-after http://yourwebsite/wp-cron.php

or

$ wget --delete-after http://yourwebsite/wp-cron.php?doing_wp_cron

We also recommend you to install a plugin like WP Crontrol. Then go to the Tools → Cron Events menu and search for the event pnfw_send_notifications_for_post_in_background. If it is present it's a warning: it means that WP Cron is not configured correctly and has not been able to to consume the event properly. Click on the button Run Now and see what happens.

Why am I getting the error FCM didn't return a 200 or 503 status?
Your server is unable to connect to the FCM (Firebase Cloud Messaging).

This can be caused by:

  • The fact that cURL is not installed on your server.
  • The fact that Push Notifications for WordPress can't reach the URL https://fcm.googleapis.com/fcm/send.
  • The fact that cURL is unable to verify the certificate provided by the server. You should properly add the root CA in the CA store directory of your machine.

You can do a simple test by launching this command on your server:

curl --header "Authorization: key=xxx" --header Content-Type:"application/json" https://fcm.googleapis.com/fcm/send -d "{\"registration_ids\":[\"ABC\"]}"

Please change xxx with your Google API Key.

Why sometimes, when I send the notifications, two or more are sent to each user?
This is due to the current WP Cron implementation which is not exactly rock solid. We suggest to use a real cron (here is an example, but use something like 5 minutes instead of 30 minutes).
While sending notifications they are sent only to a subset of all the tokens. What should I do?
Notifications are sent in a background process. It is possible that if there are many to send the process is killed by PHP or Apache. Our advice is to contact your hosting provider.

If you are using Apache with mod_fcgid, likely the FcgidIOTimeout is too low (the default timeout for FastCGI scripts is 45 seconds).

If you are using a VPS with WHM installed you can change it in this way:

  1. Login to WHM → Apache Configuration → Include Editor → Post VirtualHost Include → All
  2. Copy and paste following code:<IfModule mod_fcgid.c>
    FcgidIOTimeout 360
    </IfModule>
  3. Restart Apache.
Even after several hours, the "Sending notifications..." progress bar does not disappear. What should I do?
This condition occurs when the process which sends notification was prematurely interrupted (see question above). To solve it go to Push Notifications → Settings, select the tab Misc box and press the button Fix progress bar.
Why am I getting the error 401 Unauthorized : "oauth_consumer_key parameter is missing"?
You have enabled OAuth, but you're not passing the required parameters. You can solve in two ways:

  1. By disabling OAuth under Push Notifications → OAuth.
  2. By passing the required parameters (info here).

Please note: if you just did a migration of your site to HTTPS, you should accept signed requests for both HTTP and HTTPS. Go to: Push Notifications → OAuth, and enable "Accept both HTTP and HTTPS requests".

When I call an API the server returns 401 Invalid HTTP method. What should I do?
As outlined in the documentation some APIs must be called using the POST HTTP method (e.g. the Register API) and other using the GET HTTP method (e.g. the Posts API list). More info here.

If you are sure you have used the correct HTTP method be sure to check the settings of your web server. In particular, some users have reported that nginx has different URL mapping rules than Apache (see above).

You can debug with cURL using this command:

$ curl https://yourwebsite.com/pnfw/register/ -i --data "os=Android&token=aa"

Strange things happen. The same token appears more than once in the Tokens page, APIs return errors, and so on. What should I do?
You've probably installed W3 Total Cache. Read our notes above.
The badge count on iOS is not correct. What should I do?
The badge indicates the number of notifications that have not been read by that user. The badge count must be aligned both on the server- and client-side.

Server-side, you can set a post as read using the Posts API (details): "When this API is called, the post is considered "read" by this specific device token–and consequently by the corresponding user. Therefore, the statistics and the badge on iOS are updated."

Client-side, when a user read a post it's up to you to decrease it using the UIApplication's applicationIconBadgeNumber property.

I'm using WPML. When I activate a custom post type or taxonomy I do not see it in the app. What should I do?
When WPML is active, active custom post types and taxonomies must be set as translatable in WPML → Translation options.
Push Notifications for WordPress does not work properly on my multisite. What should I do?
Probably you've made the network activation of Push Notifications for WordPress. This is not the proper way to activate it. You should activate Push Notifications for WordPress for each individual subsite.

In general, if a plugin says network activate then do so. If it does not, then don't.

Why am I getting a Web page when connecting to the http://yoursite/pnfw/register/?
You are using the default WordPress permalink structure. Change the WordPress permalink structure (Settings → Permalinks) from "default" to one of the so-called "pretty" permalinks.
I have other issues with sending push notifications. What should I do?
We suggest you to carefully read the log on the Debug plugin page (Push Notifications → Debug). Notifications are sent asynchronously: the Debug page gather in one place all the information and errors you might find useful. Check it frequently.
I have other issues with sending iOS push notifications. What should I do?
We suggest you to read the Apple's Technical Note TN2265.
Why is the timestamp shown in the Debug page incorrect?
If the timestamp displayed in the Debug page is incorrect, the time, or timezone, or daylight savings time configured on your website is most likely incorrect.

To fix this, follow these steps:

  • Log in to your WordPress site as an administrator.
  • Go to Settings → General.
  • Change the timezone dropdown to a city that’s in your timezone.
  • Click the Save Changes button at the bottom of the screen.
When I enter the license and click on Save Changes the page simply reloads with nothing changed. What should I do?
To fix this, follow these steps:

  • Log in to your WordPress site as an administrator.
  • Go to Plugins → Installed Plugins.
  • Press on Deactivate under Push Notifications for WordPress.
  • Press on Activate under Push Notifications for WordPress.
  • Reenter the license data under Push Notifications → License.
My Android application is closed and I cannot receive notifications. What should I do?
Your application may be in Forced Stop state. To fix this, follow these steps:

  • Open the Settings app.
  • Choose Apps (on some Samsung phones, touch the General tab atop the Settings app screen, and then choose the Application Manager item).
  • Choose the app that’s causing problems.
  • Make sure the Force Stop button is not grayed out. If it's the case open your application almost once to exit this state.

Please note that some security applications try to force stop state at startup so you have to whitelist them.
If you develop with Android Studio you must be warned that running applications with debugger leaves them in a forced stop state.

When I send a notification from Firebase console everything works properly, while when I send them from the plugin nothing is received. What should I do?
Firebase uses Notification messages when our plugin uses Data messages.

With the Notification message Firebase automatically displays the message to end-user devices on behalf of the client app. With the Data message client app is responsible for processing data messages.

More info in the official FCM documentation.

You can enable Notification messages in the Settings → Android → Firebase enabling Use the Notification message instead of the Data message

Migration

Can I migrate from Push Notification for WordPress (Lite) to Push Notification for WordPress?
Yes. We have tried to make the process very simple.

Follow these steps:

  1. Make sure the setting "Remove data on uninstall" is unchecked.
  2. Upload Push Notification for WordPress without activating it.
  3. Disable Push Notification for WordPress (Lite).
  4. Activate Push Notification for WordPress.
  5. Uninstall Push Notification for Posts (Lite).

That's all! Enjoy all the advanced features of Push Notification for WordPress!

Can I migrate from Push Notification for Posts to Push Notification for WordPress?
Yes. We have tried to make the process very simple. And yes, if you have a license of Push Notification for Posts, you can get a discount on Push Notification for WordPress.

Follow these steps:

  1. Backup your WordPress database as explained here.
  2. Upgrade Push Notification for Posts to version 2.0 or later without uninstalling previous version (very important: previous versions, when uninstalled, would remove all subscribers and tokens).
  3. Make sure the setting "Remove data on uninstall" is unchecked.
  4. Upload Push Notification for WordPress without activating it.
  5. Disable Push Notification for Posts.
  6. Activate Push Notification for WordPress.
  7. Uninstall Push Notification for Posts.

That's all! Enjoy all the advanced features of Push Notification for WordPress!

How can I migrate the tokens from one site to another?
Our advice is to use the plugins Duplicator/Duplicator Pro. If you need to move WordPress, these plugins greatly simplifies the process. We do not support any other method to move the tokens automatically.

The following are some ideas to proceed in a different way, but the implementation is left to you (our team does not offer support):

  1. Go to the Push Notifications → Tokens and click on the Export CSV button. This will download a file with all the tokens plus some information about each of them.
  2. For each of these tokens, make a cURL call like this:
$ curl https://yoursite/pnfw/register/ --data "os=xxx&token=yyy&lang=zzz"

Note that in this way a new user for each token will be created, thus losing its past history.

Other

I have a blog with a lot of traffic. How can I optimize the notifications?
Large blogs require special attention. Sending tens of thousands of notifications and the corresponding volume of visitors will put pressure on your hosting.

Here are some tips:

  1. Make sure that Push Notifications for WordPress is updated to the latest version.
  2. Speed up the APIs as shown in the next FAQ.
  3. Replace the WordPress Cron with a real cron job (tutorial).
  4. Reduce the size of some tables that may have grown too much. First, make a backup copy of the tables wp_push_sent, wp_push_viewed, and wp_push_logs. Then run these SQL commands:

    TRUNCATE TABLE wp_push_sent;
    TRUNCATE TABLE wp_push_viewed;
    TRUNCATE TABLE wp_push_logs;

    OPTIMIZE TABLE wp_push_sent;
    OPTIMIZE TABLE wp_push_viewed;
    OPTIMIZE TABLE wp_push_logs;

    Please note: in your case the prefix wp_ could be different.

  5. Consider moving to a more performing hosting.

In general our advice is not to send too many notifications a day. If you send many notifications a day, the previous ones may not be finished, and therefore overlap, causing a double (or triple) load on the server!

The APIs are slow, how can I make them faster?
With the current architecture of WordPress, when an API is called, every single active plugin on your site is loaded into the request. This obviously creates a significant overhead which is amplified when you enable Chrome and Firefox notifications without payload.

Luckily there are some great solutions, such as the one described here. Please remember to whitelist:

  1. Push Notifications for WordPress.
  2. Its add-ons (App Only Post Type, Merge Push Notifications) you are eventually using.
  3. WPML.
  4. The plugins of which your are using the shortcodes.
  5. The plugins you have developed that implement its hooks.
Can you build the apps for me?
Yes. We're a team of mobile developers. We put our expertise to work on custom projects for companies that need great apps. Interested? Contact us.

Support

Still have questions?
Let us know, we will do everything to help you. Contact us →
  • Push Notifications for WordPress

    • Documentation
    • FAQs
    • What are the differences between Push Notifications for WordPress and Push Notifications for WordPress (LITE)?
    • Features
    • Changelog
    • Configuring iOS Push Notifications
    • Configuring Android Push Notifications
    • Configuring Safari Push Notifications
    • Configuring Web Push Notifications
    • Configuring Telegram Bot
    • Push Notifications library for iOS
    • Push Notifications library for Android
    • Local Cloud per iOS

      Local Cloud per iOS
      iPad / iPhone / Mac / Windows
      Picture Transfer per iOS

      Picture Transfer per iOS
      iPad / iPhone / Mac / Windows
      File Transfer per Mac

      File Transfer per Mac
      Mac
    Delite Studio S.r.l. © 2011 - 2019. All Rights Reserved. — P. IVA e Cod. Fisc. IT03402240042 — Privacy Policy
    Su questo sito usiamo i cookie, anche di terze parti, per offrirti il miglior servizio possibile. Se prosegui nella navigazione acconsenti all’utilizzo dei cookie.OkMore info