Coder Social home page Coder Social logo

Comments (5)

norkunas avatar norkunas commented on August 17, 2024

Hello,

Why do you want to provide the past date?

from onesignal-php-api.

devfelipereis avatar devfelipereis commented on August 17, 2024

But it's not in the past. I was sending at "2016-02-23 15:43:26" to the date "2016-02-23 16:00:00"(17 minutes later).

from onesignal-php-api.

norkunas avatar norkunas commented on August 17, 2024

@devfelipereis i've tested send_after option currently and for me it is working as intended, but with a little delay because of my time (which was March 24th 2016, 3:56:46 pm UTC +02:00) and onesignal server time difference.

$api->notifications->add([
    'included_segments' => array('..'),
    'data' => array('foo' => 'bar'),
    'contents' => ['en'=>'testing send after issue'],
    'send_after' => new \DateTime('1 minute'),
]);

Scheduled

And after that time:
Completed

from onesignal-php-api.

jonasof avatar jonasof commented on August 17, 2024

Same problem here, the problem is with timezones:

//in Notifications.php, line 268, $value is a Carbon\Carbon variable:
$value->format('D M d Y H:i:s eO (T)'); 
// returns: "Tue Jun 21 2016 14:02:01 America/Sao_Paulo-0300 (BRT)"

OneSignal seems to not understand the "America/Sao_Paulo-0300 (BRT)", so firstly convert the carbon timezone to GMT:

'send_after' => $carbon_variable->setTimezone('GMT'),

This should send the message in the right time.

from onesignal-php-api.

norkunas avatar norkunas commented on August 17, 2024

Then I could add a note that the date timezone should be converted to GMT or UTC if this would help.

from onesignal-php-api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.