ConnectyCube / connectycube-reactnative-samples

Chat and Video Chat code samples for React Native, ConnectyCube
https://connectycube.com
Apache License 2.0
124 stars 111 forks source link

Error: No one can receive the message #189

Closed stephanoparaskeva closed 2 years ago

stephanoparaskeva commented 3 years ago

When providing 'date' in push notifications I get the error:

With below code:

// CAUSES ERROR
    const payload = JSON.stringify({ message: 'HIII', ios_badge: 1 });
    const pushParameters = {
      date: 100,
      event_type: 'fixed_data',
      notification_type: 'push',
      user: { ids: [recipient.cubeId] }, // recipients.
      environment: __DEV__ ? 'development' : 'production',
      message: ConnectyCube.pushnotifications.base64Encode(payload),
    };
    try {
      const push = await ConnectyCube.pushnotifications.events.create(pushParameters);
      console.warn(push);
    } catch (err) {
      logError('pushnotifications')(err);
    }

But I do not get any error when 'date' is not provided:


// NO ERROR
 const payload = JSON.stringify({ message: 'HIII', ios_badge: 1 });
 const pushParameters = {
      notification_type: 'push',
      user: { ids: [recipient.cubeId] }, // recipients.
      environment: __DEV__ ? 'development' : 'production',
      message: ConnectyCube.pushnotifications.base64Encode(payload),
    };
    try {
      const push = await ConnectyCube.pushnotifications.events.create(pushParameters);
      console.warn(push);
    } catch (err) {
      logError('pushnotifications')(err);
    }

image

DaveLomber commented 3 years ago

The date param is when the scheduled notifications should be sent on. If the 'event type'=='fixed_date', the date can not be in the past.

Timestamp, in seconds

So simply set to to future date, not the past

ccvlad commented 2 years ago

Closed due to inactivity. Please create a new issue if needed.