- Install the library :
yarn add react-native-gigya-sdk base-64- If you haven't done so already, install a persistent storage library (like SecureStorage) as you'll need to provide it during setup. Just make sure your library exposes
getItem()andsetItem()functions.
See steps
- Add the following line to your
ios/Podfile:
pod 'Gigya'- From
/ios, run:
pod install- If you don't already have a Swift file in your project, via Xcode, create a
.swiftfile (ie:Bridge.swift) in your Xcode workspace and accept toCreate Bridging Header:
//
// Bridge.swift
// GigyaSdkExample
//
import Foundation- If you're planing on providing social login, search for the "Facebook", "Google", etc section and follow the full documentation to install and set up its SDK. You can then open Xcode and add its
Wrapper.swiftfile to your target (inside Compile Sources from the Build Phases tab) to handle the communication with the Gigya SDK. The files are available inside theGigyaProviders.zipasset that comes with eachgigya-swift-sdkrelease.
See steps
- Add the desired Gigya SDK version to your
android/build.gradle:
buildscript {
ext {
gigyaCoreSdkVersion = "7.1.5"
}
}
- If you're planing on providing social login, search for the "Facebook", "Google", etc section and follow the full documentation to install and set up the social provider SDK. Also add the required
Wrapper.javafile to your project to handle the communication with the Gigya SDK, as instructed in this section of the documentation. The files are available inside the assets that comes with eachgigya-android-sdkrelease or in the codebase example folder.
You can now initialize the SDK with your apiKey,
dataCenter, application
lang,
storage solution and desired storageKey & linkAccountVersion.
β Please make sure your storage library exposes getItem() and setItem() functions or provided them yourself.
import SecureStorage from 'react-native-fast-secure-storage'
import GigyaSdk, { GigyaSdkDataCenterEnum, GigyaSdkLinkAccountVersions } from 'react-native-gigya-sdk'
// Before anything we initialize the SDK.
GigyaSdk.init({
lang: 'en',
storage: SecureStorage,
storageKey: 'RANDOM_STRING'
apiKey: 'INSERT_GIGYA_API_KEY',
dataCenter: GigyaSdkDataCenterEnum.EU1,
linkAccountVersion: GigyaSdkLinkAccountVersions.V2,
})
// Now we can use it.
const myAccount = await GigyaSdk.login(email, password)See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT