Tag: ios app extension

iOS AlertView应用程序扩展

我正在使用自定义keyboard (iOS App Extension) 。 我有一个UICollectionView在我的Keyboard Layout ,所以当一个item被选中,我想显示一个message (例如UIAlerView )。 这是我的代码: – (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{ … UIAlertController * alert= [UIAlertController alertControllerWithTitle:@"My Title" message:@"Enter User Credentials" preferredStyle:UIAlertControllerStyleAlert]; [self presentViewController:alert animated:YES completion:nil]; } 我得到这个错误: 'Feature not available in extensions of type com.apple.keyboard-service' 所以…有什么办法显示来自App Extension的message ? 编辑: 这是一个例子。 IKEA Emoticons Keyboard显示一条消息(如select一个项目后的Android Toast )。 我也试过这个库: iOS Toast图书馆

UNNotificationServiceExtension有时不显示图像

我创build了UNNotificationServiceExtension子类来显示通知中的远程附件。 随机,附件不显示。 问题很难重现,但有些用户报告说,在收到带有图像附件的远程通知后,他们看不到图像。 经过一些debugging之后,我遇到了这个问题一次。 我注意到downloadTask()有空location但response的状态码是200 。 override func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) { // … // Dowload remote media file URLSession.shared.downloadTask(with: attachmentUrl) { (location: URL?, response: URLResponse?, error: Error?) in // … self.contentHandler!(self.bestAttemptContent!) }.resume() } 而且, errorvariables包含: "Error Domain=NSPOSIXErrorDomain Code=2 \"No such file or directory\" UserInfo={NSErrorFailingURLKey=https://<url_to_media_attachment>, NSErrorFailingURLStringKey=https://<url_to_media_attachment>}" 似乎附件获取正确,但URLSession丢失获取附件的location URL。 我不知道这个问题的原因是什么。 […]

iOS扩展 – 致命exception:com.firebase.core默认的应用程序已被configuration

iOS扩展 – 致命exception:com.firebase.core默认的应用程序已被configuration。 我在viewDidLoad()方法中运行Fir.configure(),一些事件传递给Firebase。 有人可以帮我解决这个问题..谷歌不够友好。 PS:是的,我在Firebase控制台中创build了第二个.plist和第二个应用程序。 PPS:是的,我为每个GoogleServices plistselect了正确的目标 我正在寻求解决scheme..

iOS10 iMessage:无法使用MSConversation将数据插入到iMessage中

在我的项目中,我添加了iMessage Extension但我无法从UITableview发送选定的数据(需要发送选定的行数据) 声明 var savedConversation: MSConversation? 我想发送文本时,用户didselectRow – didselectRow ,但它没有抛出任何错误,甚至没有去MSConversation完成块 func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { let message = MSMessage() let layout = MSMessageTemplateLayout() layout.caption = "Win Notification"//post.title layout.subcaption = "Can share now through win" layout.trailingSubcaption = "share" message.url = "http://.." message.layout = layout savedConversation?.insert(message, completionHandler: { (error) in if error == nil […]

如何在iOS8自定义键盘上添加工具栏?

我的问题是写图片。 我真的需要你帮忙 也许inputAccessoryView,inputAccessoryViwController可以使用,但我真的不知道。 非常感谢!

从SiriKit的INExtension启动应用程序

我想用SiriKit开始锻炼。 开始锻炼需要从应用程序扩展中打开主应用程序。 Apple为INStartWorkoutIntentHandling处理程序提供的样板INStartWorkoutIntentHandling是 func handle(startWorkout startWorkoutIntent: INStartWorkoutIntent, completion: (INStartWorkoutIntentResponse) -> Void) { let userActivity = NSUserActivity(activityType: NSStringFromClass(INStartWorkoutIntent)) let response = INStartWorkoutIntentResponse(code: .success, userActivity: userActivity) completion(response) } 我怎样才能从这里打开我自己的应用程序? 就像myapp://workout?action=start&name=pushups 这个答案似乎并不相关,因为我没有这个扩展types的extensionContext属性的UIViewController 。 最后一个相关位:对于其他操作(暂停,结束)我宁愿不打开主应用程序,而只是暂停在主应用程序中运行的锻炼。 我可以使用类似的自定义url暂停它,但这会打开应用程序,这是一个额外的不必要的步骤。 任何好的方式来告诉主要的应用程序从INExtension采取特定的行动,而无需打开应用程序?

在iOS 8 Today Extension中获取parse.com用户数据时出现exception

我正在尝试获取PFUser的PFObjects列表,以显示在iOS 8 Today窗口小部件中。 在Parse的这篇博客文章之后,我已经在Xcode的主应用程序和扩展中启用了相同的App Groups和Keychain Sharing。 我也启用了我的主要应用程序的AppDelegate和我今天的扩展viewDidLoad以下: [Parse enableLocalDatastore]; [Parse enableDataSharingWithApplicationGroupIdentifier:@"group.com.me.myapp" containingApplication:@"com.me.myapp"]; [Parse setApplicationId:@"myAppId" clientKey:@"myClientId"]; 在widgetPerformUpdateWithCompletionHandler ,我构build并执行了我的查询: – (void) widgetPerformUpdateWithCompletionHandler:(void (^)(NCUpdateResult))completionHandler { PFQuery *query = [PFQuery queryWithClassName:@"Note"]; [query whereKey:@"User" equalTo:[PFUser currentUser]]; [query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) { if (!error) { // check for difference between current and new data if([self hasNewData:objects]) { // fresh data […]

openURL在共享扩展中不起作用

尝试使用[self.extensionContext openURL:… completionHandler:…]; 在iOS 8共享扩展中打开包含的应用程序永远不会打开应用程序,并始终调用成功=否的完成处理程序。 这是与行动扩展相同的问题,但我认为共享扩展能够打开包含应用程序比行动扩展更合理。 共享扩展的意义在于上传一个潜在的大量数据,唯一不用打开应用程序的方法是通过NSURLSession ,它只能进行HTTP(S)上传。 但是应用程序可能希望通过与HTTP(S)上传不同的机制来共享内容。 苹果文档没有声明openURL…不能用于任何特定types的扩展。 很难知道这是一个错误还是有意的行为。 没有关于这方面的官方信息。

在iOS 8中使用自定义键盘可以使用新字符吗?

在iOS 8中,Apple赋予开发人员创build自定义键盘的能力。 在文档中 ,苹果声明如果你想支持iOS目前不支持的语言,你应该创build一个新的键盘。 因此,如果您能够支持新的语言,是否可以创build一个包含新的表情符号的键盘? 我会假设,苹果公司说,你可以支持一种新的语言,他们会希望有涉及到自定义字符。 如果包含自定义字符是可能的,其他设备(即使只有运行iOS 8的其他设备)将如何显示新字符?

如何检测应用程序扩展在iOS 8上的应用程序启用?

我正在开发iOS 8testing版的自定义键盘,如果我的自定义键盘没有启用,我想告诉用户如何启用它在包含应用程序,有没有什么办法来检测应用程序扩展启用?