- Install the library :
yarn add react-native-gigya-sdk base-64
- If you haven't done so already, install a persistent storage library (like EncryptedStorage) 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
.swift
file (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.swift
file to your target (inside Compile Sources from the Build Phases tab) to handle the communication with the Gigya SDK. The file is available inside theGigyaProviders.zip
asset that comes with eachgigya-swift-sdk
release.
See steps
- Add the desired Gigya SDK version to your
android/build.gradle
:
buildscript {
ext {
gigyaCoreSdkVersion = "7.1.1"
}
}
- 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.
You can now initialize the SDK with your apiKey
,
dataCenter
, application
lang
,
storage
solution & desired storageKey.
โ Please make sure your storage library exposes getItem()
and setItem()
functions or provided them yourself.
import EncryptedStorage from 'react-native-encrypted-storage'
import GigyaSdk, { GigyaSdkDataCenterEnum } from 'react-native-gigya-sdk'
// Before anything we initialize the SDK.
GigyaSdk.init({
lang: 'en',
storage: EncryptedStorage,
storageKey: 'RANDOM_STRING'
apiKey: 'INSERT_GIGYA_API_KEY',
dataCenter: GigyaSdkDataCenterEnum.EU1,
})
// 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