Skip to content

Commit

Permalink
fbsd v5 added
Browse files Browse the repository at this point in the history
  • Loading branch information
Ayush Awasthi committed May 6, 2019
1 parent 81fb19f commit 6afc2fd
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion KiwiPods.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Pod::Spec.new do |s|
#

s.name = "KiwiPods"
s.version = "0.0.3"
s.version = "0.0.4"
s.summary = "Summary"

# This description is used to generate tags and improve search results.
Expand Down
18 changes: 9 additions & 9 deletions KiwiPods/Social/Facebook/FacebookLoginHelper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,13 @@ final class FacebookLoginHelper {
private var viewController: UIViewController?

class func getCurrentAccessToken() -> String? {
return FBSDKAccessToken.current()?.tokenString
return AccessToken.current?.tokenString
}
public func checklogin(completion: ((Bool, Error?) -> Void)?) {
if let _ = FBSDKAccessToken.current() {
if let _ = AccessToken.current {
completion?(true, nil)
} else {
FBSDKLoginManager().logIn(withReadPermissions: FacebookReadPermissions.allCases.map{$0.rawValue}, from: viewController ?? UIViewController()) { (result, error) in
LoginManager().logIn(permissions: FacebookReadPermissions.allCases.map{$0.rawValue}, from: viewController ?? UIViewController()) { (result, error) in
if let error = error {
completion?(false, error)
} else {
Expand All @@ -117,8 +117,8 @@ final class FacebookLoginHelper {
public func getUserInfo(requestData: [String], completion: @escaping (_ result: FaceBookLoginData?, _ error: Error?) -> Void) {
checklogin { (success, error) in
if success {
let graphRequest = FBSDKGraphRequest(graphPath: "/me", parameters: ["fields": requestData.joined(separator: ",")])
_ = graphRequest?.start(completionHandler: { (_, result, error) in
let graphRequest = GraphRequest(graphPath: "/me", parameters: ["fields": requestData.joined(separator: ",")])
_ = graphRequest.start(completionHandler: { (_, result, error) in
if let result = result, let deocdedData = try? JSONSerialization.data(withJSONObject: result, options: JSONSerialization.WritingOptions.prettyPrinted) {
do {
let fbloginData: FaceBookLoginData = try JSONDecoder().decode(FaceBookLoginData.self, from: deocdedData)
Expand All @@ -141,8 +141,8 @@ final class FacebookLoginHelper {
if let after = after {
params["after"] = after
}
let graphRequest = FBSDKGraphRequest(graphPath: "me/photos", parameters: params)
_ = graphRequest?.start(completionHandler: { (_, result, error) in
let graphRequest = GraphRequest(graphPath: "me/photos", parameters: params)
_ = graphRequest.start(completionHandler: { (_, result, error) in
if let result = result, let deocdedData = try? JSONSerialization.data(withJSONObject: result, options: JSONSerialization.WritingOptions.prettyPrinted) {
do {
let fbloginData: FacebookUserImagesResponse = try JSONDecoder().decode(FacebookUserImagesResponse.self, from: deocdedData)
Expand All @@ -161,8 +161,8 @@ final class FacebookLoginHelper {
if success {
//to be used -- 108566810189028?fields=height,width,images,picture
//108566810189028/picture?type=normal
let graphRequest = FBSDKGraphRequest(graphPath: "\(imageId)", parameters: ["fields":"height,width,images,picture"])
_ = graphRequest?.start(completionHandler: { (_, result, error) in
let graphRequest = GraphRequest(graphPath: "\(imageId)", parameters: ["fields":"height,width,images,picture"])
_ = graphRequest.start(completionHandler: { (_, result, error) in
if let result = result, let deocdedData = try? JSONSerialization.data(withJSONObject: result, options: JSONSerialization.WritingOptions.prettyPrinted) {
do {
let fbloginData: PictureData = try JSONDecoder().decode(PictureData.self, from: deocdedData)
Expand Down
4 changes: 2 additions & 2 deletions Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ target 'KiwiPods' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
pod 'Alamofire', '~> 4.7'
pod 'FBSDKLoginKit', '4.44.0'
pod 'FBSDKShareKit', '4.44.0'
pod 'FBSDKLoginKit', '~> 5.0.0'
pod 'FBSDKShareKit', '~> 5.0.0'
pod 'SDWebImage', '~> 5.0'
pod 'TwitterKit'
pod 'MBProgressHUD'
Expand Down

0 comments on commit 6afc2fd

Please sign in to comment.