Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.

Commit

Permalink
Implement Notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
jfversluis committed May 10, 2021
1 parent dad8e60 commit 65ba746
Show file tree
Hide file tree
Showing 10 changed files with 19,751 additions and 6,986 deletions.
14 changes: 13 additions & 1 deletion XFLocalNotifications.Android/MainActivity.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
using System;

using Plugin.LocalNotification;
using Android.App;
using Android.Content.PM;
using Android.Runtime;
using Android.OS;
using Android.Content;

namespace XFLocalNotifications.Droid
{
Expand All @@ -14,10 +15,21 @@ protected override void OnCreate(Bundle savedInstanceState)
{
base.OnCreate(savedInstanceState);

NotificationCenter.CreateNotificationChannel();

Xamarin.Essentials.Platform.Init(this, savedInstanceState);
global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
LoadApplication(new App());

NotificationCenter.NotifyNotificationTapped(Intent);
}

protected override void OnNewIntent(Intent intent)
{
NotificationCenter.NotifyNotificationTapped(intent);
base.OnNewIntent(intent);
}

public override void OnRequestPermissionsResult(int requestCode, string[] permissions, [GeneratedEnum] Android.Content.PM.Permission[] grantResults)
{
Xamarin.Essentials.Platform.OnRequestPermissionsResult(requestCode, permissions, grantResults);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="30" />
<application android:label="XFLocalNotifications.Android" android:theme="@style/MainTheme"></application>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
</manifest>
</manifest>
Loading

0 comments on commit 65ba746

Please sign in to comment.