appsocially / AppSocially-iOS-SDK

Optimized User Aqusition funnel for iOS
https://appsocial.ly/
64 stars 8 forks source link

The AppSocially crashed when I send a simple message at shared compose view by Twitter account #1

Closed susieyy closed 10 years ago

susieyy commented 11 years ago

The AppSocially crashed when I send a simple message at shared compose view by Twitter account.

Use version is 0.8.1.

Error message is following.

Presenting action sheet clipped by its superview. Some controls might not respond to touches. On iPhone try -[UIActionSheet showFromTabBar:] or -[UIActionSheet showFromToolbar:] instead of -[UIActionSheet showInView:].
2013-10-24 18:55:56.384 xxxxxxx[24700:60b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Invalid type in JSON write (NSURL)'
*** First throw call stack:
(0x30842e8b 0x3ab3d6c7 0x30842dcd 0x31284709 0x31286293 0x3077e703 0x3077e627 0x31285f15 0x31284647 0x31286293 0x3077e703 0x3077e627 0x31285f15 0x31284647 0x3128445b 0x312852fd 0x200cc7 0x1fd0ab 0x202335 0x1fd36f 0x1fdc8f 0x278b37 0x2769f3 0x277d6f 0x3b022103 0x3b0220ef 0x3b0249a9 0x3080d5b9 0x3080be85 0x30776541 0x30776323 0x354ad2eb 0x3302d1e5 0x370a1 0x37028)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb) 

My Code

    UIBarButtonItem *cancelBtn = [[UIBarButtonItem alloc] initWithTitle:@"Close"
                                                                  style:UIBarButtonItemStyleBordered
                                                                 target:nil action:nil];

    UIBarButtonItem *sendBtn = [[UIBarButtonItem alloc] initWithTitle:@"Send"
                                                                style:UIBarButtonItemStyleBordered
                                                               target:nil action:nil];

    ASShareComposeViewController *shareCtr = [[ASShareComposeViewController alloc] init];
    shareCtr.backBtn = cancelBtn;
    shareCtr.sendBtn = sendBtn;
    shareCtr.imageToShare = [UIImage imageNamed:@"icon"];

    NSString* msg = @"Hello App";
    shareCtr.presetMessage = msg;
    shareCtr.shareInfo = @{kDataPropertyMessage: msg, kDataPropertyContentURL: [NSURL URLWithString:@"https://itunes.apple.com/jp/app..."]};
    self.shareComposeViewController = shareCtr;
    [self presentViewController:shareCtr
                       animated:YES
                     completion:^{
                     }];

Error Stack xxxxxxx xcworkspace__socketdatamanager_chat m

aerodynamics commented 11 years ago

Thanks for using AppSocially and letting us know. We are investigating the problem. - Yusuke

shu223 commented 10 years ago

Thanks for your bug report.

Please change your code from:

shareCtr.shareInfo = @{kDataPropertyMessage: msg, kDataPropertyContentURL: [NSURL URLWithString:@"https://itunes.apple.com/jp/app..."]};

to:

shareCtr.shareInfo = @{kDataPropertyMessage: msg, kDataPropertyContentURL: @"https://itunes.apple.com/jp/app..."};

You have to pass NSString object as the value of kDataPropertyContentURL propety, not NSURL object. I'm sorry that our "Share Sample" included wrong code. It has already fixed.

Thanks, Shu