Note that there are some explanatory texts on larger screens.

plurals
  1. POmotionBegan not being called in whole application
    primarykey
    data
    text
    <p>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. </p> <p>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.</p> <ul> <li>When Facebook pops the login window, the keyboard doesn't appear anymore.</li> <li>Shakes are not detected anymore.</li> </ul> <p>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.</p> <p>Post something on facebook pinwall:</p> <pre><code>- (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]; } </code></pre> <p>Shake detection:</p> <pre><code>#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]; } </code></pre> <p>Method needed for shake detection:</p> <pre><code>#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]; } </code></pre> <p>Can anyone tell me what I have to change to get both (facebook, shake) working? Thanks a lot, doonot</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload