mirror of
https://github.com/Qortal/Qortal-Hub.git
synced 2025-07-25 11:11:26 +00:00
added notifications for mobile
This commit is contained in:
@@ -8,7 +8,8 @@
|
||||
android:roundIcon="@mipmap/ic_launcher"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme"
|
||||
android:requestLegacyExternalStorage="true">
|
||||
android:requestLegacyExternalStorage="true"
|
||||
android:usesCleartextTraffic="true">
|
||||
<activity
|
||||
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode"
|
||||
android:name=".MainActivity"
|
||||
@@ -40,4 +41,5 @@
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
|
||||
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" />
|
||||
</manifest>
|
||||
|
@@ -0,0 +1,31 @@
|
||||
package com.example.app;
|
||||
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
|
||||
import com.transistorsoft.tsbackgroundfetch.BackgroundFetch;
|
||||
import com.transistorsoft.tsbackgroundfetch.BGTask;
|
||||
|
||||
public class BackgroundFetchHeadlessTask{
|
||||
public void onFetch(Context context, BGTask task) {
|
||||
// Get a reference to the BackgroundFetch Android API.
|
||||
BackgroundFetch backgroundFetch = BackgroundFetch.getInstance(context);
|
||||
// Get the taskId.
|
||||
String taskId = task.getTaskId();
|
||||
// Log a message to adb logcat.
|
||||
Log.d("MyHeadlessTask", "BackgroundFetchHeadlessTask onFetch -- CUSTOM IMPLEMENTATION: " + taskId);
|
||||
|
||||
boolean isTimeout = task.getTimedOut();
|
||||
// Is this a timeout?
|
||||
if (isTimeout) {
|
||||
backgroundFetch.finish(taskId);
|
||||
return;
|
||||
}
|
||||
// Do your work here...
|
||||
//
|
||||
//
|
||||
// Signal finish just like the Javascript API.
|
||||
backgroundFetch.finish(taskId);
|
||||
}
|
||||
}
|
BIN
android/app/src/main/res/drawable/qort.png
Normal file
BIN
android/app/src/main/res/drawable/qort.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.9 KiB |
Reference in New Issue
Block a user