mirror of
https://github.com/Qortal/Qortal-Hub.git
synced 2025-07-31 14:11:46 +00:00
added notifications for mobile
This commit is contained in:
@@ -11,7 +11,9 @@ apply from: "../capacitor-cordova-android-plugins/cordova.variables.gradle"
|
||||
dependencies {
|
||||
implementation project(':capacitor-browser')
|
||||
implementation project(':capacitor-filesystem')
|
||||
implementation project(':capacitor-local-notifications')
|
||||
implementation project(':evva-capacitor-secure-storage-plugin')
|
||||
implementation project(':transistorsoft-capacitor-background-fetch')
|
||||
implementation "androidx.webkit:webkit:1.4.0"
|
||||
}
|
||||
|
||||
|
@@ -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 |
@@ -21,6 +21,10 @@ allprojects {
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
maven {
|
||||
// capacitor-background-fetch
|
||||
url("${project(':transistorsoft-capacitor-background-fetch').projectDir}/libs")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -8,5 +8,11 @@ project(':capacitor-browser').projectDir = new File('../node_modules/@capacitor/
|
||||
include ':capacitor-filesystem'
|
||||
project(':capacitor-filesystem').projectDir = new File('../node_modules/@capacitor/filesystem/android')
|
||||
|
||||
include ':capacitor-local-notifications'
|
||||
project(':capacitor-local-notifications').projectDir = new File('../node_modules/@capacitor/local-notifications/android')
|
||||
|
||||
include ':evva-capacitor-secure-storage-plugin'
|
||||
project(':evva-capacitor-secure-storage-plugin').projectDir = new File('../node_modules/@evva/capacitor-secure-storage-plugin/android')
|
||||
|
||||
include ':transistorsoft-capacitor-background-fetch'
|
||||
project(':transistorsoft-capacitor-background-fetch').projectDir = new File('../node_modules/@transistorsoft/capacitor-background-fetch/android')
|
||||
|
Reference in New Issue
Block a user