diff options
Diffstat (limited to 'androidApp/src/google')
-rw-r--r-- | androidApp/src/google/AndroidManifest.xml | 15 | ||||
-rw-r--r-- | androidApp/src/google/java/ManagerMessagingService.kt | 19 |
2 files changed, 23 insertions, 11 deletions
diff --git a/androidApp/src/google/AndroidManifest.xml b/androidApp/src/google/AndroidManifest.xml index f7aea6c..ce72a8b 100644 --- a/androidApp/src/google/AndroidManifest.xml +++ b/androidApp/src/google/AndroidManifest.xml @@ -7,7 +7,10 @@ <application android:name=".GoogleMainApplication" tools:replace="android:name" - tools:ignore="GoogleAppIndexingWarning"> + tools:ignore="GoogleAppIndexingWarning" + android:allowBackup="false" + android:icon="@mipmap/ic_launcher" + android:fullBackupContent="false"> <meta-data android:name="com.google.firebase.messaging.default_notification_channel_id" @@ -23,6 +26,16 @@ </intent-filter> </service> + <provider + android:authorities="${applicationId}.fileprovider" + android:name="androidx.core.content.FileProvider" + android:exported="false" + android:grantUriPermissions="true"> + <meta-data + android:name="android.support.FILE_PROVIDER_PATHS" + android:resource="@xml/filepaths" /> + </provider> + </application> </manifest> diff --git a/androidApp/src/google/java/ManagerMessagingService.kt b/androidApp/src/google/java/ManagerMessagingService.kt index 07ee427..9ac4636 100644 --- a/androidApp/src/google/java/ManagerMessagingService.kt +++ b/androidApp/src/google/java/ManagerMessagingService.kt @@ -16,14 +16,13 @@ package mx.trackermap.TrackerMap.android import android.annotation.SuppressLint -import android.app.NotificationManager import android.app.PendingIntent import android.content.Intent import android.os.Build -import androidx.core.app.NotificationCompat import com.google.firebase.messaging.FirebaseMessagingService import com.google.firebase.messaging.RemoteMessage import kotlinx.coroutines.DelicateCoroutinesApi +import mx.trackermap.TrackerMap.android.shared.Utils import mx.trackermap.TrackerMap.android.units.UnitsActivity import kotlin.time.ExperimentalTime @@ -39,14 +38,14 @@ class ManagerMessagingService : FirebaseMessagingService() { } else { PendingIntent.FLAG_ONE_SHOT } - val pendingIntent = PendingIntent.getActivity(this, 0, Intent(this, UnitsActivity::class.java), flags) - val builder = NotificationCompat.Builder(this, getString(R.string.notification_channel_id)) - .setSmallIcon(R.drawable.icon_notify) - .setContentTitle(getString(R.string.app_name)) - .setContentText(remoteMessage.notification?.body) - .setAutoCancel(true) - .setContentIntent(pendingIntent) - (getSystemService(NOTIFICATION_SERVICE) as NotificationManager).notify(remoteMessage.hashCode(), builder.build()) + val intent = Intent(this, UnitsActivity::class.java) + val pendingIntent = PendingIntent.getActivity(this, 0, intent, flags) + Utils.showNotification( + this, + remoteMessage.hashCode(), + remoteMessage.notification?.body, + pendingIntent + ) } override fun onNewToken(token: String) { |