Git Product home page Git Product logo

Comments (11)

Niklas-Sommer avatar Niklas-Sommer commented on June 18, 2024 1

Well that was a quick fix :D Thanks a lot for the help! It would be great if this was mentioned in the documentation though!

from amplify-flutter.

NikaHsn avatar NikaHsn commented on June 18, 2024

@Niklas-Sommer thanks for taking the time to raise this issue. Amplify will decide the appropriate channel based on the application's compiled environment and if it is running on debug mode it registers the endpoint as APNs Sandbox . While we investigate, could you please verify whether the release app is running in debug mode using zDebugMode similar to the code snippet below:

if (zDebugMode) {
  print('running on debug mode');
}

from amplify-flutter.

Niklas-Sommer avatar Niklas-Sommer commented on June 18, 2024

I did test that and it is indeed running in release mode. As stated above it even gets registered in pinpoint as an APNs endpoint but I still only receive push notifications when I send it to the APNs Sandbox channel. That's the error I get when sending a test message with the pinpoint console to the the APNs channel:

Request Id 68 : [<DEVICE_TOKEN>: PERMANENT_FAILURE {"errorMessage":"Unregistered or expired token","channelType":"APNS","pushProviderStatusCode":"400","pushProviderError":"BadDeviceToken","pushProviderResponse":"{"reason":"BadDeviceToken"}"}]

from amplify-flutter.

NikaHsn avatar NikaHsn commented on June 18, 2024

@Niklas-Sommer thank you for providing these details. we will look into this issue and get back to you with any updates.

from amplify-flutter.

NikaHsn avatar NikaHsn commented on June 18, 2024

@Niklas-Sommer when running flutter run command do you use any command line options such as --dart-define to set environment valriables?

from amplify-flutter.

Niklas-Sommer avatar Niklas-Sommer commented on June 18, 2024

I am launching my flutter project from VS Code in release mode so I didn't specify any. Not sure which arguments vs code passes when launching.

from amplify-flutter.

Niklas-Sommer avatar Niklas-Sommer commented on June 18, 2024

Just tried running from the command line with

flutter run --release

Still does not work

from amplify-flutter.

NikaHsn avatar NikaHsn commented on June 18, 2024

@Niklas-Sommer sending notifications directly through the Pinpoint console to both APNS and APNS_SANDBOX channels with tokens and only APNS_SANDBOX is successfully delivered indicates that the device token received from APNs is for the sandbox environment.
Would you please verify that the APNS SSL certificate is for Sandbox & Production?
image (5)
If the certificate is for Sandbox only then you may need to generate a certificate for Sandbox and Production and update the Pinpoint project to use the new certificate.

from amplify-flutter.

Niklas-Sommer avatar Niklas-Sommer commented on June 18, 2024

I am not quite sure where on apple developer you navigated to find what is shown on your screenshot but I checked
AppleDeveloper->Identifiers->MYAPP->Push Notifications->Edit
and can see that I have a production SSL certificate. No development certificate.

Screenshot 2024-05-18 at 08 08 16

I also checked in my pinpoint project and that looks like this:

Screenshot 2024-05-18 at 08 12 30

Were you not able to reproduce this issue by just creating a basic flutter project with amplify according to the documentation?

from amplify-flutter.

Equartey avatar Equartey commented on June 18, 2024

Hi @Niklas-Sommer, I've been able to reproduce this on a fresh Amplify Flutter app.

I'm still investigating the root cause, but wanted to update you in the meantime.

I'll provide more information when I have it.

from amplify-flutter.

Equartey avatar Equartey commented on June 18, 2024

Hi @Niklas-Sommer, it appears running the app with the release flag is not sufficient for iOS to setup the correct production environment. I was able to successfully receive a APNs (non-sandbox) push notification through both of these methods:

  • Build the Flutter iOS via .ipa,
    • Using this command flutter build ipa --release --export-method ad-hoc
    • Plug in your physical device and drag & drop the .ipa file onto the device
    • Here is a relevant stack overflow
  • Test App via TestFlight

For both scenarios ensure you don't have a pre-existing version of the app already installed. And ensure you have a method of retrieving the device id.

Note: when the app is built this way APNs Sandbox push notifications will throw a similar error to what you were getting before.

Let us know if this resolves the issue for you or if you have additional questions.

from amplify-flutter.

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.