How to open device Settings to login in to Twitter and Facebook from Social.Framework? - iphone

Im using Social.Framework for sharing app specific info to Facebook as well as Twitter everything is working except, if user is not already logged in to Facebook and Twitter in his device that time I want to show a message like login to these sites in device settings and I need to navigate user to Device Settings on tap of this button, my apps minimum deployment target is iOS 6.0 and above, How to take user to Apps Settings Screen from my app?
I heard that openURL is not allowed by Apple from iOS5.0 and above, so that I cant even use the below snippet,
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:#"prefs:root=TWITTER"]];

Related

Launch Twitter using device’s browser, not launch Twitter app on iOS device

I have an ionic 3 app that needs to launch my company’s Twitter page in the device’s browser. The Twitter link is like : https://www.twitter.com/mycompany.
When I add this link to my page, the behavior is like this:
If there is no Twitter app installed on the device, the ionic app
will launch the device browser with the Twitter url above.
If the Twitter app has been installed on the device, the ionic app will
launch the Twitter app, and users have to log in to use the Twitter
app.
This happens on iOS only, even when using InAppBrowser plugin.
Is there any way to always launch the link using the device’s browsers, even when the Twitter app has been installed? It really annoys when users have to create an account and log in to Twitter app just to view my company’s Twitter page.
Thanks.

Safari App takes user to Settings App in iPhone in iOS 6. How can this be done in my iPhone app?

I had a requirement to redirect a user to the iOS Settings application from within my application. I know that in iOS 5, we could use the following URL scheme to achieve this: prefs:root=General.
And I could use the following line of code:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:#"prefs:root=General"]]
But Apple no longer supports this open URL scheme since the iOS 5.1 update.
But recently I have noticed that, in the Appstore app and Safari browser etc, Apple let this happen.Please refer to the attached image where Apple shows the alert. And on clicking the Settings button, user is taken to the Settings app. Any idea, how this is done. I believe if this can be done in App Store application, there should be some way that I can do it in my application also. Please comment if someone has a fix, or more idea on how this can be done.

iOS Facebook SDK,how to login within App , not in safari

Is it possible to use the Facebook iOS SDK to authenticate within an app (not go to Safari), and also keep those authentication credentials for the next launch of the app?
I have usedFacebook SDK sample code SessionLoginSample to check . It opens the Facebook login account in the safari....I want it to open with-in the app ..
I am not using FBConnect as it is been expired ...How to use it for the Facebook SDK
of
https://github.com/facebook/facebook-ios-sdk ...its sample code
https://github.com/facebook/facebook-ios-sdk/tree/master/samples/SessionLoginSample
this sample code here~~
The Facebook iOS SDK will open within the app provided your user is on iOS 6 and has their Facebook account setup within the device. Otherwise, it will gracefully fallback to the Facebook App (if installed) and then only to Safari. From the SDK Docs:
The native Login Dialog is available after a user has logged into
Facebook on their device. If the device isn't connected to Facebook,
the native Login Dialog isn't available and permission requests will
be made via the fast-app-switch to the Facebook app (if installed) or
Safari. The Facebook SDK methods [...] will seamlessly fallback to
this fast-app-switch behavior.
If your user has neither Facebook configured on their iOS 6 device nor the Facebook app installed and you still want the login to happen within your app, your best alternative might be to pull up a UIWebView pointed to your own server somewhere that carries out a server-side login.
Bear in mind a big disadvantage of a UIWebView-based approach is that your UIWebView does not share cookies with Safari so even if the user is already logged in within Safari they'll still need to re-enter their username and password again in your app. I'd be a little hesitant to do so in a third party app since there's no way to know if they're spoofing the Facebook site and phishing for my credentials.
FBSDKLoginManager *login = [[FBSDKLoginManager alloc] init];
login.loginBehavior = FBSDKLoginBehaviorWeb;

Facebook Warning for entering the credentials is not coming on real device IOS6

When we test IOS6 Facebook sharing feature in real device its not showing the Alert view with Setting and cancel button but working fine in the IOS6 simulator. We tested in iphone 4s and Iphone5 , In both phones its not showing and alert view for entering the credentials in settings page .
Did any one found the same isssue ?
With the new Social.Framework, If the user does not setup his account for Facebook, Twitter or Weebo in Settings , The App will not recognize that you have Facebook available.
Go to settings and then to the Twitter or Facebook tabs where you can setup your account credentials. After this is setup it will work correctly.
This works fine in the simulator but not on a phone if the relevant accounts are not setup.

Facebook SSO authorize in safari but not facebook app in my iphone

I am following the guide exactly to integrate with Facebook. A weird issue that i run into is that, if I,
uninstall the facebook app in iphone
OR change the facebook.m implementaion to disable facebook app like
[self authorizeWithFBAppAuth:NO safariAuth:YES];
The authorize method works well in safari and get back the auth token in the url
However, if I am not doing the above 2, it will switch to facebook app, and after it says 'loading...' for a second, it gets back to me an url saying user denied. (fbxxxxxxxxxxxxx://authorize#error_reason=user%5Fdenied&error=access%5Fdenied&error_description=The%2Buser%2Bdenied%2Byour%2Brequest%2E%3F%5F)
Why it behaves so differently in the native app and browser? Is it a bug in FB iPhone app? I am using the same app and same user to test.
double check your iOS Bundle ID in facebook app setting, it has to be exact same as what you define in app.