Skip to content

Commit

Permalink
update getting started section in readme, move info on resource shrin…
Browse files Browse the repository at this point in the history
…king (#434)

* update getting started section in readme, move info on resource shrinking

* build example app in debug mode as part of CI
  • Loading branch information
MaikuB authored Jan 9, 2020
1 parent a997153 commit 18de57d
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 48 deletions.
4 changes: 2 additions & 2 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ build_example_android_task:
folder: ~/.pub-cache
build_script:
- cd flutter_local_notifications/example
- flutter build apk
- flutter build apk --debug

build_example_ios_task:
osx_instance:
Expand All @@ -15,7 +15,7 @@ build_example_ios_task:
update_pods_script: pod repo update # to fetch all the latest versions
build_script:
- cd flutter_local_notifications/example
- flutter build ios --no-codesign
- flutter build ios --no-codesign --debug

test_platform_interface_task:
container:
Expand Down
4 changes: 4 additions & 0 deletions flutter_local_notifications/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# [0.9.1+3]
* Include notes in getting started section to emphasise that the steps in the integration guide for each platform needs to be done.
* Move information in the readme on configuring resources to keep on Android.

# [0.9.1+2]
* Update link to repository due to restructuring.

Expand Down
6 changes: 4 additions & 2 deletions flutter_local_notifications/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Contributions are welcome by submitting a PR for me to review. If it's to add ne

## Getting Started

The GitHub repository has an example app that should demonstrate of all the supported features of the plugin. Please check the example for more detailed code samples. If you only copy and paste the Dart code then this will not work as there's setup required for each platform. Pub also generates API docs for the latest version [here](https://pub.dartlang.org/documentation/flutter_local_notifications/latest/)
The GitHub repository has an example app that should demonstrate of all the supported features of the plugin. Please check the example for more detailed code samples. If you only copy and paste the Dart code then this will not work as there's setup required for each platform. Pub also generates API docs for the latest version [here](https://pub.dartlang.org/documentation/flutter_local_notifications/latest/). Besides referring to the example app and getting started section, please ensure that you have performed the steps in the integration guide for each platform further below.

The following samples will demonstrate the more commonly used functionalities. The first step is to create a new instance of the plugin class and then initialise it with the settings to use for each platform

Expand Down Expand Up @@ -318,14 +318,16 @@ When specifying the large icon bitmap or big picture bitmap (associated with the

Note that with Android 8.0+, sounds and vibrations are associated with notification channels and can only be configured when they are first created. Showing/scheduling a notification will create a channel with the specified id if it doesn't exist already. If another notification specifies the same channel id but tries to specify another sound or vibration pattern then nothing occurs.

When doing a release build of your app, you'll likely need to customise your ProGuard configuration file as per this [link](https://developer.android.com/studio/build/shrink-code#keep-code) and add the following line. If you have resource shrinking enabled, ensure that you have customised the resources that should be kept so that things like your notification images aren't discarded by following the instructions [here](https://developer.android.com/studio/build/shrink-code#keep-resources).
When doing a release build of your app, you'll likely need to customise your ProGuard configuration file as per this [link](https://developer.android.com/studio/build/shrink-code#keep-code) and add the following line.

```
-keep class com.dexterous.** { *; }
```

The plugin also makes use of GSON and the Proguard rules can be found [here](https://github.com/google/gson/blob/master/examples/android-proguard-example/proguard.cfg). The example app has a consolidate Proguard rules (`proguard-rules.pro`) file that combines these together for reference.

If you have resource shrinking enabled, ensure that you have customised the resources that should be kept so that things like your notification images aren't discarded by following the instructions [here](https://developer.android.com/studio/build/shrink-code#keep-resources).

**IMPORTANT**: Starting from version 0.5.0, this library no longer uses the deprecated Android support libraries and has migrated to AndroidX. Developers may require migrating their apps to support this following [this guide](https://developer.android.com/jetpack/androidx/migrate)

## iOS Integration
Expand Down
45 changes: 2 additions & 43 deletions flutter_local_notifications/example/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
name: flutter_local_notifications_example
description: Demonstrates how to use the flutter_local_notifications plugin.
publish_to: none

dependencies:
flutter:
sdk: flutter

# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.3
http: ^0.12.0+2
path_provider: ^1.5.1
Expand All @@ -20,44 +18,5 @@ dev_dependencies:
flutter_local_notifications:
path: ../

# For information on the generic Dart part of this file, see the
# following page: https://www.dartlang.org/tools/pub/pubspec

# The following section is specific to Flutter.
flutter:

# The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in
# the material Icons class.
uses-material-design: true

# To add assets to your application, add an assets section, like this:
# assets:
# - images/a_dot_burr.jpeg
# - images/a_dot_ham.jpeg

# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.io/assets-and-images/#resolution-aware.

# For details regarding adding assets from package dependencies, see
# https://flutter.io/assets-and-images/#from-packages

# To add custom fonts to your application, add a fonts section here,
# in this "flutter" section. Each entry in this list should have a
# "family" key with the font family name, and a "fonts" key with a
# list giving the asset and other descriptors for the font. For
# example:
# fonts:
# - family: Schyler
# fonts:
# - asset: fonts/Schyler-Regular.ttf
# - asset: fonts/Schyler-Italic.ttf
# style: italic
# - family: Trajan Pro
# fonts:
# - asset: fonts/TrajanPro.ttf
# - asset: fonts/TrajanPro_Bold.ttf
# weight: 700
#
# For details regarding fonts from package dependencies,
# see https://flutter.io/custom-fonts/#from-packages
uses-material-design: true
2 changes: 1 addition & 1 deletion flutter_local_notifications/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: flutter_local_notifications
description: A cross platform plugin for displaying and scheduling local notifications for Flutter applications with the ability to customise for each platform.
version: 0.9.1+2
version: 0.9.1+3
homepage: https://github.com/MaikuB/flutter_local_notifications/tree/master/flutter_local_notifications

dependencies:
Expand Down

0 comments on commit 18de57d

Please sign in to comment.