aws-amplify / amplify-flutter

A declarative library with an easy-to-use interface for building Flutter applications on AWS.
https://docs.amplify.aws
Apache License 2.0
1.31k stars 242 forks source link

Notifications from Pinpoint campaigns with the "local time" option are not sent. #5185

Open ClemPalf opened 1 month ago

ClemPalf commented 1 month ago

Description

I have been experimenting with segments and campaigns in my Pinpoint project to send notifications to my flutter app.

Every time I tried to select the option "Local time", I never receive the notifications (be it with the option "Immediatly", "Once" or any cyclic options).

In the Pinpoint documentation, I found this: image Using the cli get-user-endpoints command, I noticed that my user endpoints are formatted like so : "Demographic": { "AppVersion": "0.5.9", "Locale": "fr_FR", "Model": "iPhone", "Platform": "ios", "PlatformVersion": "17.5.1" },

Is there a problem in the way you register endpoints (not including the required Timezone attribute)? Or did I make a mistake identifying my user :

` try {

  await Amplify.Analytics.identifyUser(
    userId: userId,
    userProfile: userProfile,
  );

  await Amplify.Notifications.Push.identifyUser(
    userId: userId,
    userProfile: userProfile,
  );
}`

Kind regards,

Categories

Steps to Reproduce

!

Screenshots

No response

Platforms

Flutter Version

3.22.2

Amplify Flutter Version

2.2.0

Deployment Method

AWS CDK

Schema

No response

tyllark commented 1 month ago

Hello @ClemPalf thank you for taking the time to submit this issue. Currently Flutter Amplify does not support registering endpoints with Demographic.Timezone. I have marked this issue as a feature request and we will get back to you when we have any updates.

ClemPalf commented 1 month ago

Thanks for the answer @tyllark.

In the meantime, may I ask : Is the double identification of my users necessary?

  await Amplify.Analytics.identifyUser(
    userId: userId,
    userProfile: userProfile,
  );

  await Amplify.Notifications.Push.identifyUser(
    userId: userId,
    userProfile: userProfile,
  );

It seems redundant, and I think push notifications were working fine without Amplify.Notifications.Push.identifyUser when I ran my first tests.

Regards,

tyllark commented 1 month ago

Hello @ClemPalf these calls are redundant, so you can remove one if you like. They exist because an Amplify project might only use Amplify Analytics or Amplify Push Notifications, but the developer needs to be able to update their Pinpoint endpoints in both cases. You can verify they are updating the same Pinpoint endpoint via the aws cli command you mentioned earlier.

aws pinpoint get-user-endpoints --application-id <AppId> --user-id <UserId>
ClemPalf commented 1 month ago

Thanks for the confirmation!