1
- using System ;
1
+ // Copyright 2019, Google Inc. All rights reserved.
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+
15
+ using System ;
2
16
using System . Collections . Generic ;
3
- using System . Collections . Immutable ;
4
17
using System . IO ;
5
18
using System . Net . Http ;
6
19
using System . Threading ;
@@ -34,7 +47,7 @@ public sealed class InstanceIdClient
34
47
/// Initializes a new instance of the <see cref="InstanceIdClient"/> class.
35
48
/// </summary>
36
49
/// <param name="clientFactory">A default implentation of the HTTP client factory.</param>
37
- /// <param name="credential">A GoogleCredential.</param>
50
+ /// <param name="credential">An instance of the <see cref=" GoogleCredential"/> GoogleCredential class .</param>
38
51
/// <param name="projectId">The Project Id for FCM Messaging.</param>
39
52
public InstanceIdClient ( HttpClientFactory clientFactory , GoogleCredential credential , string projectId )
40
53
{
@@ -56,7 +69,7 @@ public InstanceIdClient(HttpClientFactory clientFactory, GoogleCredential creden
56
69
/// <summary>
57
70
/// Index of the registration token to which this error is related to.
58
71
/// </summary>
59
- /// <param name="topic">The topic name to subscribe to.</param>
72
+ /// <param name="topic">The topic name to subscribe to. /topics/ will be prepended to the topic name provided if absent. </param>
60
73
/// <param name="registrationTokens">A list of registration tokens to subscribe.</param>
61
74
/// <returns>The response produced by FCM topic management operations.</returns>
62
75
public async Task < TopicManagementResponse > SubscribeToTopic ( string topic , List < string > registrationTokens )
@@ -78,7 +91,7 @@ public async Task<TopicManagementResponse> SubscribeToTopic(string topic, List<s
78
91
/// <summary>
79
92
/// Index of the registration token to which this error is related to.
80
93
/// </summary>
81
- /// <param name="topic">The topic name to unsubscribe from.</param>
94
+ /// <param name="topic">The topic name to unsubscribe from. /topics/ will be prepended to the topic name provided if absent. </param>
82
95
/// <param name="registrationTokens">A list of registration tokens to unsubscribe.</param>
83
96
/// <returns>The response produced by FCM topic management operations.</returns>
84
97
public async Task < TopicManagementResponse > UnsubscribeFromTopic ( string topic , List < string > registrationTokens )
@@ -99,7 +112,7 @@ public async Task<TopicManagementResponse> UnsubscribeFromTopic(string topic, Li
99
112
100
113
private async Task < TopicManagementResponse > SendInstanceIdRequest ( string topic , List < string > registrationTokens , string path )
101
114
{
102
- string url = string . Format ( "%s/%s" , this . iidHost , path ) ;
115
+ string url = $ " { this . iidHost } / { path } " ;
103
116
var body = new InstanceIdServiceRequest
104
117
{
105
118
Topic = this . GetPrefixedTopic ( topic ) ,
@@ -159,6 +172,7 @@ private class InstanceIdServiceRequest
159
172
public List < string > RegistrationTokens { get ; set ; }
160
173
}
161
174
175
+ /*
162
176
private class InstanceIdServiceErrorResponse
163
177
{
164
178
[JsonProperty("error")]
@@ -170,4 +184,5 @@ private class InstanceIdServiceResponse
170
184
[JsonProperty("results")]
171
185
public List<JObject> Results { get; set; }
172
186
}
187
+ */
173
188
}
0 commit comments