iphone - UIActivityViewController Facebook and Twitter share not working in released iOS version -
we have released iphone app share fb & tw using uiactivityviewcontroller zigzag app on app store.
my device working perfect device used development. users downloaded app not able share using function.
nsstring *txttoshare = @"please try awesome ios app"; nsarray *objectstoshare = [nsarray arraywithobjects:txttoshare, nil]; uiactivityviewcontroller *activityvc = [[uiactivityviewcontroller alloc] initwithactivityitems:objectstoshare applicationactivities:nil]; [self presentviewcontroller:activityvc animated:yes completion:^{ }]; if ([activityvc respondstoselector:@selector(popoverpresentationcontroller)]) { // ios 8+ uipopoverpresentationcontroller *presentationcontroller = [activityvc popoverpresentationcontroller]; presentationcontroller.sourceview = sender; // if button or change self.view. }
can tell me why?
i had same issue , resolved using following technique declared 2 constants
static nsstring *const twitterappbundlestringforos8 = @"com.atebits.tweetie2.shareextension"; static nsstring *const facebookappbundlestringforos8 = @"com.facebook.facebook.shareextension"; if ([self.activitytype isequaltostring:uiactivitytypeposttofacebook] || [self.activitytype isequaltostring:facebookappbundlestringforos8]) { text = @"abc"; } else if( [self.activitytype isequaltostring:uiactivitytypeposttotwitter] || [self.activitytype isequaltostring:twitterappbundlestringforos8]){ text = @"cc"; }
it working fine now
when had issue had following code
if ([self.activitytype isequaltostring:uiactivitytypeposttofacebook] ) { text = @"abc"; } else if( [self.activitytype isequaltostring:uiactivitytypeposttotwitter] ){ text = @"cc"; }
i hope helps, if not let me know.