From 876e78e3d846d469b50894fd9a78abe07c15d8c8 Mon Sep 17 00:00:00 2001 From: Rendy Del Rosario Date: Mon, 19 Feb 2018 04:56:30 -0400 Subject: [PATCH] Bug fixes --- .../FirebasePushSample.Android.csproj | 4 +-- .../packages.config | 2 +- .../FirebasePushSample.iOS.csproj | 28 +++++++++---------- .../FirebasePushSample.iOS/packages.config | 10 +++---- .../FirebasePushSample.csproj | 4 +-- .../FirebasePushSample/packages.config | 2 +- .../DefaultPushNotificationHandler.cs | 2 +- .../FirebasePushNotificationManager.cs | 10 +++++-- ...Plugin.FirebasePushNotification.iOS.csproj | 24 ++++++++-------- .../packages.config | 8 +++--- 10 files changed, 49 insertions(+), 45 deletions(-) diff --git a/samples/FirebasePushSample/FirebasePushSample.Android/FirebasePushSample.Android.csproj b/samples/FirebasePushSample/FirebasePushSample.Android/FirebasePushSample.Android.csproj index 6f69207..4179d82 100644 --- a/samples/FirebasePushSample/FirebasePushSample.Android/FirebasePushSample.Android.csproj +++ b/samples/FirebasePushSample/FirebasePushSample.Android/FirebasePushSample.Android.csproj @@ -60,10 +60,10 @@ ..\packages\Plugin.CurrentActivity.1.0.1\lib\MonoAndroid10\Plugin.CurrentActivity.dll - ..\packages\Plugin.FirebasePushNotification.2.2.9-gamma\lib\MonoAndroid80\Plugin.FirebasePushNotification.dll + ..\packages\Plugin.FirebasePushNotification.2.2.9.3-beta\lib\MonoAndroid80\Plugin.FirebasePushNotification.dll - ..\packages\Plugin.FirebasePushNotification.2.2.9-gamma\lib\MonoAndroid80\Plugin.FirebasePushNotification.Abstractions.dll + ..\packages\Plugin.FirebasePushNotification.2.2.9.3-beta\lib\MonoAndroid80\Plugin.FirebasePushNotification.Abstractions.dll diff --git a/samples/FirebasePushSample/FirebasePushSample.Android/packages.config b/samples/FirebasePushSample/FirebasePushSample.Android/packages.config index d573d4d..a052eb5 100644 --- a/samples/FirebasePushSample/FirebasePushSample.Android/packages.config +++ b/samples/FirebasePushSample/FirebasePushSample.Android/packages.config @@ -1,7 +1,7 @@  - + diff --git a/samples/FirebasePushSample/FirebasePushSample.iOS/FirebasePushSample.iOS.csproj b/samples/FirebasePushSample/FirebasePushSample.iOS/FirebasePushSample.iOS.csproj index 8284c4e..6d9c0d5 100644 --- a/samples/FirebasePushSample/FirebasePushSample.iOS/FirebasePushSample.iOS.csproj +++ b/samples/FirebasePushSample/FirebasePushSample.iOS/FirebasePushSample.iOS.csproj @@ -122,22 +122,22 @@ - ..\packages\Xamarin.Firebase.iOS.Analytics.4.0.4\lib\Xamarin.iOS10\Firebase.Analytics.dll + ..\packages\Xamarin.Firebase.iOS.Analytics.4.0.5\lib\Xamarin.iOS10\Firebase.Analytics.dll - ..\packages\Xamarin.Firebase.iOS.CloudMessaging.2.0.4\lib\Xamarin.iOS10\Firebase.CloudMessaging.dll + ..\packages\Xamarin.Firebase.iOS.CloudMessaging.2.0.4.1\lib\Xamarin.iOS10\Firebase.CloudMessaging.dll - ..\packages\Xamarin.Firebase.iOS.Core.4.0.8\lib\Xamarin.iOS10\Firebase.Core.dll + ..\packages\Xamarin.Firebase.iOS.Core.4.0.13\lib\Xamarin.iOS10\Firebase.Core.dll - ..\packages\Xamarin.Firebase.iOS.InstanceID.2.0.4\lib\Xamarin.iOS10\Firebase.InstanceID.dll + ..\packages\Xamarin.Firebase.iOS.InstanceID.2.0.8\lib\Xamarin.iOS10\Firebase.InstanceID.dll - ..\packages\Plugin.FirebasePushNotification.2.2.9-gamma\lib\Xamarin.iOS10\Plugin.FirebasePushNotification.dll + ..\packages\Plugin.FirebasePushNotification.2.2.9.3-beta\lib\Xamarin.iOS10\Plugin.FirebasePushNotification.dll - ..\packages\Plugin.FirebasePushNotification.2.2.9-gamma\lib\Xamarin.iOS10\Plugin.FirebasePushNotification.Abstractions.dll + ..\packages\Plugin.FirebasePushNotification.2.2.9.3-beta\lib\Xamarin.iOS10\Plugin.FirebasePushNotification.Abstractions.dll @@ -172,17 +172,17 @@ - - - - + + + + - - - - + + + + \ No newline at end of file diff --git a/samples/FirebasePushSample/FirebasePushSample.iOS/packages.config b/samples/FirebasePushSample/FirebasePushSample.iOS/packages.config index 244453d..ba06c1c 100644 --- a/samples/FirebasePushSample/FirebasePushSample.iOS/packages.config +++ b/samples/FirebasePushSample/FirebasePushSample.iOS/packages.config @@ -1,10 +1,10 @@  - + - - - - + + + + \ No newline at end of file diff --git a/samples/FirebasePushSample/FirebasePushSample/FirebasePushSample.csproj b/samples/FirebasePushSample/FirebasePushSample/FirebasePushSample.csproj index 8dfb6b5..db68227 100644 --- a/samples/FirebasePushSample/FirebasePushSample/FirebasePushSample.csproj +++ b/samples/FirebasePushSample/FirebasePushSample/FirebasePushSample.csproj @@ -55,10 +55,10 @@ - ..\packages\Plugin.FirebasePushNotification.2.2.9-gamma\lib\netstandard1.0\Plugin.FirebasePushNotification.dll + ..\packages\Plugin.FirebasePushNotification.2.2.9.3-beta\lib\netstandard1.0\Plugin.FirebasePushNotification.dll - ..\packages\Plugin.FirebasePushNotification.2.2.9-gamma\lib\netstandard1.0\Plugin.FirebasePushNotification.Abstractions.dll + ..\packages\Plugin.FirebasePushNotification.2.2.9.3-beta\lib\netstandard1.0\Plugin.FirebasePushNotification.Abstractions.dll ..\packages\Xamarin.Forms.2.5.0.122203\lib\portable-win+net45+wp80+win81+wpa81\Xamarin.Forms.Core.dll diff --git a/samples/FirebasePushSample/FirebasePushSample/packages.config b/samples/FirebasePushSample/FirebasePushSample/packages.config index ee3964e..8eeccda 100644 --- a/samples/FirebasePushSample/FirebasePushSample/packages.config +++ b/samples/FirebasePushSample/FirebasePushSample/packages.config @@ -2,7 +2,7 @@ - + diff --git a/src/Plugin.FirebasePushNotification.Android/DefaultPushNotificationHandler.cs b/src/Plugin.FirebasePushNotification.Android/DefaultPushNotificationHandler.cs index 0c0022b..808d6ec 100644 --- a/src/Plugin.FirebasePushNotification.Android/DefaultPushNotificationHandler.cs +++ b/src/Plugin.FirebasePushNotification.Android/DefaultPushNotificationHandler.cs @@ -278,7 +278,7 @@ public void OnReceived(IDictionary parameters) .SetContentIntent(pendingIntent); var deleteIntent = new Intent(context,typeof(PushNotificationDeletedReceiver)); - var pendingDeleteIntent = PendingIntent.GetBroadcast(context, requestCode, deleteIntent, PendingIntentFlags.UpdateCurrent); + var pendingDeleteIntent = PendingIntent.GetBroadcast(context, requestCode, deleteIntent, PendingIntentFlags.CancelCurrent); notificationBuilder.SetDeleteIntent(pendingDeleteIntent); if (Build.VERSION.SdkInt < Android.OS.BuildVersionCodes.O) diff --git a/src/Plugin.FirebasePushNotification.Android/FirebasePushNotificationManager.cs b/src/Plugin.FirebasePushNotification.Android/FirebasePushNotificationManager.cs index 750a216..308205e 100644 --- a/src/Plugin.FirebasePushNotification.Android/FirebasePushNotificationManager.cs +++ b/src/Plugin.FirebasePushNotification.Android/FirebasePushNotificationManager.cs @@ -154,7 +154,7 @@ public static void Initialize(Context context, bool resetToken, bool createDefau if (resetToken || (!string.IsNullOrEmpty(storedPackageName) && (!storedPackageName.Equals(packageName, StringComparison.CurrentCultureIgnoreCase) || !storedVersionName.Equals(versionName, StringComparison.CurrentCultureIgnoreCase) || !storedVersionCode.Equals($"{versionCode}", StringComparison.CurrentCultureIgnoreCase)))) { - CleanUp(); + CleanUp(false); } @@ -233,9 +233,13 @@ public void UnregisterForPushNotifications() { Reset(); } - static void CleanUp() + static void CleanUp(bool clearAll = true) { - CrossFirebasePushNotification.Current.UnsubscribeAll(); + if(clearAll) + { + CrossFirebasePushNotification.Current.UnsubscribeAll(); + } + FirebaseInstanceId.Instance.DeleteInstanceId(); SaveToken(string.Empty); } diff --git a/src/Plugin.FirebasePushNotification.iOS/Plugin.FirebasePushNotification.iOS.csproj b/src/Plugin.FirebasePushNotification.iOS/Plugin.FirebasePushNotification.iOS.csproj index 7cb7be3..54d8943 100644 --- a/src/Plugin.FirebasePushNotification.iOS/Plugin.FirebasePushNotification.iOS.csproj +++ b/src/Plugin.FirebasePushNotification.iOS/Plugin.FirebasePushNotification.iOS.csproj @@ -50,16 +50,16 @@ - ..\..\packages\Xamarin.Firebase.iOS.Analytics.4.0.4\lib\Xamarin.iOS10\Firebase.Analytics.dll + ..\..\packages\Xamarin.Firebase.iOS.Analytics.4.0.5\lib\Xamarin.iOS10\Firebase.Analytics.dll - ..\..\packages\Xamarin.Firebase.iOS.CloudMessaging.2.0.4\lib\Xamarin.iOS10\Firebase.CloudMessaging.dll + ..\..\packages\Xamarin.Firebase.iOS.CloudMessaging.2.0.4.1\lib\Xamarin.iOS10\Firebase.CloudMessaging.dll - ..\..\packages\Xamarin.Firebase.iOS.Core.4.0.8\lib\Xamarin.iOS10\Firebase.Core.dll + ..\..\packages\Xamarin.Firebase.iOS.Core.4.0.13\lib\Xamarin.iOS10\Firebase.Core.dll - ..\..\packages\Xamarin.Firebase.iOS.InstanceID.2.0.4\lib\Xamarin.iOS10\Firebase.InstanceID.dll + ..\..\packages\Xamarin.Firebase.iOS.InstanceID.2.0.8\lib\Xamarin.iOS10\Firebase.InstanceID.dll @@ -75,16 +75,16 @@ This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - + + + + - - - - + + + + \ No newline at end of file diff --git a/src/Plugin.FirebasePushNotification.iOS/packages.config b/src/Plugin.FirebasePushNotification.iOS/packages.config index 78b2ccb..5192621 100644 --- a/src/Plugin.FirebasePushNotification.iOS/packages.config +++ b/src/Plugin.FirebasePushNotification.iOS/packages.config @@ -1,8 +1,8 @@  - - - - + + + + \ No newline at end of file