forked from xamarin/GoogleApisForiOSComponents
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ApiDefinition.cs
91 lines (69 loc) · 2.45 KB
/
ApiDefinition.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
using Foundation;
using ObjCRuntime;
namespace Google.GoogleCloudMessaging
{
[BaseType (typeof(NSObject), Name = "GCMConfig")]
partial interface Config
{
[Export ("receiverDelegate", ArgumentSemantic.Weak)]
IReceiverDelegate ReceiverDelegate { get; set; }
[Export ("logLevel", ArgumentSemantic.Assign)]
LogLevel LogLevel { get; set; }
// @property(nonatomic, readwrite, assign) BOOL useNewRemoteNotificationCallback;
[Export ("useNewRemoteNotificationCallback", ArgumentSemantic.Assign)]
bool UseNewRemoteNotificationCallback { get; set; }
[Static]
[Export ("defaultConfig")]
Config DefaultConfig { get; }
}
// typedef void (^GCMPubSubCompletion)(NSError *);
public delegate void PubSubCompletion (NSError error);
[BaseType (typeof(NSObject), Name = "GCMPubSub")]
partial interface PubSub
{
[Static]
[Export ("sharedInstance")]
PubSub SharedInstance { get; }
[Export ("subscribeWithToken:topic:options:handler:")]
void Subscribe (string token, string topic, NSDictionary options, PubSubCompletion handler);
[Export ("unsubscribeWithToken:topic:options:handler:")]
void Unsubscribe (string token, string topic, NSDictionary options, PubSubCompletion handler);
}
interface IReceiverDelegate
{
}
[Model, Protocol]
[BaseType (typeof(NSObject), Name = "GCMReceiverDelegate")]
partial interface ReceiverDelegate
{
[Export ("willSendDataMessageWithID:error:")]
void WillSendDataMessage (string messageID, NSError error);
[Export ("didSendDataMessageWithID:")]
void DidSendDataMessage (string messageID);
[Export ("didDeleteMessagesOnServer")]
void DidDeleteMessagesOnServer ();
}
// typedef void (^GCMServiceConnectCompletion)(NSError *);
public delegate void ServiceConnectCompletion (NSError error);
[BaseType (typeof(NSObject), Name = "GCMService")]
partial interface Service
{
[Static]
[Export ("sharedInstance")]
Service SharedInstance { get; }
[Export ("startWithConfig:")]
void Start (Config config);
[Export ("teardown")]
void Teardown ();
[Export ("appDidReceiveMessage:")]
bool AppDidReceiveMessage (NSDictionary message);
[Export ("connectWithHandler:")]
void Connect (ServiceConnectCompletion handler);
[Export ("disconnect")]
void Disconnect ();
[Export ("sendMessage:to:withId:")]
void SendMessage (NSDictionary message, string to, string msgId);
[Export ("sendMessage:to:timeToLive:withId:")]
void SendMessage (NSDictionary message, string to, long ttl, string msgId);
}
}