Skip to content

Commit

Permalink
update fbcoresdkkit library
Browse files Browse the repository at this point in the history
  • Loading branch information
GaneshKumarGk committed Apr 28, 2020
1 parent 1f93f53 commit 721df51
Show file tree
Hide file tree
Showing 12 changed files with 154 additions and 218 deletions.
10 changes: 5 additions & 5 deletions Cidaas.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Pod::Spec.new do |s|
s.name = 'Cidaas'
s.version = '1.1.6'
s.version = '1.1.7'
s.summary = 'Native SDK for iOS providing login, registration and verification functionalities'
s.homepage = 'https://github.com/Cidaas/cidaas-sdk-ios-v2'
s.license = { :type => 'MIT', :file => 'LICENSE' }
Expand All @@ -29,10 +29,10 @@ Pod::Spec.new do |s|

s.subspec 'Facebook' do |fb|
fb.source_files = 'Cidaas/Classes/Facebook/**/*'
fb.dependency 'FBSDKCoreKit', '~> 4.38.0'
fb.dependency 'FBSDKLoginKit', '~> 4.38.0'
fb.dependency 'FacebookCore', '~> 0.4'
fb.dependency 'FacebookLogin', '~> 0.4'
fb.dependency 'FBSDKCoreKit', '5.5.0'
fb.dependency 'FBSDKLoginKit', '5.5.0'
fb.dependency 'FacebookCore', '0.8'
fb.dependency 'FacebookLogin', '0.8'
fb.dependency 'Cidaas/Core'
end

