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 4602034
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T23:55:11+00:00 2026-05-21T23:55:11+00:00

Hi all I have an app where I allow the user to post something

  • 0

Hi all
I have an app where I allow the user to post something on their pinwall of facebook. I used the DemoApp directly from Facebook to set it up.

I have implemented a shake detection that does something when the user shakes the device. However, since those two functions are in the same viewcontroller, both of them dont work anymore.

  • When Facebook pops the login window, the keyboard doesn’t appear anymore.
  • Shakes are not detected anymore.

I suppose it has something to do with the first responders. I have tried a lot of things but I was not able to solve it. Here is the neccessary part of my code.

Post something on facebook pinwall:

- (IBAction)publishStream{

    FactsAppDelegate *appDelegate = (FactsAppDelegate *)[[UIApplication sharedApplication] delegate];
    NSMutableDictionary *dictionary = [[[NSMutableDictionary alloc] init]autorelease];
    [dictionary setObject:@"Du postest diesen Fact:" forKey:@"user_message_prompt"];
    [dictionary setObject:[[appDelegate.facts objectAtIndex:currentFactId] fact] forKey:@"message"];
    [_facebook dialog:@"feed" andParams:dictionary andDelegate:self];
}

Shake detection:

#pragma mark Motion catching
// shake motion began
- (void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event {
    if (motion != UIEventSubtypeMotionShake) return;

    // load next fact
    [self next];

    // vibrate
    [self vibrate];
}

Method needed for shake detection:

#pragma mark Shake events are only detectable by the first responder
- (BOOL)canBecomeFirstResponder {
    return YES;
}

- (void)viewDidAppear:(BOOL)animated {
    [super viewDidAppear:animated];
    [self becomeFirstResponder];
}

- (void)viewWillDisappear:(BOOL)animated {
    [super viewWillDisappear:animated];
    [self resignFirstResponder];
}

Can anyone tell me what I have to change to get both (facebook, shake) working?
Thanks a lot,
doonot

  • 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-05-21T23:55:12+00:00Added an answer on May 21, 2026 at 11:55 pm

    Thanks to XJones I was finally able to fix my problem.

    @XJones, I was reducing my app to the default functions and found out why I was not able to catch motions and why I had problems with the facebook keyboard.

    My MainWindow.xib file was totally wrong and delegate was not set either. I deleted the xib file, mapped delegate and window and that’s it, I can now catch motions and even facebook posting works like a charm 🙂

    Thanks a lot for taking care and offering your help!!

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

Sidebar

Related Questions

Hi all: I have a Java Swing App. There is a button allow user
Hi all: I have a Java Swing App. There is a button allow user
Hey all - I have an app where I'm authenticating the user. They pass
I have an app in which I am trying to allow the user to
I have a small app that has a Render thread. All this thread does
I have an ASP.NET app running in IIS that is hosting files all great
I have a pretty basic windows form app in .Net. All the code is
I have one hibernate sequence, that generates all sequence-numbers in my app. When I
I'm sure we all have received the wonderfully vague Object reference not set to
I have a fairly standard blog app with the usual post and comments controller/models

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.