Exemple #1
0
        public static async Task <NotificationResponse> ParaUm(string titulo, string texto, string id)
        {
            notification.IncludePlayerIds.Clear();
            notification.IncludedSegments.Clear();

            notification.Headings.Text = titulo;
            notification.Contents.Text = texto;
            notification.IncludePlayerIds.Add(id);

            return(await PushNotification.Push(notification));
        }
Exemple #2
0
        static void Main(string[] args)
        {
            string                  filepath         = "C://AppPushCertificates.p12";
            string                  pwd              = "your certificate passwords";
            PushNotification        pushNotification = new PushNotification(PushNotificationType.Distribution, filepath, pwd);
            PushNotificationPayload payload          = new PushNotificationPayload();

            payload.deviceToken = "dc67b56c eb5dd9f9 782c37fd cfdcca87 3b7bc77c 3b090ac4 c538e007 a2f23a24";
            payload.badge       = 56789;
            payload.sound       = "default";
            payload.message     = "This message was pushed by C# platform.";
            pushNotification.Push(payload);
        }
Exemple #3
0
        private static void Main(string[] args)
        {
            PushNotification product = new PushNotification();

            product.RegisterObserver(new ApplePush());
            product.RegisterObserver(new FirebasePush());
            product.RegisterObserver(new SignalRPush());

            while (true)
            {
                Console.WriteLine("Please enter your message: ");
                string msg = Console.ReadLine();
                product.Push(msg);
            }
        }