Cordova Slack Digest

Wed, 08 Dec 2021 08:21:25 GMT

User count: 4680

Join the conversation at slack.cordova.io

Channel #general (2 messages)


Tue, 07 Dec 2021 08:29:14 GMT

@mario.kurzweil says

Hello everyone, I’m using https://github.com/katzer/cordova-plugin-background-mode plugin to send background information to the server constantly (every 60sec). At some point (a few hours) the plugin seems to stop working. I also tried the fork: https://bitbucket.org/TheBosZ/cordova-plugin-run-in-background/src/master/

Snippet: cordova.plugins.backgroundMode.enable(); cordova.plugins.backgroundMode.disableBatteryOptimizations(); cordova.plugins.backgroundMode.on('activate', *function* () { cordova.plugins.backgroundMode.disableWebViewOptimizations(); intervalForBackground = $interval(*function* () { // send backgrorund information to the server }, 60000); });

Added to AndroidManifest.xml:

&lt;manifest android:hardwareAccelerated="true" android:versionCode="XXXXXXX" android:versionName="XXXXXXXX" package="XXXXXXXXX" xmlns:android="<http://schemas.android.com/apk/res/android>"&gt;
    &lt;supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" android:xlargeScreens="true" /&gt;
    &lt;uses-permission android:name="android.permission.INTERNET" /&gt;
    &lt;application android:hardwareAccelerated="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:supportsRtl="true"&gt;
        &lt;activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode" android:label="@string/activity_name" android:launchMode="singleTop" android:name="MainActivity" android:screenOrientation="portrait" android:theme="@android:style/Theme.DeviceDefault.NoActionBar" android:windowSoftInputMode="adjustResize"&gt;
            &lt;intent-filter android:label="@string/launcher_name"&gt;
                &lt;action android:name="android.intent.action.MAIN" /&gt;
                &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
            &lt;/intent-filter&gt;
        &lt;/activity&gt;
        &lt;activity android:exported="true" android:name="com.adobe.phonegap.push.PushHandlerActivity" android:permission="${applicationId}.permission.PushHandlerActivity" /&gt;
        &lt;activity android:exported="true" android:name="com.adobe.phonegap.push.BackgroundHandlerActivity" android:permission="${applicationId}.permission.BackgroundHandlerActivity"&gt;
            &lt;intent-filter&gt;
                &lt;action android:name="com.adobe.phonegap.push.background.MESSAGING_EVENT" /&gt;
                &lt;category android:name="android.intent.category.DEFAULT" /&gt;
            &lt;/intent-filter&gt;
        &lt;/activity&gt;
        &lt;receiver android:name="com.adobe.phonegap.push.BackgroundActionButtonHandler" /&gt;
        &lt;receiver android:name="com.adobe.phonegap.push.PushDismissedHandler" /&gt;
        &lt;service android:name="com.adobe.phonegap.push.FCMService"&gt;
            &lt;intent-filter&gt;
                &lt;action android:name="com.google.firebase.MESSAGING_EVENT" /&gt;
            &lt;/intent-filter&gt;
        &lt;/service&gt;
        &lt;service android:name="com.adobe.phonegap.push.PushInstanceIDListenerService"&gt;
            &lt;intent-filter&gt;
                &lt;action android:name="com.google.firebase.INSTANCE_ID_EVENT" /&gt;
            &lt;/intent-filter&gt;
        &lt;/service&gt;
        &lt;service android:name="de.appplant.cordova.plugin.background.ForegroundService" /&gt;
    &lt;/application&gt;
    &lt;uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" /&gt;
    &lt;uses-permission android:name="android.permission.ACCESS_NOTIFICATION_POLICY" /&gt;
    &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /&gt;
    &lt;uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /&gt;
    &lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /&gt;
    &lt;uses-feature android:name="android.hardware.location.gps" /&gt;
    &lt;uses-permission android:name="android.permission.RECORD_AUDIO" /&gt;
    &lt;uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" /&gt;
    &lt;uses-permission android:name="android.permission.READ_PHONE_STATE" /&gt;
    &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /&gt;
    &lt;uses-permission android:name="android.permission.VIBRATE" /&gt;
    &lt;uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /&gt;
    &lt;uses-permission android:name="android.permission.CHANGE_WIFI_STATE" /&gt;
    &lt;uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" /&gt;
    &lt;uses-permission android:name="android.permission.WAKE_LOCK" /&gt;
    &lt;uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" /&gt;
    &lt;uses-permission android:name="android.permission.FOREGROUND_SERVICE" /&gt;
&lt;/manifest&gt;```
As I mentioned it works fine for about 5-10 hours, after that the app seems to be closed (Depends on the device - Android &gt;= 9). The notification “App is running in background” disappears. Does anyone have any suggestions on this?

Installed version:
- cordova - 10.0.0
- cordova-ios: 6.1.1
- cordova-android: 9.1.0

Wed, 08 Dec 2021 05:47:07 GMT

@cadis630 says

Hi folks, what is the best way to log plugin/native crashes in cordova based production apps android and iOS? Does cordova-plugin-firebase-crashlytics will help or not. Please guide.

Channel #plugins (1 messages)


Tue, 07 Dec 2021 13:37:46 GMT

@info300 says

@niklasmerz any releasemap for new release of cordova-plugin-fingerprint-aio ?

and, is it possible to use face-ID on android devices together with fingerprint with this plugin?