Skip to content

Commit

Permalink
add android docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ened committed Apr 9, 2024
1 parent d7e6ba5 commit 90b29b3
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions docs/android.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Check your AndroidManifest.xml

Check if you have the following in your `AndroidManifest.xml` file.

```xml
<meta-data
android:name="flutterEmbedding"
android:value="2" />
```

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.

<img src=".art/android_debug_notification.gif" height="650">

0 comments on commit 90b29b3

Please sign in to comment.