In this guide, I try to help you contribute feature requests, bug reports, bug fixes and features to this project. Take a look at useful tips to help you investigate or learn the package a bit better.
I may create templates for these in the future.
Please create an issue describing what features you want. If you have any idea on the implementation, that would be helpful.
Please provide as much information as possible. For example, the state of the application when the push notification is received.
You can also contribute bug fixes yourself, by forking this repo on GitHub, and opening a pull request. I will try to take a look, and keep an eye on GitHub notifications.
You can give also contribute feature implementations to the project. If the feature is relatively large or complex, discussing it in a GitHub issue can help you think through the feature and contribute higher quality code.
iOS and Android have different structures for push notifications. Android's RemoteMessage has a lot more metadata than iOS's userInfo dictionary.
To add more types this package's RemoteMessage type, you need to do 2 things:
- Add more fields to the data type in
pigeons/push_api.dart
- Fill this field on the platform side:
- On Android, in
Serialization.kt
, extract more ofRemoteMessage
into theMap
. Make sure that the keys you use for the map correspond to the fields in RemoteMessage.
- On Android, in
Pigeon is used to generate code which serializes and deserializes data, including method calls and types between Flutter and the Host.
- Implementation of methods called from the other side are called
PushXHandlers
, for examplePushHostHandlers
andPushFlutterHandlers
. - Instances used to call methods on the other side of the serialization barrier have been called:
PushXApi
, for examplePushHostApi
andPushFlutterApi
.
To (re)generate pigeon files:
- Run
cd push_platform_interface
- Run
dart run pigeon --input pigeons/push_api.dart
- When re-generating Pigeon code, it might break. I made 1 small adjustment to the generated code to fix the issue reported in flutter/flutter#101515
- Generate code:
dart run pigeon --input pigeons/push_api.dart
- To publish, run
flutter pub publish
in specific folders (and all other packages that depend on it, starting with the leaf packages that have no dependencies)
- Nice logs in command line:
pidcat com.example.app
- Check if app process is runnning
watch -n 1 'adb -s emulator-5554 shell ps -A | grep push'
- Even pressing down on app icon (launching popup menu) launches the app
- Kill an application process: put the app in the background, then run
adb shell am kill uk.orth.push.example
- Take screenshot with scrcpy:
adb exec-out screencap -p > "screenshot_$(date +%s).png"
- Reboot emulator :
adb -e reboot
- Install SwiftFormat:
brew install swiftformat
- Format files: run
make format
orswiftformat .