setMyPushTriggerOption is not immediately updated at some group channel

I try to call setMyPushTriggerOption for ON/OFF user’s push options.

  • After calling setMyPushTriggerOption, it looks push_trigger_options updated well. The issue is channel’s myPushTriggerOption is not updated immediately
  • It updated immediately at isPublic:true group channel,
  • But not updated immediately if that group channel is isPublic:false.
  • The only figured difference is isPublic value.

Is there any differences or needed options to update myPushTriggerOption immediately? Or there’s something I could not checked?

Hi,

Thank you for posting your question in the community.

Can you please elaborate more on ‘channel’s myPushTriggerOption is not updated immediately’?
Are you receiving push for the user after you set the push trigger option to ‘off’ or not getting any push notifications after you set it to ‘all’ or default?

Can you also please share the code where you are updating the push trigger options? It might be helpful in trying to reproduce this on our end.

Thanks for your reply!
Here are more elaborate descriptions.

  1. The event handler code where user is updating the push trigger options
  const handleValueChangePush = async value => {
    const changedOption = value ? PUSH_TRIGGER_OPTIONS.DEFAULT : PUSH_TRIGGER_OPTIONS.OFF;
    setIsPushOn(value);
    setChannelInfo({ ...channelInfo, myPushTriggerOption: changedOption });
    await **channel.setMyPushTriggerOption(changedOption)**;
  };
  1. And after set the options to “off”, user cannot received the notification (works well)

  2. But after refetch the channel object using createMyGroupChannelListQuery() that channel’s myPushTriggerOption gives "default" value. Only if isPublic:true group channel.

Hope this answers are helpful for reporting.
Thanks :slight_smile:

1 Like

Thank you for the provided information.

I tested this and I see what might be the issue here. You will have to fetch again the list of channels by running createMyGroupChannelListQuery after you have set the push preferences for a user.

For example:

await handleValueChangePush(value)
await updateChannelList() // call createMyGroupChannelListQuery again inside here
1 Like