forked from trent_larson/crowd-funder-for-time-pwa
Implement Android host-side integration for daily notification plugin by creating custom Application class and native content fetcher. Changes: - Add TimeSafariApplication.java: Custom Application class that registers NativeNotificationContentFetcher with the plugin on app startup - Add TimeSafariNativeFetcher.java: Implementation of NativeNotificationContentFetcher interface that fetches notification content from endorser API endpoint (/api/v2/report/plansLastUpdatedBetween) using JWT authentication - Update AndroidManifest.xml: Declare TimeSafariApplication as the custom Application class using android:name attribute - Add Gson dependency: Include com.google.code.gson:gson:2.10.1 in build.gradle for JSON parsing in the native fetcher This setup mirrors the test app configuration and enables the plugin's background content prefetching feature. The native fetcher will be called by the plugin 5 minutes before scheduled notification times to prefetch content for display. Author: Matthew Raymer
85 lines
4.0 KiB
XML
85 lines
4.0 KiB
XML
<?xml version="1.0" encoding="utf-8" ?>
|
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
|
<application
|
|
android:name=".TimeSafariApplication"
|
|
android:allowBackup="true"
|
|
android:icon="@mipmap/ic_launcher"
|
|
android:label="@string/app_name"
|
|
android:roundIcon="@mipmap/ic_launcher_round"
|
|
android:supportsRtl="true"
|
|
android:theme="@style/AppTheme">
|
|
<activity
|
|
android:name=".MainActivity"
|
|
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode"
|
|
android:exported="true"
|
|
android:label="@string/title_activity_main"
|
|
android:launchMode="singleTask"
|
|
android:screenOrientation="portrait"
|
|
android:windowSoftInputMode="adjustResize"
|
|
android:theme="@style/AppTheme.NoActionBarLaunch">
|
|
<intent-filter>
|
|
<action android:name="android.intent.action.MAIN" />
|
|
<category android:name="android.intent.category.LAUNCHER" />
|
|
</intent-filter>
|
|
|
|
<intent-filter>
|
|
<action android:name="android.intent.action.VIEW" />
|
|
<category android:name="android.intent.category.DEFAULT" />
|
|
<category android:name="android.intent.category.BROWSABLE" />
|
|
<data android:scheme="timesafari" />
|
|
</intent-filter>
|
|
</activity>
|
|
|
|
<provider
|
|
android:name="androidx.core.content.FileProvider"
|
|
android:authorities="${applicationId}.fileprovider"
|
|
android:exported="false"
|
|
android:grantUriPermissions="true">
|
|
<meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/file_paths" />
|
|
</provider>
|
|
|
|
<!-- Daily Notification Plugin Receivers -->
|
|
<receiver
|
|
android:name="com.timesafari.dailynotification.DailyNotificationReceiver"
|
|
android:enabled="true"
|
|
android:exported="false">
|
|
<intent-filter>
|
|
<action android:name="com.timesafari.daily.NOTIFICATION" />
|
|
</intent-filter>
|
|
</receiver>
|
|
<receiver
|
|
android:name="com.timesafari.dailynotification.BootReceiver"
|
|
android:directBootAware="true"
|
|
android:enabled="true"
|
|
android:exported="true">
|
|
<intent-filter android:priority="1000">
|
|
<!-- Delivered very early after reboot (before unlock) -->
|
|
<action android:name="android.intent.action.LOCKED_BOOT_COMPLETED" />
|
|
<!-- Delivered after the user unlocks / credential-encrypted storage is available -->
|
|
<action android:name="android.intent.action.BOOT_COMPLETED" />
|
|
<!-- Delivered after app update; great for rescheduling alarms without reboot -->
|
|
<action android:name="android.intent.action.MY_PACKAGE_REPLACED" />
|
|
</intent-filter>
|
|
</receiver>
|
|
</application>
|
|
|
|
<!-- Permissions -->
|
|
|
|
<uses-permission android:name="android.permission.INTERNET" />
|
|
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
|
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
|
<uses-permission android:name="android.permission.CAMERA" />
|
|
<uses-feature android:name="android.hardware.camera" android:required="true" />
|
|
|
|
<!-- Notification permissions -->
|
|
<!-- POST_NOTIFICATIONS required for Android 13+ (API 33+) -->
|
|
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
|
|
|
<!-- SCHEDULE_EXACT_ALARM required for Android 12+ (API 31+) to schedule exact alarms -->
|
|
<!-- Note: On Android 12+, users can grant/deny this permission -->
|
|
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" />
|
|
|
|
<!-- RECEIVE_BOOT_COMPLETED needed to reschedule notifications after device reboot -->
|
|
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
|
|
</manifest>
|