forked from Redth/PushSharp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBlackberryConfiguration.cs
52 lines (43 loc) · 1.74 KB
/
BlackberryConfiguration.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
using System;
namespace PushSharp.Blackberry
{
public class BlackberryConfiguration
{
const string SEND_URL = "https://pushapi.eval.blackberry.com/mss/PD_pushRequest";
public BlackberryConfiguration ()
{
SendUrl = SEND_URL;
}
public BlackberryConfiguration (string applicationId, string password)
{
ApplicationId = applicationId;
Password = password;
SendUrl = SEND_URL;
}
public string ApplicationId { get; set; }
public string Password { get; set; }
public string Boundary { get { return "ASDFaslkdfjasfaSfdasfhpoiurwqrwm"; } }
/// <summary>
/// Push Proxy Gateway (PPG) Url is used for submitting push requests
/// Default value is BIS PPG evaluation url
/// https://pushapi.eval.blackberry.com/mss/PD_pushRequest
/// </summary>
public string SendUrl { get; private set; }
/// <summary>
/// Overrides SendUrl with any PPG url: BIS or BES
/// </summary>
/// <param name="url">Push Proxy Gateway (PPG) Url,
/// For BIS,it's PPG production url is in format: http://cpxxx.pushapi.na.blackberry.com
/// where xxx should be replaced with CPID (Content Provider ID)</param>
public void OverrideSendUrl(string url)
{
if (!string.IsNullOrWhiteSpace(url))
{
if (url.EndsWith("pushapi.na.blackberry.com", StringComparison.InvariantCultureIgnoreCase) ||
url.EndsWith("pushapi.eval.blackberry.com", StringComparison.InvariantCultureIgnoreCase))
url = url + @"/mss/PD_pushRequest";
}
SendUrl = url;
}
}
}