Skip to content

Commit ed05abb

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents 6f250a6 + eab36a4 commit ed05abb

File tree

1 file changed

+0
-27
lines changed

1 file changed

+0
-27
lines changed

README.md

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -121,33 +121,6 @@ public class AppleNotification
121121
```
122122
Use `[JsonProperty("alert-type")]` attribute to serialize C# properties into JSON properties with dashes.
123123

124-
# Setup for ASP.NET Core with Dependency Injection
125-
126-
Both `ApnSender` and `FirebaseSender` have dependencies that need to be registered in order to enable DI.
127-
128-
1. Register HttpClient in Startup.cs. This will allow injection of HttpClient into the FCM and APN senders:
129-
130-
```
131-
services.AddHttpClient<FirebaseSender>();
132-
services.AddHttpClient<ApnSender>();
133-
```
134-
135-
2. Register settings object as a singleton:
136-
137-
If you've added `ApnSettings` and `FirebaseSettings` into a configuration section, you can bind section directly to settings object from `IConfiguration` available in Startup.cs:
138-
139-
```
140-
var section = configuration.GetSection("ApnSettings");
141-
var settings = new AppSettings();
142-
section.Bind(settings);
143-
```
144-
145-
Add settings to services:
146-
```
147-
services.AddSingleton(apnSettings);
148-
services.AddSingleton(fcmSettings);
149-
```
150-
151124
# MIT License
152125

153126
Copyright (c) 2020 Andrei M

0 commit comments

Comments
 (0)