@Suppress("DEPRECATION")
class AlarmReceiver extends BroadcastReceiver {
constructor (){
super();
}
override onReceive(context : Context, intent : Intent) {
var action = intent.getAction();
Log.d("AlarmReceiver", "Broadcast received: " + action);
console.log('ygskyl');
if (action.equals("ACTION_FROM_NATIVE")) {
var value = intent.getStringExtra("msg");
console.log("yhh",value);
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools"
package="io.dcloud.uni_modules.qtClock">
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.SET_ALARM" />
<application>
<receiver android:name="uts.sdk.modules.qtClock.AlarmReceiver">
<intent-filter>
<action android:name="uts.sdk.modules.qtClock.ACTION_FROM_NATIVE" />
</intent-filter>
</receiver>
</application>
</manifest>
根据安卓的 logcat 显示 提交是ok的 但是就是无法创建静态监听
0 个回复