Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google+ in iOS 9.3 is hanging up [duplicate]

I am using the share option in my app using UIActivityViewController; it's working fine in iOS 9.2 and Google+ share option is not working in iOS 9.3

To confirm this, I had downloaded other app which has the share option using UIActivityViewController, and the issue is the entire UI of the app is hanging up.

How can I resolve this issue?

Edit 1: code:

        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];

NOTE:: Mail, Twitter, and Evernote are working. Only Google+ is hanging up.

Edit 2:: I don't know exactly but I think- its not related to open URL. If it's related then please let me know HOW?

like image 948
Lion Avatar asked Apr 14 '16 05:04

Lion


1 Answers

Some JavaScript problems occurred in iOS 9.3. Its clearly mentioned in below article. Its not a code problem, it's an Apple webview problem. Check attached quote and URL for your reference.

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.

Reference Link: iOS 9.3 Problems

like image 120
PREMKUMAR Avatar answered Sep 29 '22 18:09

PREMKUMAR