Skip to content

Commit 8fd4374

Browse files
committed
v4.0.1 with better Firebase JWT token management
1 parent d87c723 commit 8fd4374

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
lines changed

CorePush.Tester/Program.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ class Program
3333

3434
static async Task Main()
3535
{
36-
//await SendApnNotificationAsync();
37-
await SendFcmNotificationAsync();
36+
// await SendApnNotificationAsync();
37+
// await SendFcmNotificationAsync();
3838

3939
Console.WriteLine("Done!");
4040
}

CorePush/CorePush.csproj

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
<Summary>Server Side library for sending ✅Web, ✅Android and ✅iOS Push Notifications</Summary>
1111
<Authors>andrei-m-code</Authors>
1212

13-
<AssemblyVersion>4.0.0</AssemblyVersion>
14-
<FileVersion>4.0.0</FileVersion>
15-
<Version>4.0.0</Version>
13+
<AssemblyVersion>4.0.1</AssemblyVersion>
14+
<FileVersion>4.0.1</FileVersion>
15+
<Version>4.0.1</Version>
1616

1717
<PackageProjectUrl>https://github.com/andrei-m-code/CorePush</PackageProjectUrl>
1818
<RepositoryUrl>https://github.com/andrei-m-code/CorePush</RepositoryUrl>
@@ -25,10 +25,11 @@
2525
<PackageTags>push-notifications android-push-notifications ios-push-notifications web-push web-push-notifications apn fcm firebase</PackageTags>
2626

2727
<PackageReleaseNotes>
28-
v4.0.0
28+
v4.0.x
2929
- Use .NET 7.0 as a target framework
3030
- Use System.Text.Json as a default serializer
3131
- [BREAKING CHANGE] Firebase Messaging uses HTTP v1 API
32+
- [BREAKING CHANGE] Different configuration is required because of the HTTP v1
3233

3334
v3.1.x
3435
- Memory optimizations

README.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
[![NuGet](https://img.shields.io/nuget/v/CorePush.svg)](https://www.nuget.org/packages/CorePush/)
22

3-
⚠️ There are issues with expiring JWT token that I'm dealing with starting from v4.0.0.
4-
53
# .NET Core Push Notifications for Web, Android and iOS
64
Send notifications to:
75
-**iOS** - Apple Push Notifications (APN)
@@ -14,7 +12,7 @@ CorePush is a simple lightweight library with minimal overhead. Send notificatio
1412

1513
## NuGet Package
1614

17-
Version 4.0.0+ requires .NET7.0. For earler versions please use v3.1.1 of the library as it's targeting netstandard2.0.
15+
Version 4.0.0+ requires .NET7.0. For earlier versions please use v3.1.1 of the library as it's targeting netstandard2.0, though please note, it uses legacy FCM send API.
1816
The easiest way to get started with CorePush is to use [nuget](https://www.nuget.org/packages/CorePush) package.
1917

2018
dotnet cli:
@@ -33,13 +31,13 @@ To start sending Firebase messages you need to have Google Project ID and JWT Be
3331
1. Enable HTTP v1 API if you haven't done it yet. Go here for instructions: https://console.firebase.google.com/project/[YOUR_GOOGLE_PROJECT_ID e.g. my-project-123456]/settings/cloudmessaging/
3432
2. From that page you can also go to "Manage Service Accounts". Here is the link: https://console.cloud.google.com/iam-admin/serviceaccounts and select your project.
3533
3. Create Service Account with "Firebase Service Management Service Agent" role.
36-
4. Download Service Account JSON file.
37-
5. Use Utils from the tester project to generate JWT bearer token.
34+
4. Download Service Account JSON file and use it to configure FirebaseSender.
3835

3936
Sending messages is very simple so long as you know the format:
4037

4138
```csharp
42-
var fcm = new FirebaseSender(settings, httpClient);
39+
var firebaseSettingsJson = await File.ReadAllTextAsync('./link/to/my-project-123345-e12345.json');
40+
var fcm = new FirebaseSender(firebaseSettingsJson, httpClient);
4341
await fcm.SendAsync(payload);
4442
```
4543
Useful links:

0 commit comments

Comments
 (0)