From 90b29b39353a95633a30580a610e21015815d79a Mon Sep 17 00:00:00 2001 From: Sebastian Roth Date: Tue, 9 Apr 2024 09:39:38 +0100 Subject: [PATCH 1/2] add android docs --- docs/android.mdx | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 docs/android.mdx diff --git a/docs/android.mdx b/docs/android.mdx new file mode 100644 index 0000000..6c519a6 --- /dev/null +++ b/docs/android.mdx @@ -0,0 +1,24 @@ +# Check your AndroidManifest.xml + +Check if you have the following in your `AndroidManifest.xml` file. + +```xml + +``` + +Ideally you should have this, if not follow the [upgrade guide](https://github.com/flutter/flutter/wiki/Upgrading-pre-1.12-Android-projects). +If for some reason you can't upgrade yet we still support the [older way of embedding](ANDROID_SETUP_V1.md): + +# How to Debug my background job + +Debugging a background task can be difficult, Android decides when is the best time to run. +There is no guaranteed way to enforce a run of a job even in debug mode. + +However to facilitate debugging, the plugin provides an `isInDebugMode` flag when initializing the plugin: `Workmanager().initialize(callbackDispatcher, isInDebugMode: true)` + +Once this flag is enabled you will receive a notification whenever a background task was triggered. +This way you can keep track whether that task ran successfully or not. + + From 737bdc35151becd8bd78db76567850cbc2dc1f9e Mon Sep 17 00:00:00 2001 From: Sebastian Roth Date: Tue, 9 Apr 2024 10:34:31 +0100 Subject: [PATCH 2/2] updated workflows --- .github/workflows/examples.yml | 5 +++-- .github/workflows/pr.yml | 2 +- .github/workflows/test.yml | 37 +++++++++++++++++++++++++--------- 3 files changed, 31 insertions(+), 13 deletions(-) diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml index 66b4ef0..47b562a 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/examples.yml @@ -11,9 +11,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: actions/setup-java@v1 + - uses: actions/setup-java@v4 with: - java-version: 17 + distribution: 'temurin' + java-version: '21' - uses: subosito/flutter-action@v2 with: channel: "stable" diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 671dbed..075fea2 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -12,7 +12,7 @@ jobs: name: Validate PR title runs-on: ubuntu-latest steps: - - uses: amannn/action-semantic-pull-request@v5.2.0 + - uses: amannn/action-semantic-pull-request@v5.4.0 id: lint_pr_title env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9063cdd..188f0a3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -28,24 +28,37 @@ jobs: with: channel: 'stable' - name: Build iOS App - run: cd example && flutter build ios --debug --no-codesign + run: | + dart pub global activate melos + melos bootstrap + cd example && flutter build ios --debug --no-codesign - name: Run native iOS tests - run: cd example/ios && xcodebuild -workspace Runner.xcworkspace -scheme Runner -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 12,OS=16.2' test + run: | + dart pub global activate melos + melos bootstrap + cd example/ios && xcodebuild -workspace Runner.xcworkspace -scheme Runner -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 12,OS=16.2' test native_android_tests: runs-on: macos-latest steps: - uses: actions/checkout@v4 - - uses: actions/setup-java@v1 + - uses: actions/setup-java@v4 with: - java-version: 17 + distribution: 'temurin' + java-version: '21' - uses: subosito/flutter-action@v1 with: channel: 'stable' - name: Build Android App - run: cd example && flutter build apk --debug + run: | + dart pub global activate melos + melos bootstrap + cd example && flutter build apk --debug - name: Run native Android tests - run: cd example/android && gradle workmanager:test + run: | + dart pub global activate melos + melos bootstrap + cd example/android && gradle workmanager:test drive_ios: strategy: @@ -55,7 +68,7 @@ jobs: fail-fast: false runs-on: macos-latest steps: - - uses: futureware-tech/simulator-action@v1 + - uses: futureware-tech/simulator-action@v3 with: model: '${{ matrix.device }}' - uses: actions/checkout@v4 @@ -64,7 +77,10 @@ jobs: channel: 'stable' # Run flutter integrate tests - name: Run Flutter integration tests - run: cd example && flutter test integration_test/workmanager_integration_test.dart + run: | + dart pub global activate melos + melos bootstrap + cd example && flutter test integration_test/workmanager_integration_test.dart drive_android: @@ -78,9 +94,10 @@ jobs: target: [default] steps: - uses: actions/checkout@v4 - - uses: actions/setup-java@v1 + - uses: actions/setup-java@v4 with: - java-version: 17 + distribution: 'temurin' + java-version: '21' - uses: subosito/flutter-action@v2 with: channel: 'stable'