ios - iOS 9.3 中的 Google+ 正在挂断

标签 ios google-plus uiactivityviewcontroller

<分区>

我正在使用 UIActivityViewController 在我的应用程序中使用共享选项;它在 iOS 9.2 中工作正常,Google+ 共享选项在 iOS 9.3 中不工作

为了确认这一点,我使用 UIActivityViewController 下载了其他具有共享选项的应用,但问题是该应用的整个 UI 都挂了。

我该如何解决这个问题?

编辑 1: 代码:

        NSURL * URL =  [[NSURL alloc]initWithString:@"http://domainName/message.php?"];

        NSMutableURLRequest* request = [NSMutableURLRequest requestWithURL:URL cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:60.0];
        [request setHTTPMethod:@"GET"];

        NSString *tempEmailId  = (NSString *)[[NSUserDefaults standardUserDefaults] objectForKey:CURRENT_USER_EMAIL_ID_UD_KEY];
        NSString *tempPassword = (NSString *)[[NSUserDefaults standardUserDefaults] objectForKey:CURRENT_USER_PASSWORD_UD_KEY];

        NSString *basicAuthCredentials = [NSString stringWithFormat:@"%@:%@", tempEmailId, tempPassword];
       [request setValue:[NSString stringWithFormat:@"Basic %@", AFBase64EncodedStringFromString(basicAuthCredentials)] forHTTPHeaderField: @"Authorization"];
       //NSLog(@"request %@\n",request);
       [[[NSURLSession sharedSession] dataTaskWithRequest:request completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
        if (data != nil) {
            NSString *responseString = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
            NSArray * activityItems = @[responseString];
            dispatch_async(dispatch_get_main_queue(), ^{
                activityViewController = [[UIActivityViewController alloc] initWithActivityItems:activityItems applicationActivities:activities];
                [activityViewController setValue:@"Today's Recommendations" forKey:@"subject"];
                activityViewController.excludedActivityTypes = @[UIActivityTypePostToFacebook];

[activityViewController setCompletionWithItemsHandler:
                 ^(NSString *activityType, BOOL completed, NSArray *returnedItems, NSError *activityError) {
                     dispatch_async(dispatch_get_main_queue(), ^{
                     NSLog(@"activityType: %@, returnedItems: %@, activityError: %@", activityType, returnedItems, activityError.userInfo);

                     if (completed)
                     {
                         NSLog(@"The Activity: %@ was completed", activityType);
                     }
                    else
                     {
                         NSLog(@"The Activity: %@ was NOT completed", activityType);
                     }
                     });

                 }];

                if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
                    [self presentViewController:activityViewController animated:YES completion:nil];
                }
//if iPad
                else {
                    activityViewController.modalPresentationStyle = UIModalPresentationPopover;

                    // activityViewController.popoverPresentationController.sourceView = sender;

                    activityViewController.popoverPresentationController.sourceView = self.view;

                    if ([sender isKindOfClass:[UIButton class]]) {
                        UIButton *btn = (UIButton *)sender;
                        activityViewController.popoverPresentationController.sourceRect = btn.frame;
                    }

                    [self presentViewController:activityViewController animated:YES completion:nil];
                }
            });
        }
    }] resume];

注意::Mail、Twitter 和 Evernote 正在运行。只有 Google+ 挂断了。

编辑 2::我不太清楚,但我认为 - 它与开放 URL 无关。如果相关,请让我知道如何?

最佳答案

iOS 9.3 中出现了一些 JavaScript 问题。它在下面的文章中明确提到。这不是代码问题,而是 Apple webview 问题。检查随附的报价和 URL 以供引用。

iOS 9.3 freezes when clicking a link in an email

One of the most common problems ... affects links in emails. When using iOS 9.3, some people have found that by clicking a link in the Mail email app, the iPhone or iPad will become unresponsive.

A temporary solution is to turn off JavaScript in the Safari app by going to Settings > Safari > Advanced then turn off the toggle next to JavaScript.

This solution isn't ideal, and thankfully Apple has pushed out a new update, iOS 9.3.1 which according to the release notes "fixes an issue that caused apps to be unresponsive after tapping on links in Safari and other apps."

To download and install the update open up Settings and select General then Software Update. You should now be able to turn JavaScript back on and can click on links in emails and other messages without iOS 9.3 freezing.

引用链接:iOS 9.3 Problems

关于ios - iOS 9.3 中的 Google+ 正在挂断,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36614532/

相关文章:

ios - 如何在 iOS 10 中导出 Apple 新的 RAW 照片格式 .dng?

ios - 如何防止 UITextField 中小数点后的数字超过 2 个?

ios - 沙盒 "Apple ID Password"永远登录警报

google-plus - 如何在 Twitter 等弹出窗口中获得 Google plus 共享?

ios - UIActivityViewController 在 iPad 上不工作? iOS 8

ios - 从 UIDocumentBrowserViewController 获取 UIActivityViewController 的 sourceRect

ios - 如何使用iPhone屏幕创建前置摄像头 "flash"效果

ios - Swift:将 UIImage 保存并检索到 CoreData 中

php - 从登录的社交网络获取访客姓名

ios - Swift - 使用未声明的类型 'GTMOAuth2Authentication'