ios - UIActivityViewController Not Showing Facebook if Facebook App Installed -
i having issue uiactivityviewcontroller on apps since updated ios 8.3. twitter, mail, , messages displays fine, facebook not there. have checked code ensure didn't accidentally list in excluded activity, , made sure signed in on facebook within phone settings. can verify works on simulator, not in phone. ideas may going on here?
update
somehow, related facebook app itself. if remove facebook iphone, option share via facebook comes back. if reinstall facebook app, can no longer share facebook. ideas why doing it?
-(ibaction) invite { nscalendar* gregorian = [[[nscalendar alloc] initwithcalendaridentifier: nsgregoriancalendar] autorelease]; nsdatecomponents* thedatecomponents = [gregorian components: nsweekdaycalendarunit fromdate: [nsdate date]]; nsinteger weekday = thedatecomponents.weekday; if ( weekday == 1 || weekday >= 5 ) { nsstring *invitation = @"join me @ fritch church of christ sunday! bible class @9:45am worship @10:45am & 6:00pm!"; nsarray *activityitems = @[invitation]; uiactivityviewcontroller *activityvc = [[uiactivityviewcontroller alloc] initwithactivityitems:activityitems applicationactivities:nil]; activityvc.excludedactivitytypes = @[ uiactivitytypeposttoweibo, uiactivitytypecopytopasteboard, uiactivitytypeassigntocontact, uiactivitytypeprint ]; if( ui_user_interface_idiom() == uiuserinterfaceidiompad ) { uipopovercontroller* apopover = [[uipopovercontroller alloc] initwithcontentviewcontroller:activityvc]; [apopover presentpopoverfromrect:[invite frame] inview:self.view permittedarrowdirections:uipopoverarrowdirectionleft animated:yes]; } else { [self presentviewcontroller:activityvc animated:yes completion:nil]; } } else { nsstring *invitation = @"join me @ fritch church of christ wednesday! devotional & bible class @7!"; nsarray *activityitems = @[invitation]; uiactivityviewcontroller *activityvc = [[uiactivityviewcontroller alloc] initwithactivityitems:activityitems applicationactivities:nil]; activityvc.excludedactivitytypes = @[ uiactivitytypeposttoweibo, uiactivitytypecopytopasteboard, uiactivitytypeassigntocontact, uiactivitytypeprint ]; if( ui_user_interface_idiom() == uiuserinterfaceidiompad ) { uipopovercontroller* apopover = [[uipopovercontroller alloc] initwithcontentviewcontroller:activityvc]; [apopover presentpopoverfromrect:[invite frame] inview:self.view permittedarrowdirections:uipopoverarrowdirectionleft animated:yes]; } else { [self presentviewcontroller:activityvc animated:yes completion:nil]; } } }
from simulator
from actual iphone (both signed facebook)
it appears latest facebook ios app update embeds app extension takes precedence on apple native facebook extension.
indeed, see because on both cases (facebook app installer or not) nsstring *activitytype
given uiactivityviewcontroller
completion block com.apple.uikit.activity.posttofacebook
matches const string uiactivitytypeposttofacebook
.
i think explains behaviour (and i) encountered.
for information, managed display facebook in uiactivityviewcontroller
in both cases following workaround: providing @ least 1 nsurl *
item share.
but seems when facebook app installed, other items such nsstring *
not taken account :(
it facebook app issue , hope fixed in future app releases can have same behaviour whether facebook app installed or not.
edit (may 22 2015)
i afraid not issue given facebook terms: see deepfriedtwinkie's answer on related question: https://stackoverflow.com/a/30020929/2743762
edit (may 27 2015)
the current facebook app (v 31.0) fixes problem
Comments
Post a Comment