Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8885899
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T21:25:32+00:00 2026-06-14T21:25:32+00:00

Can you help me to understand when should I use UIActivityViewController . I have

  • 0

Can you help me to understand when should I use UIActivityViewController. I have a button which shares common information about my app (something like “I like this app” with link and image). My old code was:

NSMutableDictionary *params = [NSMutableDictionary dictionary];
[params setObject:picture forKey:@"picture"];
[params setObject:link forKey:@"link"];
[params setObject:@"I like MY app!" forKey:@"caption"];
[params setObject:@"I am now using MY iPhone app." forKey:@"description"];
[params setObject:linkToTheIcon forKey:@"icon"];
[params setObject:@"including link" forKey:@"type"];
[[FacebookConnection instance] feedLink:params andDelegate:self];

Now I want to use UIActivityViewController but I’m a bit confused how to pass all those parameters to it. Or should I do things in other way?

ADDED:
So I understood that I need silent posting procedure.
Could you please guide me through silent post procedure using iOS 6 features (e.d. using built-in FB account). For now I can’t understand how to check if FB account exists on the device and if it is not how to prompt to create it? There is a method in ACAccount store class – requestAccessToAccountsWithType:options:completion: to access an account. But If an account does not exists it returns an error. Many thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T21:25:33+00:00Added an answer on June 14, 2026 at 9:25 pm

    In your situation it seems obvious that you should not use UIActivityViewController because you want to post on Facebook and not on twitter or anywhere else, right?
    Firstly you need to get access to user’s account. You do this like this:

    -(void)requestBasicPermissionsForFacebookAccount {
        ACAccountType * facebookAccountType = [self.accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierFacebook];
        NSArray * permissions = @[@"email"];
        NSDictionary * options = @{ACFacebookAppIdKey : kFacebookAppId, ACFacebookPermissionsKey : permissions, ACFacebookAudienceKey : ACFacebookAudienceEveryone};
        FacebookAccountManager * fbMgr = [[FacebookAccountManager alloc] init];
        [self.accountStore requestAccessToAccountsWithType:facebookAccountType options:options completion:^(BOOL granted, NSError *error) {
            if (granted) {
                NSArray * accounts = [self.accountStore accountsWithAccountType:facebookAccountType];
                fbMgr.account = [accounts lastObject];
                fbMgr.isBasicPermissionsGranted = YES;
                [self.accountManagers addObject:fbMgr];
                NSLog(@"granted!");
            }
            else {
                fbMgr.account = nil;
                fbMgr.isBasicPermissionsGranted = NO;
                switch ([error code]) {
                    case 1:
                        [self showErrorAlertWithMessage:@"Unknown error occured, try again later!"];
                        break;
                    case 3:
                        [self showErrorAlertWithMessage:@"Authentication failed, try again later!"];
                         break;
                    case 6:
                        [self showErrorAlertWithMessage:@"Facebook account does not exists. Please create it in Settings and come back!"];
                         break;
                     case 7:
                        [self showErrorAlertWithMessage:@"Permission request failed. You won't be able to share information to Facebook"];
                         break;
                    default:
                        break;
                }
                NSLog(@"error is: %@", error);
            }
        }];
    }
    

    If an account does not exists you should prompt user to create it in settings and then try to to obtain basic permissions again.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can you help me understand how I should debug this errors? What information would
Can anyone please help me to understand how should i access json data in
I'm a student looking for resources which can help me further understand how to
I have a page which displays a form that a logged-in user can use
I was wondering if you can help me understand a moq concept... I have
Can someone help me understand how to write this case statement properly its not
Can anyone help me understand what is going on here? Jenkins has been working
can anybody help me understand how Honda achieved this effect: http://testdays.hondamoto.ch/ I mean the
Can you help me understand the practical differences between these two; IList<int> myList =
Hey can anyone help me understand how to do an edit method for my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.