コード例 #1
0
        /*
         * //This is the arlert notification
         * //
         * //
         */
        public void alertNotification(UIApplication application, NSDictionary userInfo)
        {
            Console.WriteLine("Application" + application.ToString());
            //Console.WriteLine("received userInfo.Decription :"+ userInfo.Description);
            Console.WriteLine("received userInfo.ToString received remote : " + userInfo.ToString());
            var title = userInfo["Title"];
            var body  = userInfo["Body"];

            Console.WriteLine("title : " + title);
            Console.WriteLine("body : " + body);


            //notification to Device
            UILocalNotification notification = new UILocalNotification();
            var fireDate = DateTime.Now.AddSeconds(3);

            notification.FireDate = (NSDate)fireDate;

            //---- configure the alert stuff
            notification.AlertAction = body.ToString();
            notification.AlertBody   = title.ToString();

            //---- modify the badge
            notification.ApplicationIconBadgeNumber = 1;

            //---- set the sound to be the default sound
            notification.SoundName = UILocalNotification.DefaultSoundName;

            //				notification.UserInfo = new NSDictionary();
            //				notification.UserInfo[new NSString("Message")] = new NSString("Your 1 minute notification has fired!");

            //---- schedule it
            new UIAlertView("hi this is title", "hi this is message", null, "OK", null).Show();
            UIApplication.SharedApplication.ScheduleLocalNotification(notification);
        }
コード例 #2
0
        public override bool OpenUrl(UIApplication app, NSUrl url, NSDictionary options)
        {
            System.Console.WriteLine("OpenUrl 3");
            System.Console.WriteLine("app = " + app.ToString());
            System.Console.WriteLine("url = " + url.ToString());
            System.Console.WriteLine("options = " + options.ToString());

            string messageStr = url.ToString().Split(new char[] { '?' }) [1];

            System.Console.WriteLine("messageStr = " + messageStr);
            return(true);
        }