Пример #1
0
        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" }
            });
        }
Пример #2
0
        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);
        }
Пример #3
0
        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);
        }
Пример #4
0
        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" }
            });
        }