Upgrading from Version 3.5.2 to 3.5.3
Update your Code
In the Gigya class, the requestNewFacebookPublishPermissions selector has a new viewController parameter.
In the Gigya class, the requestNewFacebookReadPermissions selector has a new viewController parameter.
Upgrading from Version 3.5.0 to 3.5.1
Update your Code
- In the GSRequest class, the sendSynchronouslyWithError selector was removed. Replace all occurrences with the sendWithResponseHandler selector.
- In the Gigya class, the session selector for accessing the GSSession instance was removed. To gain access to the GSSession instance use the getSessionWithCompletionHandler handler. This will open the Touch ID UI if necessary.
- To check if there is a valid session stored on the device, use the isSessionValid selector. It will never present a UI to the user.
Upgrading from Version 3.4.3 to 3.5.0
Migration to Google Sign-In
Upgrading from Version 3.2 to 3.3
Upgrade your Facebook SDK
Version 3.3 of the Gigya iOS SDK was tested with Facebook iOS SDK 4.1.0. Download the latest Facebook SDK here.
Update Method Parameters
- See new initialization method signature - initWithAPIKey.
- New handleOpenURL signature.
- The facebookLoginBehavior parameter of the login method now accepts new values that correspond to the new Facebook SDK login behavior.
Upgrading from Version 3.0 to 3.0.6
Upgrade Your Facebook SDK
Update Facebook Permission Request
Gigya's requestFacebookPublishPermissions method has been renamed to requestNewFacebookPublishPermissions , and a new parameter was added to its completion block. Make sure to update your method call.
Upgrading from Version 2.17 to 3.0
Upgrade Your External SDKs
GSSessionDelegate has been deprecated to make room for two namespace-specific listeners: GSSocializeDelegate and GSAccountsDelegate.
Upgrading from Version 2.16 to 2.17
In your app's Info tab, add a URL type and enter your bundle ID as the identifier and scheme:
These specified Gigya methods have been deprecated and have been replaced according to the following table:
Upgrading from Versions Lower than 2.16
In version 2.16, Gigya’s iOS SDK has been rewritten from the ground up in order to make it easier to implement and more familiar to iOS developers. To achieve this, the structure of the classes and methods were changed, making the new 2.16 version not backwards-compatible with previous versions.
This guide takes you through the steps you need in order to upgrade an app that was developed with versions earlier than 2.16. The steps are:
- Understanding the new class structure
- Updating your project and dependencies
- Updating the login process
- Updating the requests process
Understanding the New Class Structure
In the previous versions the GSAPI class was your single point of contact. You had to create, initialize, and retain an instance of the GSAPI class, and then use it for both login and requests. From version 2.16, the GSAPI class has been replaced by the Gigya and GSRequest classes.
Gigya holds the SDK’s global settings, as well as the methods that invoke the flows for logging in, logging out, and adding or removing a connection. All of Gigya’s methods are class methods, so there is no need to create and retain your own instance.
GSRequest class is used to send a request to Gigya’s API and handle its response with completion blocks instead of a delegate.
In the previous versions, parameters for either kind of methods were passed in a GSObject instance. In the new version, the GSObject has been phased out, and parameters should be passed in a simple NSDictionary. The requests return either a GSResponse instance or a GSUser instance, depending on the API method.
|Task||Before 2.16||From 2.16|
|Initialize (in your AppDelegate’s didFinishLaunchingWithOptions: method)||GSAPI *gsAPI = [[GSAPI alloc] initWithAPIKey:key];||Gigya initWithAPIKey:key];|
|Login flow - multiple providers (show provider selection then login)||GSAPI’s showLoginUI:ViewController:delegate:context:||Gigya’s showLoginProvidersDialog* methods|
|Login flow - single provider (direct login to provider)||GSAPI’s login:ViewController:delegate:context:||Gigya’s showLoginDialog* methods|
|Logout||GSAPI’s logout||Gigya’s logout* methods|
|Checking if the user is logged in||Checking if GSAPI’s getSession returns nil||[[Gigya session] isValid]|
|Add connection flow - multiple providers (with provider selection)||GSAPI’s showAddConnectionsUI:ViewController:delegate:context:||Gigya’s showAddConnectionProvidersDialog* methods|
|Add connection flow - single provider (direct login to provider)||GSAPI’s addConnection:ViewController:delegate:context:||Gigya’s showAddConnectionDialog* methods|
|Removing a connection||GSAPI’s removeConnection:delegate:context:||Gigya’s removeConnectionToProvider* methods|
|Sending a request||GSAPI’s sendRequest:params:useHTTPS:delegate:context:||GSRequest|
|Handling session changes||Passing a delegate to each of the above methods||Setting Gigya’s sessionDelegate property|
|Handling native login (SSO) fast app switch (in your AppDelegate’s application:openURL:sourceApplication:annotation: method)||GSAPI’s handleOpenURL:sourceApplication:annotation:||Gigya’s handleOpenURL:sourceApplication:annotation|
Updating Your Project and Dependencies
- Download Gigya’s iOS SDK 2.16, extract the zip file and replace the GigyaSDK.framework in your project with the new version.
- In your app's Info tab, add a URL type and enter your bundle ID as the identifier and scheme:
- If you're using Facebook's native login (SSO), download the Facebook iOS SDK 3.6 and replace the FacebookSDK.framework files in your project with the new version. Remove the .bundle files from the previous Facebook SDK versions.
- If you're using Facebook's native login (SSO) with a URL scheme suffix (using the same Facebook app ID for different iOS apps), the URL scheme suffix should be added to the plist, as opposed to passing it as a parameter to the login methods.
- If you're using the Google+ native login (SSO), download the Google+ iOS SDK 1.3.0 and replace the GooglePlus.framework and GoogleOpenSource.framework files in your project with the new version.
- Remove the -lsqlite linker flag from the build settings. Note that the -ObjC flag is still required.
Version 2.15.8 required linking the project with many required frameworks. With version 2.16, you can link only frameworks that you really use, for example, there is no need to add Twitter.framework if you aren’t using Twitter SSO.
In your project’s settings, add or remove frameworks from “Linked Frameworks and Libraries” according to this table:
Before 2.16 From 2.16 + Facebook Native Login + Google+Native Login + Twitter SSO GigyaSDK.framework
GigyaSDK.framework FacebookSDK.framework GooglePlus.framework
In your source files, remove all
#includesfor GigyaSDK classes and replace with a single line:
In your AppDelegate file, replace:
If you're using the Facebook or Google+ native login, in your AppDelegate file, replace:
Updating the Login Process
In previous versions, when calling GSAPI’s login: or showLoginUI: methods, you passed a delegate parameter that handled the login process result. In 2.16, this can be achieved in one of two ways:
- Calling one of Gigya’s showLoginDialog* or showLoginProvidersDialog* with a completion handler. The completion handler should handle the login flow’s success or failure.
- Setting a global session delegate using Gigya’s setSessionDelegate, which will handle any change in the active session (login, logout, other session changes).
The example below demonstrates how to migrate from the old showLoginUI method to the new showLoginProviders method. The same migration can be applied to the other login and add connection methods, as mapped in the table above.
Updating the Requests Process
In previous versions sending a request to the Gigya REST API was done by using GSAPI’s sendRequest method, passing a delegate to handle the response. In 2.16, this functionality was separated to a new class called GSRequest. For every request, you must create a GSRequest instance, set its parameters (if needed), and send it, passing a completion block for the response handling code.
Facebook and Google+ SDK Supported Versions
Gigya's iOS SDK has been tested with the latest Facebook and Google+ SDKs, currently at 3.17 and 1.7 respectively.