iOS 8.3 Facebook error Not logged In - ios

I'am sharing a NSString and NSURL, using the native UIActivityViewController
The user is logged in into Facebook both in Settings and also in the Facebook App
but after iOS 8.3 i'am getting this error... moreover, on older devices, the dialog confirmation is obscured by the keyboard, making it impossible to confirm or decline
UIActivityViewController *vc = [[UIActivityViewController alloc] initWithActivityItems:items applicationActivities:applicationActivities];
NSArray *excludeActivities = #[UIActivityTypeAssignToContact];
vc.excludedActivityTypes = excludeActivities;
if (IsUserInterfaceIdiomPad) {
vc.popoverPresentationController.sourceView = self.navigationController.view;
}
[self.navigationController presentViewController:vc animated:YES completion:^{
}];

Yes, this is a bug that went out in Version 29 of the Facebook application. We (Facebook) are working on a fix and hope that it will ship soon.

Related

UIActivityViewController view frame is cut in ios 9.0

I encounter this bug when using UIActivityViewController in order to create a simple UI for sharing assets in my app. This works well on ios 10 and above, but in ios 9 this annoy issue appears. I've already researched for solutions but didn't find any help. Could you guys please take a look?
My code is just simple as below:
NSString *url=#"http://itunes.apple.com/us/app/APPNAME/idXXXXXXXXX";
NSString * title =[NSString stringWithFormat:#"Download ECG app %# and get free reward points!",url];
NSArray* dataToShare = #[title];
UIActivityViewController* activityViewController =[[UIActivityViewController alloc] initWithActivityItems:dataToShare applicationActivities:nil];
activityViewController.excludedActivityTypes = #[UIActivityTypeAirDrop];
[self presentViewController:activityViewController animated:YES completion:^{}];
In ios 9, it looks like THIS
Please try to update animated:NO when you present the Activity View, if the view displayed correctly with animated:NO then self.view.translatesAutoresizingMaskIntoConstraints = NO; should be the cause of this problem.

iOS native way to share files to any possible apps

I'm currently implementing an iOS app using objective-C, which has a function that users may share a file with other friend or other app (like upload the file to Dropbox, Google Drive, attach the file to Mail, share the file to Facebook Messenger, Whatsapp, via Bluetooth, etc).
Is there a native way to implement this share function that can detect all apps which allows sharing a file, while I don't need to do it one by one?
You want to use UIActivityViewController. Below is an example from NSHipster, which is probably the most comprehensive article I've seen on the subject. And Apple has some good documentation here.
NSString *string = ...;
NSURL *URL = ...;
UIActivityViewController *activityViewController = [[UIActivityViewController alloc] initWithActivityItems:#[string, URL]
applicationActivities:nil];
[navigationController presentViewController:activityViewController
animated:YES
completion:^{
// ...
}];
This provide full answer for iPhone and iPad devices
ViewController *contentViewController = [[ViewController alloc] init];
// Present the view controller using the popover style.
contentViewController.modalPresentationStyle = UIModalPresentationPopover;
[self presentViewController:contentViewController
animated:YES
completion:nil];
// Get the popover presentation controller and configure it.
UIPopoverPresentationController *presentationController =[contentViewController popoverPresentationController];
presentationController.permittedArrowDirections = UIPopoverArrowDirectionUp;
presentationController.sourceView = self.view;
presentationController.sourceRect = self.view.frame;
UIPopoverPresentationController should have a non-nil sourceView or barButtonItem set before the presentation occurs on iOS 9

UIActivityViewController Size

I'm trying to use UIActivityController in my app. Unfortunately the size of the modal is far too large.
On the left, the modal I want, on the right, the modal I have :
And here is the code I use to display the modal when I click on the Share button :
NSString *textToShare = #"Hello !";
NSURL *myWebsite = [NSURL URLWithString:#"http://stackoverflow.com/"];
NSArray *objectsToShare = #[textToShare, myWebsite];
UIActivityViewController *activityVC = [[UIActivityViewController alloc] initWithActivityItems:objectsToShare applicationActivities:nil];
// Email subject
[activityVC setValue:#"Hello !" forKey:#"subject"];
[self presentViewController:activityVC animated:YES completion:nil];
What am I doing wrong ?
Thanks in advance.
You're doing nothing wrong, you're just using a differently sized device! Try running in the simulator using iPhone 6 or iPhone 6S and I bet you'll see exactly what you want on the left. Looks like you're just running it on a smaller device than what you want.

UIActivityController Cancel button doesn't work on iPad

I've a problem with the UIActivityController on iOS 8 iPad: the activity view works correctly I can select a share service (i.e. Twitter) but when the "publish" view appear I can only click on the Post button,the Cancel button doesn't work. I've the same problem on real devices and on the simulator.
If you have an idea about how to fix this problem,...
Thanks
Here's my code:
- (IBAction)activityController:(id)sender {
// items to share
NSURL *url = [NSURL URLWithString:_articleUrl];
NSArray *items=#[url];
// create the controller
UIActivityViewController *controller = [[UIActivityViewController alloc]initWithActivityItems:items applicationActivities:nil];
[self presentViewController:controller animated:YES completion:nil];
UIPopoverPresentationController *popPC = controller.popoverPresentationController;
popPC.barButtonItem = _buttn;
popPC.permittedArrowDirections = UIPopoverArrowDirectionAny;

ActivityItems in UIActivityViewController don't show up

I'm developing an app in iOS 7 and in it I need to show an activity controller. Below is my code,
UIActivityViewController *activityVC = [[UIActivityViewController alloc] initWithActivityItems:#[UIActivityTypeSaveToCameraRoll, UIActivityTypePostToFacebook, UIActivityTypePostToTwitter, UIActivityTypeMail, UIActivityTypeMessage, UIActivityTypePrint] applicationActivities:nil];
[self presentViewController:activityVC animated:YES completion:nil];
But when its presented, this is how it looks.
None of the activity types I added in the array shows up. Why is this happening? Am I missing something? I'd like some help to get this working. I especially need the Facebook, twitter sharing and the saving to the local storage options here.
Thank you.
Edit: I checked on a real device and the Facebook and Twitter sharing options show up. However UIActivityTypeSaveToCameraRoll, UIActivityTypePrint still aren't showing up.
The Items will show up only if you have integrated them to your Device.
If you have integrated facebook and Logged into facebook in the settings then Facebook will appear along the Items. That means your device must be Synchronised with the native Facebook, Twitter, etc Apps for them to show up in the UIActivityViewController
Edit:
Try using like this
UIActivityViewController *ActivityView;
ActivityView =
[[UIActivityViewController alloc]
initWithActivityItems:Items applicationActivities:nil];
[self presentViewController:ActivityView animated:YES completion:nil];

Resources