amplify-flutter icon indicating copy to clipboard operation
amplify-flutter copied to clipboard

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

Open ClemPalf opened this issue 1 year ago • 4 comments

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

  • [ ] Analytics
  • [ ] API (REST)
  • [ ] API (GraphQL)
  • [ ] Auth
  • [ ] Authenticator
  • [ ] DataStore
  • [X] Notifications (Push)
  • [ ] Storage

Steps to Reproduce

!

Screenshots

No response

Platforms

  • [X] iOS
  • [X] Android
  • [ ] Web
  • [ ] macOS
  • [ ] Windows
  • [ ] Linux

Flutter Version

3.22.2

Amplify Flutter Version

2.2.0

Deployment Method

AWS CDK

Schema

No response

ClemPalf avatar Jul 20 '24 08:07 ClemPalf

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.

tyllark avatar Jul 23 '24 14:07 tyllark

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,

ClemPalf avatar Jul 24 '24 08:07 ClemPalf

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>

tyllark avatar Jul 25 '24 15:07 tyllark

Thanks for the confirmation!

ClemPalf avatar Jul 25 '24 16:07 ClemPalf