Skip to content

Commit

Permalink
Updated icon + make it android < 12 friendly
Browse files Browse the repository at this point in the history
  • Loading branch information
wonder-sk committed Jun 2, 2024
1 parent d52bba5 commit 645f4b4
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 47 deletions.
22 changes: 4 additions & 18 deletions app/android/res/drawable/ic_notification.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,8 @@
android:viewportHeight="234"
android:width="234dp"
android:height="234dp">
<group
android:scaleX="1.393633"
android:scaleY="1.393633"
android:translateX="-46.05505"
android:translateY="-46.05505">
<path
android:pathData="M117 159.67h42.66V74.34H117V53h64v128h-64z"
android:fillColor="#FFFFFF" />
<path
android:pathData="M82.4724 117c0 19.072 15.4555 34.517 34.5176 34.517V82.4819C97.9179 82.4819 82.4724 97.9374 82.4724 117Z"
android:fillColor="#FFFFFF" />
<path
android:pathData="M117 159.67H74.33V74.34H117V53H53v128h64z"
android:fillColor="#FFFFFF" />
<path
android:pathData="M151.518 117c0 19.072 -15.456 34.517 -34.518 34.517V82.4819c19.072 0 34.518 15.4555 34.518 34.5181z"
android:fillColor="#FFFFFF" />
</group>
<path
android:pathData="M121.00158 173.91574v28.45121h81.36537V31.633052h-81.36537v28.464542h52.90083V173.91574Zm0 -11.04568V71.129138c23.56394 2.027331 42.04055 21.791647 42.04055 45.870862 0 24.09082 -18.48728 43.8426 -42.04055 45.87006zm-8.00316 39.49689V173.91574H60.084255V60.097594H112.99842V31.633052H31.633052V202.36695Zm0 -39.49689V71.127937C89.428343 73.149 70.945065 92.91625 70.945065 117c0 24.09482 18.494216 43.8506 42.053355 45.87006z"
android:fillType="evenOdd"
android:fillColor="#FFFFFF" />
</vector>
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,17 @@ public int onStartCommand( Intent intent, int flags, int startId ) {

PendingIntent pendingIntent = PendingIntent.getActivity( this, 0, notificationIntent, PendingIntent.FLAG_IMMUTABLE );

Notification notification = new Notification.Builder( this, CHANNEL_ID )
Notification.Builder notificationBuilder = new Notification.Builder( this, CHANNEL_ID )
.setSmallIcon( R.drawable.ic_notification )
.setContentTitle( "Tracking in progress" )
.setColor( getResources().getColor( R.color.grassColor ) )
.setForegroundServiceBehavior( Notification.FOREGROUND_SERVICE_IMMEDIATE )
.setContentIntent( pendingIntent )
.build();
.setContentIntent( pendingIntent );

if ( Build.VERSION.SDK_INT >= Build.VERSION_CODES.S ) { // only Android >= 12
notificationBuilder.setForegroundServiceBehavior( Notification.FOREGROUND_SERVICE_IMMEDIATE );
}

Notification notification = notificationBuilder.build();

startForeground( SERVICE_ID, notification );

Expand Down
56 changes: 31 additions & 25 deletions app/icons/android-foreground-service-notification-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

1 comment on commit 645f4b4

@inputapp-bot
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

iOS - version 24.6.628211 just submitted!

Please sign in to comment.