【发布时间】:2013-10-15 23:57:57
【问题描述】:
我有一个发出日历事件的 Web 服务:http://calevent.herokuapp.com。在 iOS 上,该 URL 将打开一个日历弹出窗口,其中包含事件详细信息和一个允许用户添加到她的日历的按钮。在我的主要 Android 设备上,运行 Android 4.1 的 Galaxy SIII,它会触发正常的文件下载。所需的行为类似于 iOS。
该服务设置了两个重要的标头:
Content-Type: text/calendar; charset=utf-8Content-Disposition: inline; filename="event.ics"
我已经解码了我设备的日历应用程序“S Planner”的清单。它没有为text/calendar 数据定义任何BROWSABLE 意图过滤器。它确实定义了一些谷歌日历特有的东西,我不确定我是否可以(ab)使用。
这里来自香草Calendar app:
<activity android:name="GoogleCalendarUriIntentFilter" android:label="@string/app_label"
android:theme="@android:style/Theme.NoDisplay"
android:configChanges="orientation|keyboardHidden">
<intent-filter
android:priority="50">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http" android:host="www.google.com" android:pathPrefix="/calendar/event" />
<data android:scheme="https" android:host="www.google.com" android:pathPrefix="/calendar/event" />
<data android:scheme="http" android:host="www.google.com" android:pathPattern="/calendar/hosted/.*/event" />
<data android:scheme="https" android:host="www.google.com" android:pathPattern="/calendar/hosted/.*/event" />
</intent-filter>
</activity>
这是一个死胡同吗?还有其他不会影响用户体验的解决方案吗?
【问题讨论】:
标签: android http calendar icalendar