DismissModalViewControllerAnimated? - ios

I've been looking for hours to solve my problem. Right now my program is set as a page control with a UIScrollView. So I looked at a tutorial on adding an in-app email (http://blog.mugunthkumar.com/coding/iphone-tutorial-in-app-email/).
Everything works out well until I want to cancel an email, or send the mail, the log says it did the method fine, however when i do the
[self DismissModalViewControllerAnimated:YES];
it will dismiss to the mainwindow.xib, however, I want it to dismiss back to the secondcontrollerview where the email function and button resides obviously.
What am i missing? Hope someone could help ^-^,

simply .. if you are present your mailController from seconedControllerView your app will return back to it when you dismiss the mailController.

Related

JSQMessages keyboard not pushing up view

When I go to type a message into my JSQMessagesViewController, the view is not being pushed up when the keyboard appears.
I can't send a message and I can't see the message I'm typing.
I don't even see any code in my VC that would be causing this / that would have changed this so I don't know where to start looking or what code to supply. I've downloaded examples using JSQMessages and I feel like this is just built in functionality behind the scenes.
Any ideas?
If you have viewDidAppear/viewDidDissapear being used you have to use
super.viewDidAppear(true)
and
super.viewDidDissapear(true)
also called respectively.
Adding those in fixed the issue.

SLComposeViewController setInitialText not showing up in View

I'm trying to use the SLComposeViewController to share a link in my iOS App.
SLComposeViewController *controller = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook];
[controller setInitialText:#"Here's the link I promised:"];
[controller addURL:[NSURL URLWithString:#"http://www.url.com"]];
[self presentViewController:controller animated:YES completion:nil];
When the controller presents, there is no text in the entry box. You can add text and send it fine (the URL shows up correctly in the Post as well).
I just installed FacebookSDK 4.01 and it's a iOS 7/8 App.
Any ideas on why the initial text isn't showing up. I even tried to do it without the URL and just do text, but nothing.
Additional Note: If I do remove the addURL, then the App freezes when I touch "Post" and the post never gets sent.
Thanks for any help!!!
I found a nice way to work around this which still gives the user control.
For Facebook only, just before presenting the SLComposerViewController I show a self dismissing alert (with a 6 second dismissal if OK wasn't tapped). This alert will contain "Write to your friends about how you did playing !\n\nYou can just PASTE for a preset message.".
Right after showing the alert, I then use the following to post a preset message to the UIPasteboard:
UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
pasteboard.string = msg;
So then the SLComposeViewController is presented and an alert view right over it. Once the user dismisses the alert view (or 6 seconds passes and it self dismisses), that the user has the option to just PASTE, right in the message text, your preset message. Or not, that's the beauty of it.
Hope this helps some others get around what FB decided to suddenly enforce. I didn't even realize it was against policy to use the setInitialText method for FB.
Cheers.
This behaviour is intended. See also this bug report: https://developers.facebook.com/bugs/962985360399542/. As #WizKid mentions, it's against policy to pre-fill text. Up until recently, you could still do so (violating the policy) but now this is actually enforced.
There is nothing you can do for this on your side; it's a policy enforcement by Facebook.
Also, related Rdar: http://openradar.appspot.com/20709403

Why does the Parse.com login view hide the Facebook login button?

I've set up the Parse Login in my iOS app, but I'm trying to turn on some features. When I do that, the Facebook login button disappears. The lines of code that seem to do this are below. If I comment out these 2 lines, everything works fine. I'm not sure why.
[logInViewController setEmailAsUsername:true];
[logInViewController.logInView.logo setHidden:YES];
this is code for the fields that I've setup in the view:
[logInViewController setFields:PFLogInFieldsUsernameAndPassword|PFLogInFieldsSignUpButton|PFLogInFieldsDismissButton|PFLogInFieldsFacebook|PFLogInFieldsPasswordForgotten];
I'm not subclassing the view (which I do realize will give me more customization options and control, but I'm just throwing this in just to set it up) I'm using Parse-library 1.6.1. Like I said, without those 2 lines, everything works fine. Has anyone else experienced this? Any help would be much appreciated.

redirection issue while integrating Facebook app in my iOS app

i have created an iOS app in which i want Facebook integration for the user to get into my app for use. so i have done all the settings by going through the "developer.facebook.com"
site and following all the steps. but in my app Facebook login works great.but after successful login the app return on same login page from where i started but i want my app return to a new view controller after authentication. so i did follow below code:
- (void)loginViewFetchedUserInfo:(FBLoginView *)loginView
user:(id<FBGraphUser>)user {
[self performSegueWithIdentifier:#"authentication" sender:self];
}
in my very first view controller file so that after authentication it move to my wanted view controller. it move to my desired view controller but after stay on my first view controller for a while and then move to desired one.but i don't want this senario.I just want that after authentication control move directly to desired one without display my first view controller that contain Facebook login button.
please help me on this ,i stuck over this problem since many days.so any help would be appreciated.
for your knowledge i am using plain view controller and not navigation controller. and i have checked my bundle id and url scheme many times and are correct.
In loginViewShowingLoggedInUser method dissmiss the currentViewcontroller i.e one with fbloginview button..

Issue dismissing/ re-presenting MFMessageComposeViewController with iOS6 but fine with iOS5

I'm presenting an MFMessageComposeViewController which works fine with iOS4 and iOS 5 but has problems with iOS6.
The view is presented ok but if its dismissed and then represented it doesn't display correctly - only the To: line is displayed, the body and keyboard are missing. (Sorry I can't post a screen shot at the moment as XCode crashes when I take a shot, I'm downloading an older version of XCode as I type).
Stepping through the code in the debugger I noticed that the problem may originate earlier than the re-presenting - I noticed than when dismissViewControllerAnimated: gets called the entire view does not get dismissed immediately, rather it is the message body and keyboard that gets dismissed leaving behind the To:, the same thing that is displayed when the view is re-presented.
It might be easier to describe with screenshot, I'll post some shortly.
I'm using presentViewController: and dismissViewControllerAnimated: to present/dismiss the MFMessageComposeViewController.
+++ UPDATE +++
I've found the problem can be solved if instead of using the same MFMessageComposeViewController object to re-present the view I first delete it and then create a new one.
That seems a little inefficient though, and it should not be necessary I'd have though, like i mentioned it worked on iOS5.
In iOS 6 apple introduced a new feature "remote view controller". Some external view controllers are no longer part of your app, and the messaging controller is one of them.
I guess that is the problem in your case.
you can read more about it there: http://oleb.net/blog/2012/10/remote-view-controllers-in-ios-6/

Resources