예제 #1
0
 public void FireDateUtc()
 {
     var date = DateTime.UtcNow.AddDays(7);
     var notification = new UILocalNotification();
     notification.FireDate = date;
     Assert.IsTrue(date - notification.FireDate < TimeSpan.FromSeconds(1), "Date does not match!");
 }
예제 #2
0
    public void NewObject()
    {
        var obj = new UILocalNotification();

        Assert.AreNotEqual(IntPtr.Zero, obj.ClassHandle);
        Assert.AreNotEqual(IntPtr.Zero, obj.Handle);
    }
예제 #3
0
    public void CancelLocalNotification()
    {
        RegisterUserNotificationSettings(); //This requests permission

        var notification = new UILocalNotification
        {
            AlertBody = "WOOT!!",
            ApplicationIconBadgeNumber = 1,
            FireDate = DateTime.Now.AddMinutes(1),
        };
        UIApplication.SharedApplication.CancelLocalNotification(notification);
    }
예제 #4
0
    public void PresentLocationNotificationNow()
    {
        RegisterUserNotificationSettings(); //This requests permission

        var notification = new UILocalNotification
        {
            AlertBody = "WOOT!!",
            ApplicationIconBadgeNumber = 1,
        };
        UIApplication.SharedApplication.PresentLocationNotificationNow(notification);
    }
예제 #5
0
 public void CancelLocalNotification(UILocalNotification notification)
 {
     ObjC.MessageSend(Handle, "cancelLocalNotification:", notification.Handle);
 }
예제 #6
0
 public void ScheduleLocalNotification(UILocalNotification notification)
 {
     ObjC.MessageSend(Handle, "scheduleLocalNotification:", notification.Handle);
 }
예제 #7
0
 public void PresentLocationNotificationNow(UILocalNotification notification)
 {
     ObjC.MessageSend(Handle, "presentLocalNotificationNow:", notification.Handle);
 }
예제 #8
0
 public void CancelLocalNotification(UILocalNotification notification)
 {
     ObjC.MessageSend(Handle, "cancelLocalNotification:", notification.Handle);
 }
예제 #9
0
 public void ScheduleLocalNotification(UILocalNotification notification)
 {
     ObjC.MessageSend(Handle, "scheduleLocalNotification:", notification.Handle);
 }
예제 #10
0
 public void PresentLocationNotificationNow(UILocalNotification notification)
 {
     ObjC.MessageSend(Handle, "presentLocalNotificationNow:", notification.Handle);
 }
예제 #11
0
 public void ObjectSame()
 {
     var a = new UILocalNotification();
     var b = Runtime.GetNSObject<UILocalNotification>(a.Handle);
     Assert.AreSame(a, b);
 }
예제 #12
0
 public void NewObjectDispose()
 {
     var obj = new UILocalNotification();
     obj.Dispose();
 }