Tasker integration - Android API 30

215 views
Skip to first unread message

ilker Aktuna

unread,
Jul 7, 2022, 7:50:37 AM7/7/22
to Tasker
Hi,

I had successful plugin integration of my app for Tasker.
Today I tried to migrate my app to Android 30 and now I can't get the message sent from Tasker to my app.
I can configure the task selecting my app as "plugin" and then fill in the "text" to be sent to my app. Then I run the task manually but it never reaches my app.

As far as I remember, the class extending BroadcastReceiver should receive the intent  and onReceive method should be called when Tasker task is run.
So I 've put a log under onReceive massage but I don't see it being triggered.

What might have been changed in API 30 preventing the intent to be received ?

And which intent is actually called ?

Thanks,

João Dias

unread,
Jul 7, 2022, 7:55:09 AM7/7/22
to Tasker
Hi. 


If you don't want to migrate everything, you need to use the IntentService variant to get it to work with the old plugin code. Check here: https://tasker.joaoapps.com/pluginsservicesmigration.html

Thank you for your contact.

   Join: connect multiple devices (send pushes, remote SMS, notifications) on Android, Windows, Mac, Linux
   Tasker: customize/automate anything on your phone!
   AutoApps: add advanced functionality to Tasker via plugins

     

João Dias

ilker Aktuna

unread,
Jul 7, 2022, 1:05:15 PM7/7/22
to Tasker
Thanks for the fast respıonse.

Actually I am using a very old integration and I don't have much time to study new implementation.
So I chose to use this as you suggested:

But I am not able to follow it. 
My current implementation has a locale-api.jar  included in the libs directory.
And I have 1 activity and 1 receiver with these 2 intents:

<activity
android:name=".EditActivity"
android:exported="true"
android:icon="@drawable/ic_locale_plugin"
android:label="@string/plugin_name"
android:theme="@style/Theme.AppCompat.Light"
android:uiOptions="splitActionBarWhenNarrow"
android:windowSoftInputMode="adjustResize"
tools:ignore="ExportedActivity" >

<intent-filter>
<action android:name="com.twofortyfouram.locale.intent.action.EDIT_SETTING" />
</intent-filter>
</activity>

<receiver
android:name=".FireReceiver"
android:exported="true"
android:process=":background"
tools:ignore="ExportedReceiver" >

<intent-filter>
<action android:name="com.twofortyfouram.locale.intent.action.FIRE_SETTING" />
</intent-filter>
</receiver>


My plugin just receives one text variable set from Tasker. So it is a very simple one.
How can I convert to the current required method ?

ilker Aktuna

unread,
Jul 7, 2022, 1:06:53 PM7/7/22
to Tasker
oh I also have a TaskerPlugin class included.

ilker Aktuna

unread,
Jul 7, 2022, 4:21:38 PM7/7/22
to Tasker
I only had the receiver with  com.twofortyfouram.locale.intent.action.FIRE_SETTING

so I deleted the receiver and added it as a service extending IntentServiceParallel

it asked me to put a constructor to the service, so I added:

public FireReceiver(@NonNull String name) {
super(name);
}

then it said:
'onBind(Intent)' in 'com.poc.test.FireReceiver' clashes with 'onBind(Intent)' in 'com.poc.test.IntentServiceParallel'; attempting to use incompatible return type

so I changed it in IntentServiceParallel to:

override fun onBind(intent: Intent): IBinder? = null

then it did not like the service definition in Manifest:


This class should provide a default constructor (a public constructor with no arguments) (com.poc.test)

I don't know what to do with this.

Is there a simple example that I can check ?

ilker Aktuna

unread,
Jul 8, 2022, 3:27:37 PM7/8/22
to Tasker
anything to help me ?

thanks

João Dias

unread,
Jul 13, 2022, 5:16:59 AM7/13/22
to Tasker
Hi. Sorry for the late reply.

You should not delete any existing code, you should only add/replace what's mentioned in the page I sent you. For example, you shouldn't be deleting the BroadcastReceiver, you have to keep it.

Did you follow the instructions in the page I sent you? Let me know if any of the steps are not clear for you.

ilker Aktuna

unread,
Jul 15, 2022, 6:01:56 AM7/15/22
to Tasker
I followed the instructions, but I removed the broadcast receiver.
If I put it back, which one will the intent be pointing to ? (service or the receiver ?)

ilker Aktuna

unread,
Jul 15, 2022, 6:15:28 AM7/15/22
to Tasker
also, how the receiver will communicate with the service ?
I tried adding the service along with the receiver with same intent. But the receiver does not receive the intent.
Which one will do the action ? service or the receiver ?

I really did not understand this implementation. A sample app with only one variable would be nice to examine and understand.


On Wednesday, 13 July 2022 at 12:16:59 UTC+3 joaomgcd wrote:
Reply all
Reply to author
Forward
0 new messages