Comments (11)
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.
@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.
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.
@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.
@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.
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.
Just tried running from the command line with
flutter run --release
Still does not work
from amplify-flutter.
@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?
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.
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](https://private-user-images.githubusercontent.com/45041714/331770321-78043834-3d52-443d-87a5-d701af1e4d06.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTcyNTc3NTEsIm5iZiI6MTcxNzI1NzQ1MSwicGF0aCI6Ii80NTA0MTcxNC8zMzE3NzAzMjEtNzgwNDM4MzQtM2Q1Mi00NDNkLTg3YTUtZDcwMWFmMWU0ZDA2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MDElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjAxVDE1NTczMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTFkZjMxZDRlZGQ2YmMxOThhMmI3NmFjOWRkYmVlNTAwNGVmYjc4YTJlYzM1YTJlZDY5NWU0NjExMjMwMTYxYjUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.tsUKTcwUvz0_sFdwSqqTzNyk9uTf8mAVyBYaj3CpbL4)
I also checked in my pinpoint project and that looks like this:
![Screenshot 2024-05-18 at 08 12 30](https://private-user-images.githubusercontent.com/45041714/331770473-5b572789-4377-410e-aa0e-5f3506a18657.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTcyNTc3NTEsIm5iZiI6MTcxNzI1NzQ1MSwicGF0aCI6Ii80NTA0MTcxNC8zMzE3NzA0NzMtNWI1NzI3ODktNDM3Ny00MTBlLWFhMGUtNWYzNTA2YTE4NjU3LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MDElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjAxVDE1NTczMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTNhMjc3MDliMDE5NDkwMTkyNGRiMmYyNDdmNmY2OWNlNTM3YTU0OTA0MTc4NmZhZTc4NTA0MjY0NzUwZGM0ZTcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.5MOtKEjYlzPhnQ1QLtxNZB5EaPF7mQUA73zzm-HUxDo)
Were you not able to reproduce this issue by just creating a basic flutter project with amplify according to the documentation?
from amplify-flutter.
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.
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
- Using this command
- 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)
- Login with email is slow HOT 18
- Amplify Fails to Configure - WorkerBeeExceptionImpl HOT 5
- AmplifyAPI modelProvider not working moving from v1 to v2 HOT 2
- NotAuthorizedServiceException when answering NEW_PASSWORD_REQUIRED challenge HOT 7
- Amplify.Hub.listen never get "ready" HOT 6
- correctClockSkew option HOT 1
- Amplify.API.mutate HOT 9
- Customize title of Authentication with Amplify flutter Authentication UI HOT 3
- Network error when trying to authenticate from a release apk HOT 5
- How to use SyncExpression with GroupPredicate HOT 3
- Gen2 - Quick Start guide does not work - ConfigurationError: The provided configuration is not a valid json HOT 3
- Build failed with an exception
- Error message is unclear when oauth is missing from config HOT 3
- [iOS] building with debug flag makes the app crash HOT 4
- aws_signature_v4 - flutter and aws lex bot integration HOT 3
- Data not updated by API GraphQL HOT 3
- Feature Request: GraphQL query with sorting by date with secondary index HOT 7
- DataStore initial sync slower after recreating auth and schema has owner-based permissions HOT 6
- amplify_auth_cognito:compileDebugJavaWithJavac HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from amplify-flutter.