Expand Down
6 changes: 3 additions & 3 deletions Cidaas/Classes/Facebook/Views/CidaasFacebook.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,17 @@ public class CidaasFacebook: CidaasFacebookDelegate {

public func login(viewType: String, callback: @escaping(Result<LoginResponseEntity>) -> Void) {

loginManager.logIn(readPermissions: [.email], viewController: delegate) { (loginResult) in
loginManager.logIn(permissions: [.email], viewController: delegate) { (loginResult) in
switch loginResult {
case .cancelled:
callback(Result.failure(error: WebAuthError.shared.userCancelledException()))
break
case .failed:
callback(Result.failure(error: WebAuthError.shared.userCancelledException()))
break
case .success(grantedPermissions: _, declinedPermissions: _, token: _):
case .success(granted: _, declined: _, token: _):
if AccessToken.current != nil {
Cidaas.shared.getAccessToken(socialToken: AccessToken.current?.authenticationToken ?? "", provider: "facebook", viewType: viewType, callback: callback)
Cidaas.shared.getAccessToken(socialToken: AccessToken.current?.tokenString ?? "", provider: "facebook", viewType: viewType, callback: callback)
}
else {
callback(Result.failure(error: WebAuthError.shared.userCancelledException()))
Expand Down
65 changes: 15 additions & 50 deletions Example/Cidaas.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
1F49FA4E213D007E001A49BB /* DeduplicationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1F49FA4D213D007E001A49BB /* DeduplicationTests.swift */; };
1F49FA50213D029E001A49BB /* RegistrationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1F49FA4F213D029E001A49BB /* RegistrationTests.swift */; };
1F49FA52213D1A54001A49BB /* LinkTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1F49FA51213D1A54001A49BB /* LinkTests.swift */; };
1F49FA67213D6393001A49BB /* Pods_Cidaas_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1F49FA66213D6393001A49BB /* Pods_Cidaas_Example.framework */; };
1F49FA6F213FA087001A49BB /* EntityTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1F49FA6E213FA087001A49BB /* EntityTests.swift */; };
1F49FA712140B93C001A49BB /* HelperTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1F49FA702140B93C001A49BB /* HelperTests.swift */; };
1F49FA732140C2F2001A49BB /* Test.plist in Resources */ = {isa = PBXBuildFile; fileRef = 1F49FA722140C2F2001A49BB /* Test.plist */; };
Expand Down Expand Up @@ -97,7 +96,6 @@
1F49FA60213D6393001A49BB /* Nimble_Snapshots.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Nimble_Snapshots.framework; sourceTree = BUILT_PRODUCTS_DIR; };
1F49FA62213D6393001A49BB /* Nimble.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Nimble.framework; sourceTree = BUILT_PRODUCTS_DIR; };
1F49FA64213D6393001A49BB /* OneTimePassword.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = OneTimePassword.framework; sourceTree = BUILT_PRODUCTS_DIR; };
1F49FA66213D6393001A49BB /* Pods_Cidaas_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Pods_Cidaas_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; };
1F49FA68213D6393001A49BB /* Quick.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Quick.framework; sourceTree = BUILT_PRODUCTS_DIR; };
1F49FA6A213D6393001A49BB /* SCLAlertView.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = SCLAlertView.framework; sourceTree = BUILT_PRODUCTS_DIR; };
1F49FA6C213D6393001A49BB /* SDWebImage.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = SDWebImage.framework; sourceTree = BUILT_PRODUCTS_DIR; };
Expand Down Expand Up @@ -149,7 +147,6 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
1F49FA67213D6393001A49BB /* Pods_Cidaas_Example.framework in Frameworks */,
1762EBBD9E7A2793DF21A793 /* Pods_Cidaas_Tests.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -296,7 +293,6 @@
1F49FA60213D6393001A49BB /* Nimble_Snapshots.framework */,
1F49FA62213D6393001A49BB /* Nimble.framework */,
1F49FA64213D6393001A49BB /* OneTimePassword.framework */,
1F49FA66213D6393001A49BB /* Pods_Cidaas_Example.framework */,
1F49FA68213D6393001A49BB /* Quick.framework */,
1F49FA6A213D6393001A49BB /* SCLAlertView.framework */,
1F49FA6C213D6393001A49BB /* SDWebImage.framework */,
Expand Down Expand Up @@ -446,59 +442,33 @@
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-Cidaas_Example/Pods-Cidaas_Example-resources.sh",
"${PODS_ROOT}/GoogleSignIn/Resources/GoogleSignIn.bundle",
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Cidaas_Example/Pods-Cidaas_Example-resources-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Copy Pods Resources";
outputPaths = (
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/GoogleSignIn.bundle",
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Cidaas_Example/Pods-Cidaas_Example-resources-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Cidaas_Example/Pods-Cidaas_Example-resources.sh\"\n";
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Cidaas_Example/Pods-Cidaas_Example-resources.sh\"\n";
showEnvVarsInLog = 0;
};
84D70CB9A5305BA7D58B1A3B /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-Cidaas_Example/Pods-Cidaas_Example-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework",
"${BUILT_PRODUCTS_DIR}/Base32/Base32.framework",
"${BUILT_PRODUCTS_DIR}/Bolts/Bolts.framework",
"${BUILT_PRODUCTS_DIR}/Cidaas/Cidaas.framework",
"${BUILT_PRODUCTS_DIR}/CryptoSwift/CryptoSwift.framework",
"${BUILT_PRODUCTS_DIR}/FBSDKCoreKit/FBSDKCoreKit.framework",
"${BUILT_PRODUCTS_DIR}/FBSDKLoginKit/FBSDKLoginKit.framework",
"${BUILT_PRODUCTS_DIR}/FacebookCore/FacebookCore.framework",
"${BUILT_PRODUCTS_DIR}/FacebookLogin/FacebookLogin.framework",
"${BUILT_PRODUCTS_DIR}/GTMSessionFetcher/GTMSessionFetcher.framework",
"${BUILT_PRODUCTS_DIR}/GoogleToolboxForMac/GoogleToolboxForMac.framework",
"${BUILT_PRODUCTS_DIR}/OneTimePassword/OneTimePassword.framework",
"${BUILT_PRODUCTS_DIR}/SwiftKeychainWrapper/SwiftKeychainWrapper.framework",
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Cidaas_Example/Pods-Cidaas_Example-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Alamofire.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Base32.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Bolts.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Cidaas.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CryptoSwift.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FBSDKCoreKit.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FBSDKLoginKit.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FacebookCore.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FacebookLogin.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GTMSessionFetcher.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GoogleToolboxForMac.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/OneTimePassword.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SwiftKeychainWrapper.framework",
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Cidaas_Example/Pods-Cidaas_Example-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Cidaas_Example/Pods-Cidaas_Example-frameworks.sh\"\n";
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Cidaas_Example/Pods-Cidaas_Example-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
AA46F84477FCA8E0C1116A4B /* [CP] Check Pods Manifest.lock */ = {
Expand All @@ -524,21 +494,16 @@
buildActionMask = 12;
files = (
);
inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-Cidaas_Tests/Pods-Cidaas_Tests-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/Mockingjay/Mockingjay.framework",
"${BUILT_PRODUCTS_DIR}/Quick/Quick.framework",
"${BUILT_PRODUCTS_DIR}/URITemplate/URITemplate.framework",
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Cidaas_Tests/Pods-Cidaas_Tests-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Mockingjay.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Quick.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/URITemplate.framework",
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Cidaas_Tests/Pods-Cidaas_Tests-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Cidaas_Tests/Pods-Cidaas_Tests-frameworks.sh\"\n";
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Cidaas_Tests/Pods-Cidaas_Tests-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>Cidaas_Example.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>21</integer>
</dict>
</dict>
</dict>
</plist>
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
uuid = "719ACC12-FCE9-49B2-88E8-5CEA716A6F33"
type = "0"
version = "2.0">
</Bucket>
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>Cidaas-Example.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>1</integer>
</dict>
<key>Cidaas.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
</dict>
</plist>
19 changes: 5 additions & 14 deletions Example/Cidaas/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,32 +11,23 @@ import Cidaas
import FacebookCore
import FacebookLogin
import FBSDKCoreKit
import GoogleSignIn

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate, GIDSignInDelegate {
class AppDelegate: UIResponder, UIApplicationDelegate {

var window: UIWindow?
let google = CidaasGoogle.shared

func sign(_ signIn: GIDSignIn!, didSignInFor user: GIDGoogleUser!, withError error: Error!) {
google.didSignIn(signIn, didSignInFor: user, withError: error)
}

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
Cidaas.shared.ENABLE_LOG = true
google.configure(self)
SDKApplicationDelegate.shared.application(application, didFinishLaunchingWithOptions: launchOptions)

ApplicationDelegate.shared.application(application, didFinishLaunchingWithOptions: launchOptions)
return true
}


func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool {
if SDKApplicationDelegate.shared.application(app, open: url, options: options) {
return true
}
else if GIDSignIn.sharedInstance().handle(url, sourceApplication: options[UIApplicationOpenURLOptionsKey.sourceApplication] as? String, annotation: options[UIApplicationOpenURLOptionsKey.annotation]) {
if ApplicationDelegate.shared.application(app, open: url, options: options) {
return true
}
else {
Expand All @@ -54,7 +45,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, GIDSignInDelegate {
func applicationDidBecomeActive(_ application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.

FBSDKAppEvents.activateApp()
AppEvents.activateApp()
}

func applicationWillResignActive(_ application: UIApplication) {
Expand Down
8 changes: 4 additions & 4 deletions Example/Cidaas/CidaasGoogle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import Foundation
import GoogleSignIn
import Cidaas

public class CidaasGoogle : UIViewController, GIDSignInUIDelegate, CidaasGoogleDelegate {
public class CidaasGoogle : UIViewController, GIDSignInDelegate, CidaasGoogleDelegate {

public static var shared : CidaasGoogle = CidaasGoogle()
var googleCallback: ((Result<LoginResponseEntity>) -> ())!
Expand All @@ -30,7 +30,7 @@ public class CidaasGoogle : UIViewController, GIDSignInUIDelegate, CidaasGoogleD
var googleViewController: UIViewController!

public func login(viewType: String, callback: @escaping(Result<LoginResponseEntity>) -> Void) {
GIDSignIn.sharedInstance().uiDelegate = self
GIDSignIn.sharedInstance()?.delegate = self
GIDSignIn.sharedInstance().signIn()

self.viewType = viewType
Expand All @@ -56,7 +56,7 @@ public class CidaasGoogle : UIViewController, GIDSignInUIDelegate, CidaasGoogleD
googleViewController.dismiss(animated: true, completion: nil)
}

public func didSignIn(_ signIn: GIDSignIn!, didSignInFor user: GIDGoogleUser!, withError error: Error!) {
public func sign(_ signIn: GIDSignIn!, didSignInFor user: GIDGoogleUser!, withError error: Error!) {
if user != nil {
Cidaas.shared.getAccessToken(socialToken: user.authentication.accessToken ?? "", provider: "google", viewType: self.viewType, callback: googleCallback)
}
Expand All @@ -73,7 +73,7 @@ public class CidaasGoogle : UIViewController, GIDSignInUIDelegate, CidaasGoogleD

if let clientID = dict?.object(forKey: "CLIENT_ID") {
GIDSignIn.sharedInstance().clientID = clientID as? String ?? ""
GIDSignIn.sharedInstance().delegate = appDelegate
// GIDSignIn.sharedInstance().delegate = appDelegate
}
}
}
Expand Down
8 changes: 3 additions & 5 deletions Example/Cidaas/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="mMs-dv-jeo">
<device id="retina5_9" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15705" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="mMs-dv-jeo">
<device id="retina5_9" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14460.20"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15706"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
Expand Down
Loading

0 comments on commit 721df51

Please sign in to comment.