Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

Titanium (SDK3.5) iOS Module - Callback Function Not being call correctly

$
0
0

Hi All, I am trying to create a iOS-module for login and Share photos using Facebook and Twitter. Piece of code is fine as i have tested it natively. But when i am trying to merge it with titanium app it does not work properly.

Here i am using latest Facebook SDK. When I try to share photo by calling fbShareit it takes me to FBSDK's share screen once i click on post it start share. After successfully completing share procedure, control returns to my app. Till then everything running according to plan. but instead of calling delegate function didCompleteWithResults, sharerDidCancel is being called.

How can i solve this problem.

and also when i checked my Facebook account, photo was posted there.

-(void)fbShareIt:(id)args
{
    UIImage *image = [UIImage imageNamed:@"shareit.jpg"];
 
    FBSDKSharePhoto *photo = [[FBSDKSharePhoto alloc] init];
    photo.image = image;
    photo.userGenerated = YES;
    FBSDKSharePhotoContent *content = [[FBSDKSharePhotoContent alloc] init];
    content.photos = @[photo];
    [FBSDKShareDialog showFromViewController:[[TiApp app] controller]
                                 withContent:content
                                    delegate:self];
}
-(void)sharer:(id<FBSDKSharing>)sharer didCompleteWithResults:(NSDictionary *)results
{
    NSLog(@"[INFO] DID complete with results %@",results);
}
-(void)sharerDidCancel:(id<FBSDKSharing>)sharer{
    NSLog(@"[INFO] Sharer Did Canceled");
}
-(void)sharer:(id<FBSDKSharing>)sharer didFailWithError:(NSError *)error
{
    NSLog(@"[INFO] Sharer didFailWithError %@",error.description);
}

Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>