public async Task SendConditionMessage() { var app = AGConnectApp.Create(new AppOptions() { ClientId = "11111111", ClientSecret = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" }); var msg = AGConnectMessaging.GetMessaging(app); await msg.SendAsync(new Message() { Notification = new Notification() { Title = "Test Message", Body = "Detail Message", }, Android = new AndroidConfig() { Notification = new AndroidNotification() { ClickAction = ClickAction.OpenUrl("http://example.com") } }, Token = new string[] { "yyyyyyyyyyyyyyyyyy" } }); }
public async Task GetTopicList() { var app = AGConnectApp.Create(new AppOptions() { ClientId = "11111111", ClientSecret = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" }); var msg = AGConnectMessaging.GetMessaging(app); var token = "sdjlfjiwekfnskdjfksdfjskdfjsdf"; TopicListResponse resp = await msg.GetTopicListAsync(token); }
public async Task SubscribeTopic() { var app = AGConnectApp.Create(new AppOptions() { ClientId = "11111111", ClientSecret = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" }); var msg = AGConnectMessaging.GetMessaging(app); var tokens = new List <string>() { "sdjlfjiwekfnskdjfksdfjskdfjsdf" }; var topic = "News"; await msg.SubscribeToTopicAsync(tokens.AsReadOnly(), topic); }
public async Task SendTopicMessage() { var app = AGConnectApp.Create(new AppOptions() { ClientId = "11111111", ClientSecret = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" }); var msg = AGConnectMessaging.GetMessaging(app); await msg.SendAsync(new Message() { Notification = new Notification() { Title = "Test Message", Body = "Detail Message" }, Topic = "News", Token = new string[] { "yyyyyyyyyyyyyyyyyy" } }); }