Example #1
0
        private static async void Send(Options options)
        {
            JustPush push = new JustPush();

            switch (options.Type)
            {
                case DeviceType.WinPhone:
                    var result = await push.Send(new WindowsPhoneTile()
                    {
                        MessageId = Guid.NewGuid(),
                        BackgroundImage = "for_test.jpg",
                        Count = 11,
                        BackContent = "Hello from PushAkka",
                        Uri = options.Token
                    });
                    break;
                case DeviceType.Windows:
                    break;
                case DeviceType.Android:
                    break;
                case DeviceType.Apple:
                    break;
                default:
                    throw new ArgumentOutOfRangeException();
            }
        }
Example #2
0
        static void Main(string[] args)
        {
            var options = new Options();
            if (Parser.Default.ParseArguments(args, options))
            {
                Send(options);
                Console.ReadLine();
            }
            // For debug only
#if DEBUG
            else
            {
                for (int i = 0; i < 1; i++)
                {
                    Send(new Options()
                    {
                        Token = "",
                        Text = i.ToString(),
                        Type = DeviceType.WinPhone
                    });
                }
                Console.ReadLine();
            }
#endif
        }