iOS Question Binary Rejected app crash (solved)

Discussion in 'iOS Questions' started by f0raster0, Oct 31, 2016.

  1. f0raster0

    f0raster0 Active Member Licensed User

    Hi,
    I have the same problem like other here in the forum, ipv6 rejection..

    "Your app crashes on an iPad and iPhone running iOS 10.1 connected to an IPv6 network when we:
    Selected the ‘Share’ button...
    This occurred when your app was used:
    - Offline
    - On Wi-Fi

    Please revise your app and test it on a device while connected to an IPv6 network (all apps must support IPv6) to ensure that it runs as expected."

    I updated my iPhone5 to iOS 10.1 and tested my app in airplane mode, also offile without internet and wifi on. I couldn't reproduce the error, it is not crashing at all.

    What information do I have to copy here then that you can help me guys..
    Thank you..


    Code:
    Case "compartir"
    modShare.ShareToSocialMedia(Page1, 
    "Capers App""Download Capers App: https://itunes.apple.com/nz/app/capers-dunedin/id1120027606?mt=8&ign-mpt=uo%3D4")
    Code:
    'modShare
    Sub Process_Globals
        
    Private myPage As Page 'ignore
    End Sub

    #IF OBJC

    //- (void)share2SocialMedia:(NSString *)subj :(NSString *)txt :(NSString *)theurl :(NSString *)theimg
    - (void)share2SocialMedia:(NSString *)subj :(NSString *)txt
    {
        NSString *subject = subj;
        NSString *text = txt;
        //NSURL *url = [NSURL URLWithString:theurl];
        //UIImage *image;

        //if([theimg hasPrefix:@"http://"] || [theimg hasPrefix:@"https://"] ) {
        //    image = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:theimg]]];
        //} else {
        //    image = [UIImage imageNamed:theimg];
        //}

        UIActivityViewController *controller =
        [[UIActivityViewController alloc]
        initWithActivityItems:@[text]
        //initWithActivityItems:@[text, url, image]
        applicationActivities:nil];
        [controller setValue:subject forKey:@"subject"];

        controller.excludedActivityTypes = @[UIActivityTypePostToWeibo,
        UIActivityTypePrint,
        UIActivityTypeCopyToPasteboard,
        UIActivityTypeAssignToContact,
        UIActivityTypeSaveToCameraRoll,
        UIActivityTypeAddToReadingList,
        UIActivityTypePostToTencentWeibo,];

        [controller setCompletionHandler:^(NSString*activityType, BOOL completed) {

        if (completed) {
            [self.bi raiseEvent:nil event:@"activity_completed::" params:@[@((BOOL)completed),(activityType)]];
        } else {
            NSString *activity = @"";
            [self.bi raiseEvent:nil event:@"activity_completed::" params:@[@((BOOL)completed),(activity)]];
        }
        }];

        [(self._mypage).object presentViewController:controller animated:YES completion:nil];
    }

    #End If


    Sub activity_completed(status As Boolean, T As String)
      
        
    Log("onSharingDone: Status = " & status & " - Type: " & T)
      
    End Sub


    'Sub ShareToSocialMedia(p As Page, SubjectTxt As String, TxtForShare As String, TheURL As String, ImageFile As String)
    Sub ShareToSocialMedia(p As Page, SubjectTxt As String, TxtForShare As String)

        myPage = p
        
    Dim NativeMe As NativeObject = Me
        NativeMe.RunMethod(
    "share2SocialMedia::"Array(SubjectTxt, TxtForShare))
        
    'NativeMe.RunMethod("share2SocialMedia::::", Array(SubjectTxt, TxtForShare, TheURL, ImageFile))

    End Sub




     
  2. Pendrush

    Pendrush Well-Known Member Licensed User

    I'm using identical code in my apps, no problems so far. I have pass review 7 days ago, app contain same share code as yours.
    Can't test code on IPv6, on IPv4 and airplane mode code working fine.
     
    f0raster0 likes this.
  3. f0raster0

    f0raster0 Active Member Licensed User

    Reject again :-(
    How can I know where be the problem with this app


    Nov 1, 2016 at 6:39 AM
    From Apple

    • 2. 4 PERFORMANCE: HARDWARE COMPATIBILITY
    Hello,

    Thank you for your prompt actions. After further review we have found that the app is not in compliance with guideline 2.4.1.
    Performance - 2.4.1


    Your app crashes on iPad running iOS 10.1 when we:

    - Selected the ‘Share’ button found at the top of the screen.

    Next Steps

    Please review your app on iPad to ensure that it runs without crashing. Also, please follow the steps to reproduce the issue when running your app on iPad configured for real world use.

    For new apps, uninstall all previous versions of your app from a device, then install and follow the steps to reproduce. For updates, install the new version as an update to the previous version, then install and follow the steps to reproduce.

    Resources

    If you have difficulty reproducing a reported issue, please try testing the workflow described in Technical Q&A QA1764: How to reproduce bugs reported against App Store submissions.

    If you have code-level questions after utilizing the above resources, you may wish to consult with Apple Developer Technical Support. When the DTS engineer follows up with you, please be ready to provide:
    - complete details of your rejection issue(s)
    - screenshots
    - steps to reproduce the issue(s)
    - symbolicated crash logs - if your issue results in a crash log

    Best regards,
    App Store Review
    "
     
  4. f0raster0

    f0raster0 Active Member Licensed User

    I see maybe it's because my app doesn't work on iPad, I don't have iPad to do test..

    "2.4.1 To ensure people get the most out of your app, iPhone apps should run on iPad whenever
    possible. We encourage you to consider building universal apps so customers can use
    them on all of their devices. Learn more about Universal apps"
     
    Last edited: Oct 31, 2016
  5. Erel

    Erel Administrator Staff Member Licensed User

    If you like you can send me the complete project to erel@basic4ppc.com and I'll test it on an iPad.
     
    f0raster0 likes this.
  6. Erel

    Erel Administrator Staff Member Licensed User

    This is the error:

    Error occurred on line: 668 (Main)
    Your application has presented a UIActivityViewController (<UIActivityViewController: 0x7a908400>). In its current trait environment, the modalPresentationStyle of a UIActivityViewController with this style is UIModalPresentationPopover. You must provide location information for this popover through the view controller's popoverPresentationController. You must provide either a sourceView and sourceRect or a barButtonItem. If this information is not known when you present the view controller, you may provide it in the UIPopoverPresentationControllerDelegate method -prepareForPopoverPresentation.
    Stack Trace: (
    CoreFoundation __exceptionPreprocess + 194
    libobjc.A.dylib objc_exception_throw + 52
    UIKit -[UIPopoverPresentationController presentationTransitionWillBegin] + 3922
    UIKit __71-[UIPresentationController _initViewHierarchyForPresentationSuperview:]_block_invoke + 2843
    UIKit __56-[UIPresentationController runTransitionForCurrentState]_block_invoke + 513
    UIKit __40+[UIViewController _scheduleTransition:]_block_invoke + 18
    UIKit _runAfterCACommitDeferredBlocks + 348
    UIKit _cleanUpAfterCAFlushAndRunDeferredBlocks + 624
    UIKit _afterCACommitHandler + 190
    CoreFoundation __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 30
    CoreFoundation __CFRunLoopDoObservers + 391
    CoreFoundation __CFRunLoopRun + 1414
    CoreFoundation CFRunLoopRunSpecific + 395
    CoreFoundation CFRunLoopRunInMode + 123
    GraphicsServices GSEventRunModal + 177
    GraphicsServices GSEventRun + 80
    UIKit UIApplicationMain + 148
    Capers Dunedin main + 140
    libdyld.dylib start + 1
    )

    You need to add this line to the share2socialmedia inline code:
    Code:
    controller.popoverPresentationController.sourceView = self._mypage.RootPanel.object;
    http://stackoverflow.com/questions/25644054/uiactivityviewcontroller-crashing-on-ios8-ipads

    Note that it requires iOS 8+.
     
    f0raster0 likes this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice