simplicitymobile / simplicity Goto Github PK
View Code? Open in Web Editor NEWA simple way to implement Facebook and Google login in your iOS apps.
License: Apache License 2.0
A simple way to implement Facebook and Google login in your iOS apps.
License: Apache License 2.0
i.e.
Simplicity.login(Google(scopes: ["custom optional scopes"])) { (access_token, error) in
//....
}
I did this:
let facebook = Facebook()
facebook.scopes = ["email"]
Simplicity.login(facebook) { (accessToken, error) in
//do something
}
After getting the AccessToken back, I make a HTTP-Request with this URL: https://graph.facebook.com/me?access_token= and get following result:
{
"name": "My Name",
"id": "10972xxxxxxx718"
}
No E-Mail information.. any ideas?
I also tried the default way: Simplicity.login(Facebook())
This would be a brilliant feature if you could add it in this repo. Thanks!!
App Events let you measure installs on your mobile app ads, create high value audiences for targeting, and view analytics including user demographics. To log an app activation event, first, import the Facebook SDK in your AppDelegate.m file:
import <FBSDKCoreKit/FBSDKCoreKit.h>
Next, add the following to your app delegate:
- - (void)applicationDidBecomeActive:(UIApplication *)application {
[FBSDKAppEvents activateApp];
}- - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[[FBSDKApplicationDelegate sharedInstance] application:application
didFinishLaunchingWithOptions:launchOptions];
return YES;
}- - (BOOL)application:(UIApplication *)application
openURL:(NSURL *)url
sourceApplication:(NSString *)sourceApplication
annotation:(id)annotation {
return [[FBSDKApplicationDelegate sharedInstance] application:application
openURL:url
sourceApplication:sourceApplication
annotation:annotation];
}
When people install or engage with your app, you'll see this data reflected in your app's Insights dashboard.
Hi,
I'm using modals in my projects and if I use simplicity to open the safariController It dismiss my modals so its not convenient from the user point of view. I've fixed it by adding :
safari?.modalPresentationStyle = .overFullScreen
just before
topController?.present(safari!, animated: true, completion: nil)
in presentSafariView(_ url:) in Simplicity class
As safariView is present over full screen anyway I don't think there are drawbacks to do so. Can I have you point of view on this ?
I called the function 'Simplicity.login(Google())' within my viewDidLoad() function in the ViewController.swift file.
I expected something to happen when I tried to print the accessToken within the function's scope, yet nothing happens when the code runs. There's no errors so I'd like to know what step I'm missing.
Thanks!
If their API is not well-documented in English, I can help.
Hey !
First, thanks for your lib 👍
I noticed that if you don't put the fb scheme in the CFBundleURLSchemes list, then the app will produce an error / crash (at least it'll go to preconditionFailure
).
Reason if that at this line let urlSchemes = urlTypes.flatMap({($0["CFBundleURLSchemes"] as? [String])?.first })
you take .first
, instead you could do a reduce instead of the flatMap.
Would you merge a PR if I were to submit one?
Thanks,
Vincent
When connecting with Google, there is a way to get the access_token AND the id_token (used for private api) ?
Hi, FB login works fine in local but when I upload the app to TestFlight or Store is not working (My FB App is in production mode).
Hi, can you create a provider for LINE? Thank you so much!
Hi everyone,
I was wondering why this strange behavior happen in my project : every time I try to re-connect to an account I already logged into, the Google Explorer (whom already know my password) keep asking me authorizations, even if it's my 3rd login to the same account.
If I take a look at the Google documentation, it shouldn't be asking me permission over time :
Before making the first authenticated call, the Explorer asks you to choose which scope you would like to use when granting it access to your data.
Here's the code responsible for the login, but I guess this behavior doesn't come from him :)
let google = Google()
google.scopes = ["email"]
google.login { [unowned self] (accessToken, error) in
if let token = accessToken {
print("Call Google API with token : \(token)")
}
}
So I was wondering if you guys know about that, and if a workaround exists :)
Thank you!
Jérôme
Hi, when the user press the Done button at the top of the safari view the simplicity callback is not called. I think it should be because now the code can't have any clue if the safari view is cancelled like this.
Can you create a provider for Flickr?
Hi, have you thought of a new provider for Instagram? Thanks
Was wondering if there was a solution for Github SSO? Thanks!
pod 'Simplicity' gives me version 1.0.2 still
Hi
I'm trying to make it work using objective-c.
Cannot found hot to call this using Obj-C syntax. Can i please ask if someone have done it with success?
Thanks!
Simplicity.login(Facebook()) { (accessToken, error) in
// Handle access token here
}
Hi,
There seems to be no available way of presenting the SafariView if another viewController is already being presented.
Is that wanted or will it be changed?
Cordially, Louis.
Hello,
How would I go about getting public_profile and email? After I get the token I can get the "name" and "id" fields, but how would I go about getting the rest of that information?
Thank you
Hello, please help me.
Server send token on https://www.googleapis.com/oauth2/v3/tokeninfo?id_token=
and get "error_description": "Invalid Value"
i think its different between access token and id_token, but i don't now what to do
What i missed
I guess it happen coz google close it?
swift 3 ios 10
I wanted to ask for public profile permission from user after facebook login. How to implement this functionality using Simplicity?
We can't implement Twitter, GitHub, LinkedIn, Slack, or other login types because we can't do authorization_code grants without a client secret. Client secrets are fundamentally insecure on mobile clients, so we need to create a companion server to help with the authentication request.
I see there are pull requests not reviewed / merged and the swift version is old. Is this maintained ?
Do you plan to support Swift 3.0? It's few days till Xcode 8 official release.
Hello there,
thanks for this nice library.
The Google-Login works fine. Now I want to get the E-Mail-Information out of the AccessToken. Is this possible with your library? If not, what next step do you recommend? (For example picking up another library).
The thing is, getting the E-Mail out of access token is the only functionality I need, and using other Libs seems to be way too overkill for that.
Thanks in advance.
Please share the scheme and update this. Carthage is unable to build a scheme for this.
Simplicity[4031:40778] Warning: Attempt to present <SFSafariViewController: 0x7fd56ae95ea0> on <faceBookAPI_2_Simplicity.ViewController: 0x7fd56ae8a120> whose view is not in the window hierarchy!
Why would I be getting this error?
Thanks in advance for your help.
Hi, I'm getting this error when using the google login feature
This application is modifying the autolayout engine from a background thread, which can lead to engine corruption and weird crashes. This will cause an exception in a future release.
I believe it is a result of using datatask in the google loginhandler.
Please checkout this stackoverflow post , I believe it could be fixed by wrapping the callback call with:
if error == nil {
dispatch_async(dispatch_get_main_queue(), {
self.handleRequest(...)I
})
}
Hi, Simplicity is working great in my project but what is the preferred way to store the token after getting it ? Can you provide a tiny sample ?
I have a login view controller that is presented modally which uses the simplicity. But since the root view controllers view is not currently on top of the window stack the system throws a warning that the view controller (safari) cannot be presented since the view is not visible. I did fix it. Do you mind if i issue a pull request.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.