简体   繁体   中英

How to debug Flutter notifications opening on iOS > 14

Since iOS 14.0 Flutter apps can't be relaunched in debug mode .

So how do you get some logs while implementing firebase_messaging methods?

Running flutter run --release hides the logs from the terminal. So how do you do?

So I got one slow way:

  1. Run the app with flutter run --release
  2. Check that some logs are showing in macOS console app (filter logs with 'Flutter', 'Runner' or any strings you want)
  3. Then close the app, receive the notification
  4. Logs appear

With this solution you can't hot-reload the app, you have to rebuild it. Mine takes 3mn to test. Not optimal but at least I've got some logs.

You can try

flutter run -d 'device_id' --profile

This will run your app in profile mode which is similar to release mode and provides logs in console as well.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM