README
react-native-prizor-sdk-module
iOS and Android native integration for Prizor SDK
Installation
npm install react-native-prizor-sdk-module
iOS
Open ios/Podfile
and fill the requirements above:
Check to use frameworks
use_frameworks!
Set minimum deployment target to
11.0
platform :ios, '11.0'
Add private repository
source
source 'https://git-ext.crmall.com/cocoapods/specs.git'
Add public repository
source
source 'https://cdn.cocoapods.org/'
Run pod install at
ios
path$ pod install
Add NSAllowsLocalNetworking
as true
at Info.plist
:
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsLocalNetworking</key>
<true/>
</dict>
Remove NSAllowsArbitraryLoads
and NSExceptionDomains
from Info.plist
:
<key>NSAppTransportSecurity</key>
<dict>
<!-- <key>NSAllowsArbitraryLoads</key>
<false/>
<key>NSExceptionDomains</key>
<dict>
<key>localhost</key>
<dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
</dict>
</dict> -->
</dict>
Android
Use minimum SDK version to 19
at project build.gradle
:
minSdkVersion 19
Enable multiDexEnabled
at application build.gradle
:
android {
defaultConfig {
//...
multiDexEnabled true
}
}
Add Java 8
compatibility at application build.gradle
:
android {
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
Usage
import PrizorSdkModule from "react-native-prizor-sdk-module";
// ...
PrizorSdkModule.startWithJson(params);
Start with Json
let params = (
'{' +
' "environment":"production",' +
' "appId":"***",' +
' "secret":"***",' +
// ...
'}'
)
PrizorSdkModule.startWithJson(params);
Start with key value pairs
let params = {
environment: 'production',
appId: '***',
secret: '***',
// ...
}
PrizorSdkModule.startWithKeyValuePairs(params);
Close
PrizorSdkModule.close();
Useful commands
Creating a new application
npx react-native init AwesomeProject
You can also start a project with a custom React Native template, like TypeScript, with --template argument:
npx react-native init AwesomeTSProject --template react-native-template-typescript
Starting React Native application
npx react-native start
You can also start reseting the cache:
watchman watch-del-all && npx react-native start --reset-cache
Running the application
iOS
npx react-native run-ios
Remember to check that Podfile was installed. Assert running
pod install
atios
path.
Android
npx react-native run-android
Contributing
See the contributing guide to learn how to contribute to the repository and the development workflow.
License
MIT