expo-prizor-sdk v4.7.0
expo-prizor-sdk
iOS and Android Expo integration for Prizor SDK
Installation
npm install expo-prizor-sdkiOS
XCode 14+ is recommended.
Open ios/Podfile and fill the requirements above:
- Check to use frameworks
use_frameworks! - Set minimum deployment target to
13.0platform :ios, '13.0' - Add private repository
sourcesource 'https://git-ext.crmall.com/cocoapods/specs.git' - Add public repository
sourcesource 'https://cdn.cocoapods.org/' Run pod install at
iospath$ pod install
Add NSAllowsLocalNetworking as true at Info.plist:
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsLocalNetworking</key>
<true/>
</dict>Add NSAllowsArbitraryLoads, NSAllowsArbitraryLoadsInWebContent and io.flutter.embedded_views_preview as true at Info.plist:
<key>io.flutter.embedded_views_preview</key>
<true/>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
<key>NSAllowsArbitraryLoadsInWebContent</key>
<true/>
</dict>Remove NSExceptionDomains from Info.plist:
<key>NSAppTransportSecurity</key>
<dict>
<!-- <key>NSExceptionDomains</key>
<dict>
<key>localhost</key>
<dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
</dict>
</dict> -->
</dict>Android
Use minimum SDK version to 24 at project build.gradle:
minSdkVersion 22Enable 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
}
}Allow Prizor to request the opening of other apps on the user's device by adding the tag in the AndroidManifest.xml:
...
<queries>
<package android:name="com.whatsapp" />
<package android:name="com.whatsapp.w4b" />
<intent>
<action android:name="android.intent.action.VIEW" />
<data android:scheme="https" />
</intent>
<intent>
<action android:name="android.intent.action.DIAL" />
<data android:scheme="tel" />
</intent>
<intent>
<action android:name="android.intent.action.SEND" />
<data android:mimeType="*/*" />
</intent>
</queries>Configure the Prizor's private maven repository:
1st option: set the environment variables
MAVEN_PRIZOR_USERNAMEandMAVEN_PRIZOR_PASSWORDwith the given credentials2nd option: replace the values of the entries
usernameandpasswordwith the given credentials atbuild.gradleof theexpo-prizor-sdkmodule:
repositories {
maven {
url "https://maven.prizor.com/"
credentials {
username System.getenv('MAVEN_PRIZOR_USERNAME') ?: "username"
password System.getenv('MAVEN_PRIZOR_PASSWORD') ?: "password"
}
}
maven {
url 'https://storage.googleapis.com/download.flutter.io'
}
}Usage
import PrizorSdkModule from "expo-prizor-sdk";
// ...
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 AwesomeProjectRunning the application
iOS
npx expo run:iosRemember to check that Podfile was installed and its repos updated. Assert running
pod install --repo-updateatiospath.
Android
npx expo run:androidLicense
MIT
10 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago