WordPress.org

Ready to get started?Download WordPress

Forums

Safari Push
[resolved] Safari Push 0.7 doesn't work (20 posts)

  1. Djib's
    Member
    Posted 6 months ago #

    Hi,

    The new version of the plugin does not work.
    Registration works well but I do not receive push.

    I tested on a clean installation of wordpress and a new database.

    I installed the version 0.6.5 over, then it worked well

    http://wordpress.org/plugins/safari-push/

  2. macgamer
    Member
    Plugin Author

    Posted 6 months ago #

    which push wasn't working? Was it when you send a push from the settings page, or automatically when publishing a new post?

  3. Djib's
    Member
    Posted 6 months ago #

    From the settings page.

    I did not try publishing with a new post

  4. macgamer
    Member
    Plugin Author

    Posted 6 months ago #

    was there an error?
    did you try posting to all or just a single device?

  5. Djib's
    Member
    Posted 6 months ago #

    To all !

    But I only have one device registered in this new website

  6. macgamer
    Member
    Plugin Author

    Posted 6 months ago #

    Was there a message below after you clicked the push button?

  7. Djib's
    Member
    Posted 6 months ago #

    No messages !

    and If I try with the direct link, it does not work:

    https://push.yoursite.com/v1/push/?title=Test&body=This%20is%20a%20test&button=View&urlargs=%2F&auth=your_authentication_code

    but I have this message : 0 device(s) notified

    and I not received a push

  8. Djib's
    Member
    Posted 6 months ago #

    For a specific device it's work :

    https://push.yoursite.com/v1/push/TOKEN/?title=Test&body=This%20is%20a%20test&button=View&urlargs=%2F&auth=your_authentication_code

    I have this message : 1 device(s) notified

    and I received a push

  9. macgamer
    Member
    Plugin Author

    Posted 6 months ago #

    i honestly have no idea... The tests you've done are completely sensible. The _only_ difference in the code between the two requests is that the first one does "SELECT * FROM push" and the second does "SELECT * FROM push WHERE token=token".

    In other words, if the second method works, the first one should as well.

    The only thing I can think of is that the first request is somehow incorrectly detecting a token in the URL.

    Can you try temporarily changing the code:

    function send_payload($handle, $deviceToken, $payload) {
    	$apnsMessage = chr(0) . chr(0) . chr(32) . pack('H*', str_replace(' ', '', $deviceToken)) . chr(0) . chr(strlen($payload)) . $payload;
    	return fwrite($handle, $apnsMessage);
    }

    to

    function send_payload($handle, $deviceToken, $payload) {
    	echo $deviceToken."\n";
    	$apnsMessage = chr(0) . chr(0) . chr(32) . pack('H*', str_replace(' ', '', $deviceToken)) . chr(0) . chr(strlen($payload)) . $payload;
    	return fwrite($handle, $apnsMessage);
    }

    and see if that shed any light onto the issue?

  10. Djib's
    Member
    Posted 6 months ago #

    It's not work!

    Message : 0 of 0 device(s) notified

    I have the latest commit anf latest version of plugin (0.7.1)

  11. macgamer
    Member
    Plugin Author

    Posted 6 months ago #

    The issue you have seems to not be related to the plugin. For some reason your push service is saying that there are no records in the push table in your mysql database.

    Do you see a count of registered devices at the bottom of the plugin options page?

  12. Djib's
    Member
    Posted 6 months ago #

    Just after the title "Push Subscribers" at the bottom of the plugin options page, I get this message:

    "Retrieving information ..."

    ---

    The push for all devices work, there is just an error in your link :

    It's :
    https://push.yoursite.com/v1/push?title=Test&body=This%20is%20a%20test&button=View&urlargs=%2F&auth=your_authentication_code

    not :

    https://push.yoursite.com/v1/push/?title=Test&body=This%20is%20a%20test&button=View&urlargs=%2F&auth=your_authentication_code

    No "/" between "push" and "?"

    and i have : 1058 of 1058 device(s) notified

    If I send a push from the plugin, it does not always work (one or all devices)

  13. Djib's
    Member
    Posted 6 months ago #

    when I published an article, push works !

    The problem just happens with the manual push

  14. macgamer
    Member
    Plugin Author

    Posted 6 months ago #

    Hmm, there's no trailing / added by the push request via the plugin that I can see, but what I'll do is try to trap for this in the push service.

  15. macgamer
    Member
    Plugin Author

    Posted 6 months ago #

    try the latest version of the push service.

  16. Djib's
    Member
    Posted 6 months ago #

    It's done!

    It does not work if I send push manually from the plugin settings

  17. macgamer
    Member
    Plugin Author

    Posted 6 months ago #

    Are you using Safari or another browser?

  18. Djib's
    Member
    Posted 6 months ago #

    I use Firefox, but for inscription for the push I use Safari

  19. Djib's
    Member
    Posted 6 months ago #

    Yes Thank You, push manually from the plugin settings works !

    You should specify in the settings it is absolutely necessary to use Safari to send a push manually

    Thank You for your help :-)

  20. macgamer
    Member
    Plugin Author

    Posted 6 months ago #

    This was actually a bug that was causing javascript to throw an error in non-safari browsers, which is fixed in the next release, I just wanted to be sure that was the issue you had.

    Glad it's working now :)

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.