- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
所以,我正在为移动设备开发一个 Xamarin 项目,我正在使用 EKEventStore API 来创建事件,它在 iOS 8 和 9 上运行良好。但是在 iOS 10 上请求 EKEVentStore 访问时出了点问题。
下面的代码在 iOS 8 和 9 上运行良好,但在 iOS 10 上它崩溃了,并且没有针对此错误给出具体消息。
Apple 似乎对在 iOS 10 中收集此权限做了一些更改。
有人遇到过同样的问题或了解有助于解决问题的相关信息吗?
谢谢!
EKEntityType type = EKEntityType.Event;
Store = new EKEventStore();
EKAuthorizationStatus status = EKEventStore.GetAuthorizationStatus(type);
if (status != EKAuthorizationStatus.Authorized)
{
if (status == EKAuthorizationStatus.NotDetermined)
{
Store.RequestAccess(type, (bool granted, NSError error) =>
{
//Crashes before entering here
});
return;
}
else
{
//Denied
return;
}
}
输出:
2016-09-30 17:16:25.739 MyApp[3156:115989] critical: Native stacktrace:
2016-09-30 17:16:25.740 MyApp[3156:115989] critical: 0 libmonosgen-2.0.dylib 0x0524e64d mono_handle_native_sigsegv + 317
2016-09-30 17:16:25.741 MyApp[3156:115989] critical: 1 libmonosgen-2.0.dylib 0x052a6321 sigabrt_signal_handler + 161
2016-09-30 17:16:25.741 MyApp[3156:115989] critical: 2 libsystem_platform.dylib 0x07205ebb _sigtramp + 43
2016-09-30 17:16:25.742 MyApp[3156:115989] critical: 3 ??? 0xffffffff 0x0 + 4294967295
2016-09-30 17:16:25.742 MyApp[3156:115989] critical: 4 libsystem_kernel.dylib 0x071e28bc abort_with_payload + 38
2016-09-30 17:16:25.743 MyApp[3156:115989] critical: 5 TCC 0x003ab621 __CRASHING_DUE_TO_PRIVACY_VIOLATION__ + 236
2016-09-30 17:16:25.743 MyApp[3156:115989] critical: 6 TCC 0x003ab535 __CRASHING_DUE_TO_PRIVACY_VIOLATION__ + 0
2016-09-30 17:16:25.743 MyApp[3156:115989] critical: 7 TCC 0x003ae6b9 __tccd_send_block_invoke + 292
2016-09-30 17:16:25.744 MyApp[3156:115989] critical: 8 libxpc.dylib 0x0718c79c _xpc_connection_reply_callout + 45
2016-09-30 17:16:25.745 MyApp[3156:115989] critical: 9 libxpc.dylib 0x07183a97 _xpc_connection_call_reply + 32
2016-09-30 17:16:25.746 MyApp[3156:115989] critical: 10 libdispatch.dylib 0x06ea36ef _dispatch_client_callout + 14
2016-09-30 17:16:25.746 MyApp[3156:115989] critical: 11 libdispatch.dylib 0x06e88c60 _dispatch_queue_override_invoke + 777
2016-09-30 17:16:25.747 MyApp[3156:115989] critical: 12 libdispatch.dylib 0x06e8a4bc _dispatch_root_queue_drain + 384
2016-09-30 17:16:25.748 MyApp[3156:115989] critical: 13 libdispatch.dylib 0x06e8a2d4 _dispatch_worker_thread3 + 134
2016-09-30 17:16:25.748 MyApp[3156:115989] critical: 14 libsystem_pthread.dylib 0x07215d6e _pthread_wqthread + 1070
2016-09-30 17:16:25.749 MyApp[3156:115989] critical: 15 libsystem_pthread.dylib 0x0721591a start_wqthread + 34
2016-09-30 17:16:25.750 MyApp[3156:115989] critical:
=================================================================
Got a SIGABRT while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================
最佳答案
对于事件,您需要在您的 info.plist 中添加正确的 key ,在本例中为 NSCalendarsUsageDescription
,其中的值是您请求此类权限的原因的简短描述。
希望这能解决您的问题,我遇到了完全相同的问题(也是 Xamarin)并且这解决了它。
关于c# - EKEventStore 访问请求在 iOS 10 上崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39800046/
我想知道使用 EKEventstore 的单个实例是否安全在不同的线程上?我在任何地方都找不到关于它的任何信息。 我打算得到一个独特的 EKCalendar每个线程上的实例。 最佳答案 EKEvent
我创建了一个 EKEventStore ,确保我有访问权限,创建一个事件并将其持久化。我节省了eventIdentifier一切都很好。这是一个经常性的日历条目。 接下来,我想从重复事件中删除几天。您
我刚刚在我的程序中遇到了一个错误,这让我很困惑。我在我的应用程序中向 iPhone 日历添加了几个事件。我发现当我收到“未设置结束日期”时。调用 saveEvent:span:error: 时出错,所
我根本无法保存我的提醒/事件。但是,我已被授予使用提醒的权限(我检查了设置)。我已经打印出错误,它说 That event does not belong to that event store. 这
var eventStore: EKEventStore? @IBAction func bbbbbbb(sender: UIButton) { if eventStore == ni
我有一个奇怪的问题,我的 EKEventStore 实例不包含任何源。 奇怪的是,在我的一些手机中(获取 EKSourceTypeLocal 并创建日历)而在一些手机中却不能,我花了很多时间更改日历设
我对 EKCalendar 的 calendarIdentifier 属性有疑问。此 ID 在全局级别或每个源级别上是唯一的吗?例如。我可以安全地将 calendarIdentifier 存储在我的应
根据 Apple 的日历和事件编程指南: 在 iOS 6 及更高版本上,我们必须在事件存储初始化后通过 requestAccessToEntityType:completion: 方法请求访问权限以使
我有一个简单的函数来请求访问以在日历中添加事件。 typealias BoolCallback = (Bool) -> () class SimpleCalendar { let store:
我想从我的应用中的特定日历中获取所有事件。我在我的应用程序中创建了日历和测试事件(需要 iOS 5.0 或更高版本才能创建自定义日历)。如果我在我的设备上运行该应用程序,然后检查系统日历应用程序,那么
我已使用以下方式注册日历更改通知: - (void) registerForLocalCalendarChanges { [[NSNotificationCenter defaultCenter] a
我在存储来自 EKEventStore 查询的事件时遇到问题。例如,当使用以下代码时,events 始终为 nil: __block NSArray *events = [[NSArray alloc
我的应用程序中有一个非常奇怪的错误。尝试使用 saveEvent 保存事件会导致应用以 3 种方式之一继续: 一切都正确无误地保存 应用程序崩溃并出现unrecognized selector sen
我想创建 EKEventStore 类的三个实例来存储我的 3 个不同的事件, EKEventStore *event = [EKEventStore alloc] init]; EKEventSto
我正在尝试检查我的应用程序是否被授予访问用户提醒的权限,方法是: EKEventStore *store = [[EKEventStore alloc] init]; EKAuthorizationS
我们正在我们的应用程序中实现“同步到日历”功能。我们的同步过程涉及我们从服务器端获取的事件,我们希望将这些事件复制到 iPhone 日历。目前我不确定我们为此同步编写的方法是否解决了我们期望的所有可能
我的 iOS 应用程序有一个奇怪的问题,在全新安装后,如果我尝试添加日历事件(在接受 native 日历权限提示后),我的 eventStore 单例永远不会显示任何可用的日历,并且 defaultC
我正在尝试使用 eventsMatchingPredicate: 从 EKEventStore 的实例中检索一天的所有事件,但据我所知,NSDate 对象默认设置为 GMT,而 EKEventStor
我构建了一个从日历中获取 ekevents 的应用程序(通过 EKEventStore predicateForEventsWithStartDate:endDate:calendars:)并将应用程
你好,我在 iCloud 上的特定日历中保存了一些 EKEvent,我想检索其中一些具有特定标题的 EKEvent,这可能吗?我看到有这个方法: eventsMatchingPredicate 但是只
我是一名优秀的程序员,十分优秀!