加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

vb.net – Google日历活动中缺少弹出式提醒

发布时间:2020-12-17 00:11:22 所属栏目:大数据 来源:网络整理
导读:我对Google Calendar v3界面感到困惑.似乎有些变化. 我有一些VBA代码可以创建事件并附加弹出提醒: If (sEventSettings.bSetReminder) Then Dim oReminders As New Data.Event.RemindersData() Dim oReminder As New Data.EventReminder() Dim listReminders
我对Google Calendar v3界面感到困惑.似乎有些变化.

我有一些VBA代码可以创建事件并附加弹出提醒:

If (sEventSettings.bSetReminder) Then
    Dim oReminders As New Data.Event.RemindersData()
    Dim oReminder As New Data.EventReminder()
    Dim listReminders As IList(Of Data.EventReminder) = New List(Of Data.EventReminder)()

    oReminder.Minutes = sEventSettings.iSetReminderTime
    oReminder.Method = "popup"

    listReminders.Add(oReminder)

    oReminders.UseDefault = False
    oReminders.Overrides = listReminders

    oEvent.Reminders = oReminders
End If

多年来它一直有效.我可以在在线日历中看到类似的内容:

现在,我正在使用Windows 10 / Microsoft Edge,我去看看我的事件,这就是我所看到的:

它已经改变了.如果我手动设置通知,它将只允许电子邮件.弹出提醒发生了什么?

根据Google Calendar Documentation弹出提醒仍然支持.所以我很困惑.

更新

如果查看EventReminder.Method属性的定义:

Namespace Google.Apis.Calendar.v3.Data
    Public Class EventReminder
        Implements IDirectResponseSchema

        Public Sub New()

        '
        ' Summary:
        '     The method used by this reminder. Possible values are: - "email" - Reminders
        '     are sent via email. - "sms" - Reminders are sent via SMS. These are only available
        '     for Google Apps for Work,Education,and Government customers. Requests to set
        '     SMS reminders for other account types are ignored. - "popup" - Reminders are
        '     sent via a UI popup.
        <JsonProperty("method")>
        Public Overridable Property Method As String
        '
        ' Summary:
        '     Number of minutes before the start of the event when the reminder should trigger.
        '     Valid values are between 0 and 40320 (4 weeks in minutes).
        <JsonProperty("minutes")>
        Public Overridable Property Minutes As Integer?
        '
        ' Summary:
        '     The ETag of the item.
        Public Overridable Property ETag As String
    End Class
End Namespace

因此,API希望您使用:

>电子邮件
>弹出窗口
>短信

然而,正如我们已经同意的那样,网络浏览器中的Google日历现在已经改变,它不再显示“提醒”部分,而是“通知”部分.对我来说,它列出:

>电子邮件
>通知

因此,我仍然不清楚如何在VB.NET中以编程方式创建事件,并使用相应的弹出提醒.

请求帮助

答案仍然无法帮助我.您无法再创建日历事件并将提醒对象方法设置为“弹出窗口”.似乎必须使用“通知”,我无法弄清楚如何使用V3 API以编程方式执行此操作.

进一步的研究

我手动使用Google Chrome创建了一个日历,并添加了一个活动.然后我添加了一个通知设置为1天.我将此日历导出为ICS格式:

BEGIN:VEVENT
DTSTART:20170420T143000Z
DTEND:20170420T153000Z
DTSTAMP:20170307T102059Z
UID:xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
CREATED:20170307T102022Z
DESCRIPTION:This is a test
LAST-MODIFIED:20170307T102045Z
LOCATION:Home
SEQUENCE:0
STATUS:CONFIRMED
SUMMARY:Test
TRANSP:OPAQUE
BEGIN:VALARM
ACTION:DISPLAY
DESCRIPTION:This is an event reminder
TRIGGER:-P1D
END:VALARM
END:VEVENT

最后请注意这一点:

BEGIN:VALARM
ACTION:DISPLAY
DESCRIPTION:This is an event reminder
TRIGGER:-P1D
END:VALARM

根据Wikipedia,它声明事件可以有一些VALARM代码.

如果我将此ICS文件导入Microsoft Outlook中的新日历,则将其正确设置为一天:

然而,当我按照我的预期导出我正确的事件时,没有VALARM对象存在.然而,我已正确创建它们:

If (sEventSettings.bSetReminder) Then
    Dim oReminders As New Data.Event.RemindersData()
    Dim oReminder As New Data.EventReminder()
    Dim listReminders As IList(Of Data.EventReminder) = New List(Of Data.EventReminder)()

    oReminder.Minutes = sEventSettings.iSetReminderTime
    oReminder.Method = "popup"

    listReminders.Add(oReminder)

    oReminders.UseDefault = False
    oReminders.Overrides = listReminders

    oEvent.Reminders = oReminders
End If

他们没有被Google Calendar V3 API所尊重.我认为这里的问题是该功能被破坏了.然后将其从弹出窗口重命名为通知,而不是使用这些弹出警报创建事件的更新支持.我正在使用最新的包管理器下载.几天前我和Google一起提出了一个关于它的issue.

我不相信这是我的错误.鉴于用户群的沉默,我得出结论,没有人实际上使用API??来创建事件和设置提醒.或者,可能有其他用户现在已经影响了代码并且不知道此问题.

但如果你知道它,并且可以复制我的问题/或者知道一个实用的解决方案,请告诉我.谢谢.

哦亲爱的,经过这么久,我不得不吃一些不起眼的馅饼……

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读