Thread Starter
WPChina
(@wordpresschina)
I do see this thread:
https://ww.wp.xz.cn/support/topic/there-has-been-an-error-with-the-api-date_not_recent/
And I double-checked and my server and PHP times are aligned and working fine.
Unfortunately if you’re seeing that error, something has to be out of alignment. The current time is added to the signature for the request and if it’s off, even slightly, the request will fail. This is entirely out of the hands of the plugin and has to do with the handshake between your server and the Apple News API.
Even if your server time is off by a minute, it would create an invalid signature on the request. I would double check this and if you’re still experiencing the error, you’ll have to follow up directly with Apple News support. This is unfortunately out of the hands of the plugin.
Specifically, the date needs to be within 5 minutes of the server time at Apple News, and we’re calculating the date via date( 'c' ). I’d recommend following up with your hosting provider to synchronize the server time with an atomic clock (e.g., time.nist.gov).
Thread Starter
WPChina
(@wordpresschina)
Yes I control our box and both server and PHP are set to nist, so accurate within a few seconds. However, we offset to our local +X GMT. Could the offset be the problem? If so, that’s tough to change as the offset is important for many other server-side functions.
Just to be clear, this isn’t a function of the plugin but how the Apple News API itself works. You’ll need to ensure that your requests are being signed with the correct local time that matches what the API is expecting for this to work.
More info is here: https://developer.apple.com/library/content/documentation/General/Conceptual/News_API_Ref/Security.html#//apple_ref/doc/uid/TP40015409-CH5-SW1