How to do facebook login without opening a browser at all? - ios

The IOS app I'm currently working on uses FBSDKLoginManager().logInWithReadPermissions, which opens a browser in the app for user to login to facebook. Then, the browser closes, and the app uses the FBSDKLoginManagerLoginResult to proceed.
However, I want to change it so that the app uses preset settings to log into facebook in the background, without actually opening a browser at all. To put it in a simpler way, the app should not open the browser, but still cause a regular log-in. Is that possible?
Just to clarify, this feature is only intended when the app is running in the developer mode, not for the users.
Thank you!
EDIT: I also found FBSDKLoginBehaviorSystemAccount, which
Attempts log in through the Facebook account currently signed in through
the device Settings.
However, I have no idea about how to implement this in swift, and I cannot find any resource online besides the brief description in FacebookSDK's documentation. It will be great if someone can help!

Related

App rejected by Apple based on design guideline

Apple rejected our app with the following response:
We noticed an issue in your app that contributes to a lower quality user experience than Apple users expect:
- Upon launching the app, a web page in mobile Safari opens first, then returns to the app. The user should be able to use the app immediately upon launch.
Next Steps
To resolve this issue, please revise your app to address all instances of this type of issue.
The app we're developing is a keyboard extension. The use-cases do not require a user to actually open the app and use it. As a result, in the app itself (should you launch it from home/springboard), we redirect the user to our website, which informs the user how to use the product (there's no registration or immediate tutorial required, but we certainly cant have the app do absolutely nothing). From Apple's response, this clearly isn't the right way. My questions:
If a user were to be redirected to Messages, could this solve the problem? The reason I ask this instead of just trying it is so that I dont waste time and end up getting rejected again.
Part of the problem seems that opening the app through springboard is misleading since it doesnt do anything. But my understanding is that we cannot have apps without icons (Create iOS app without menu icon). Do keyboard apps need to be published differently so that we dont have an icon in springboard? If so, please direct me to some documentation/Xcode configuration/resources to achieve this.
This is my first attempt at mobile development
The answer provided by #particleman was the right one. Just loading a WebView within the app was enough for Apple to accept the app.

Use Google-Signin to log into App but stay signed out on Safari

I have integrated Google-Signin into an iOS Application and it works well as far as signing in or signing up is concerned.
The only problem is that, I dont want the user to be logged into Google on iOS Safari after I have used Google-Signin.
I have verified that, before I log into my app, I am signed out of google in iOS Safari. Then I go to my app and I use Google-Signin to log into my app, once that is done I then go back to iOS Safari and refresh the google page and all of a sudden it shows me signed in with the same account that I used to log in to the app.
How do i just use Google-Signin to simply log into the app and stay logged out of iOS safari?
I've researched the topic and it seems the only way to perform logout is to use SFSafariViewController to open provider's logout page
For Google this is https://accounts.google.com/logout
This way requires some additional UX changes, because this action will open Safari window for a second and user should not be confused.
Try to use GIDSignIn it will open safariviewcontroller inside the app.
You can change which content from your Google Account syncs with the Apple apps on your device. You can also remove your Google Account from your Apple apps at any time, which stops syncing.
To change what syncs or remove your Google Account:
On your iPhone or iPad, open the Settings app.
Select Mail, Contacts, Calendars or Safari
Choose the account you'd like to edit or remove.
Make the changes you want.
To change what content syncs: Next to the content you want to sync, turn on the switch. Turn it off for content you don't want to sync.
To remove your account: Select Delete Account.

Google Plus iPhone API sign in and share without leaving app

I have integrated the Google+ API in my App for login and sharing posts. Problem with it, is that everything requires you to leave the app and then come back (it uses URL schemes for this). This is not the expected behavior. I would like to know if there is a way to directly open up the login dialog within the my app it self without going to safari.
I really want to avoid going back and forth between safari and my app.
I just implemented same thing for my application. I have used Google's Sign In SDK. it will present Webview controller inside your app and let you login with your account, after that it will dismiss the Webview controller and call a delegate to get info for user.
Please read and follow the steps from this link,
https://developers.google.com/identity/sign-in/ios/
hope it answers the question.

Facebook login error: "The developers of this app have not set up this app properly for Facebook login"

I've been seeing error like this when trying to use Facebook Login.
I've checked everything including setting up the pList
and followed solutions in this link
The developers of this app have not set up this app properly for Facebook Login?
by setting the "
Do you want to make this app and all its live features available to the general public?" to YES
but then this image came up.
When I first try doing facebook login there's no need to even turn the live feature available to YES to make it work I wonder what went wrong.
Ok guys i found the solution, just go to facebook on your safari in the iOS simulator and log out the current user or test user and create a new test user. It should work!

iOS Facebook switches back to app between login & permissions

I'm trying to setup my app to publish a simple post to a user's Facebook feed (image url, link, description). They don't need to use Facebook for anything else so the first time they click "Share" it needs to authorize the app, and the publish permissions.
If they have their credentials stored in the device as of iOS 6 they simply get two alert boxes and it's done with. But if they don't, or have an older version, it switches out to Safari for login. My problem is that it is then switching the user back to my app, then immediately back again to Safari to accept the publish permission. It's very jarring and unprofessional.
What I would like is for the page in Safari to change after the login to the permissions page so they can accept it, and THEN switch back to my app. I know this can be done because the popular Mixology app does exactly this behavior. Unfortunately Facebook keeps changing their SDK and all the information I find online is outdated.
I wrote up a solution here: FacebookSDK presents login UI twice to avoid the double switch.
Basically, you can use openActiveSessionWithPublishPermissions: to do what you want. However, you have to handle the special case where the user has signed in to Facebook from the device settings, which requires requests for read and publish permissions into two separate calls.

Resources