From c20351b72c773abb5f213ecd6766297a52b4006c Mon Sep 17 00:00:00 2001 From: Tanay Neotia Date: Sat, 1 Apr 2023 23:04:37 +0000 Subject: [PATCH] GITBOOK-24: change request with no subject merged in GitBook --- clients/SUMMARY.md | 1 + clients/usage-guides/tasker-integration.md | 48 ++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 clients/usage-guides/tasker-integration.md diff --git a/clients/SUMMARY.md b/clients/SUMMARY.md index ee41155..836a03a 100644 --- a/clients/SUMMARY.md +++ b/clients/SUMMARY.md @@ -11,6 +11,7 @@ ## Usage Guides * [Using BlueBubbles with Adguard](usage-guides/using-bluebubbles-with-adguard.md) +* [Tasker Integration](usage-guides/tasker-integration.md) ## For Developers diff --git a/clients/usage-guides/tasker-integration.md b/clients/usage-guides/tasker-integration.md new file mode 100644 index 0000000..6ce6eca --- /dev/null +++ b/clients/usage-guides/tasker-integration.md @@ -0,0 +1,48 @@ +--- +description: Details on how BlueBubbles integrates with Tasker +--- + +# Tasker Integration + +{% hint style="warning" %} +Tasker integration requires BlueBubbles App v1.12.0 or greater! +{% endhint %} + +{% hint style="info" %} +If you make any cool integrations, feel free to share in our Discord! +{% endhint %} + +## Fetching the Server URL + +To fetch the server URL in Tasker, follow the below process: + +1. Create the `Send Intent` task + 1. Set the `action` as `com.bluebubbles.external.GET_SERVER_URL` + 2. Set one `extra` as `password:`. This is required so that apps cannot abuse this ability without your consent. + 3. Set the `package` as `com.bluebubbles.messaging.tanay`. + 4. Ensure the `target` is set as `Broadcast Receiver`. +2. Create the `Intent Received` event + 1. Set the `action` as `net.dinglisch.android.taskerm.BB_SERVER_URL` + 2. Create your own task to perform once this is received. The server URL can be accessed via the `%url` variable. + +## Listening for Server Events + +To listen for server events (new message, chat read status change, etc), follow the below process: + +1. Enable the option within BlueBubbles app settings > Tasker Integration +2. Create the `Intent Received` intent + 1. Set the `action` as `net.dinglisch.android.taskerm.BB_EVENT` + 2. Create your own task to perform once this is received. + +The intent sends a few pieces of data: + +1. The server URL, which can be accessed via the `%url` variable +2. The type of event, which can be accessed via the `%event` variable +3. The event data, which can be accessed via the `%data` variable + +The event type is defined by the server event types, which can be found [here](https://github.com/BlueBubblesApp/bluebubbles-server/blob/master/packages/server/src/server/events.ts). + +The event data is a JSON string. You can use Tasker's built-in JSON parser to convert this to a real JSON object and access the individual data inside. + + +