react-native-prizor-sdk-module 3.2.5 → 3.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -16,9 +16,9 @@ Open `ios/Podfile` and fill the requirements above:
|
|
|
16
16
|
```Podfile
|
|
17
17
|
use_frameworks!
|
|
18
18
|
```
|
|
19
|
-
- Set minimum deployment target to `
|
|
19
|
+
- Set minimum deployment target to `12.0`
|
|
20
20
|
```Podfile
|
|
21
|
-
platform :ios, '
|
|
21
|
+
platform :ios, '12.0'
|
|
22
22
|
```
|
|
23
23
|
- Add private repository `source`
|
|
24
24
|
```Podfile
|
|
@@ -64,10 +64,10 @@ Remove `NSAllowsArbitraryLoads` and `NSExceptionDomains` from `Info.plist`:
|
|
|
64
64
|
|
|
65
65
|
### Android
|
|
66
66
|
|
|
67
|
-
Use minimum SDK version to `
|
|
67
|
+
Use minimum SDK version to `21` at project `build.gradle`:
|
|
68
68
|
|
|
69
69
|
```gradle
|
|
70
|
-
minSdkVersion
|
|
70
|
+
minSdkVersion 21
|
|
71
71
|
```
|
|
72
72
|
|
|
73
73
|
Enable `multiDexEnabled` at application `build.gradle`:
|
|
@@ -92,6 +92,49 @@ android {
|
|
|
92
92
|
}
|
|
93
93
|
```
|
|
94
94
|
|
|
95
|
+
Allow Prizor to request the opening of other apps on the user's device by adding the <queries> tag in the AndroidManifest.xml:
|
|
96
|
+
|
|
97
|
+
```xml
|
|
98
|
+
...
|
|
99
|
+
<queries>
|
|
100
|
+
<package android:name="com.whatsapp" />
|
|
101
|
+
<package android:name="com.whatsapp.w4b" />
|
|
102
|
+
<intent>
|
|
103
|
+
<action android:name="android.intent.action.VIEW" />
|
|
104
|
+
<data android:scheme="https" />
|
|
105
|
+
</intent>
|
|
106
|
+
<intent>
|
|
107
|
+
<action android:name="android.intent.action.DIAL" />
|
|
108
|
+
<data android:scheme="tel" />
|
|
109
|
+
</intent>
|
|
110
|
+
<intent>
|
|
111
|
+
<action android:name="android.intent.action.SEND" />
|
|
112
|
+
<data android:mimeType="*/*" />
|
|
113
|
+
</intent>
|
|
114
|
+
</queries>
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Configure the Prizor's private maven repository:
|
|
118
|
+
|
|
119
|
+
- **1st option:** set the environment variables `MAVEN_PRIZOR_USERNAME` and `MAVEN_PRIZOR_PASSWORD` with the given credentials
|
|
120
|
+
|
|
121
|
+
- **2nd option:** replace the values of the entries `username` and `password` with the given credentials at `build.gradle` of the `react-native-prizor-sdk-module` module:
|
|
122
|
+
|
|
123
|
+
```gradle
|
|
124
|
+
repositories {
|
|
125
|
+
maven {
|
|
126
|
+
url "https://maven.prizor.com/"
|
|
127
|
+
credentials {
|
|
128
|
+
username System.getenv('MAVEN_PRIZOR_USERNAME') ?: "username"
|
|
129
|
+
password System.getenv('MAVEN_PRIZOR_PASSWORD') ?: "password"
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
maven {
|
|
133
|
+
url 'https://storage.googleapis.com/download.flutter.io'
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
```
|
|
137
|
+
|
|
95
138
|
## Usage
|
|
96
139
|
|
|
97
140
|
```js
|
|
@@ -168,7 +211,7 @@ watchman watch-del-all && npx react-native start --reset-cache
|
|
|
168
211
|
npx react-native run-ios
|
|
169
212
|
```
|
|
170
213
|
|
|
171
|
-
> Remember to check that Podfile was installed. Assert running `pod install` at `ios` path.
|
|
214
|
+
> Remember to check that Podfile was installed and its repos updated. Assert running `pod install --repo-update` at `ios` path.
|
|
172
215
|
|
|
173
216
|
#### Android
|
|
174
217
|
|
|
@@ -176,10 +219,6 @@ npx react-native run-ios
|
|
|
176
219
|
npx react-native run-android
|
|
177
220
|
```
|
|
178
221
|
|
|
179
|
-
## Contributing
|
|
180
|
-
|
|
181
|
-
See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.
|
|
182
|
-
|
|
183
222
|
## License
|
|
184
223
|
|
|
185
224
|
MIT
|
package/android/build.gradle
CHANGED
|
@@ -35,7 +35,7 @@ android {
|
|
|
35
35
|
compileSdkVersion getExtOrIntegerDefault('compileSdkVersion')
|
|
36
36
|
buildToolsVersion getExtOrDefault('buildToolsVersion')
|
|
37
37
|
defaultConfig {
|
|
38
|
-
minSdkVersion
|
|
38
|
+
minSdkVersion 21
|
|
39
39
|
targetSdkVersion getExtOrIntegerDefault('targetSdkVersion')
|
|
40
40
|
versionCode 1
|
|
41
41
|
versionName "1.0"
|
|
@@ -12,12 +12,44 @@ class PrizorSdkModuleModule(reactContext: ReactApplicationContext) : ReactContex
|
|
|
12
12
|
@ReactMethod
|
|
13
13
|
fun startWithJson(jsonString: String) {
|
|
14
14
|
if (!this.reactApplicationContext.hasCurrentActivity()) return;
|
|
15
|
-
this.reactApplicationContext.currentActivity?.runOnUiThread {
|
|
15
|
+
this.reactApplicationContext.currentActivity?.runOnUiThread {
|
|
16
|
+
PrizorManager.startPrizor(
|
|
17
|
+
this.reactApplicationContext.currentActivity,
|
|
18
|
+
jsonString,
|
|
19
|
+
null,
|
|
20
|
+
null,
|
|
21
|
+
null,
|
|
22
|
+
null,
|
|
23
|
+
null,
|
|
24
|
+
null,
|
|
25
|
+
null,
|
|
26
|
+
null,
|
|
27
|
+
null,
|
|
28
|
+
null,
|
|
29
|
+
null
|
|
30
|
+
)
|
|
31
|
+
}
|
|
16
32
|
}
|
|
17
33
|
|
|
18
34
|
@ReactMethod
|
|
19
35
|
fun startWithKeyValuePairs(keyValuePairs: ReadableMap) {
|
|
20
36
|
if (!this.reactApplicationContext.hasCurrentActivity()) return;
|
|
21
|
-
this.reactApplicationContext.currentActivity?.runOnUiThread {
|
|
37
|
+
this.reactApplicationContext.currentActivity?.runOnUiThread {
|
|
38
|
+
PrizorManager.startPrizor(
|
|
39
|
+
this.reactApplicationContext.currentActivity,
|
|
40
|
+
keyValuePairs.toHashMap(),
|
|
41
|
+
null,
|
|
42
|
+
null,
|
|
43
|
+
null,
|
|
44
|
+
null,
|
|
45
|
+
null,
|
|
46
|
+
null,
|
|
47
|
+
null,
|
|
48
|
+
null,
|
|
49
|
+
null,
|
|
50
|
+
null,
|
|
51
|
+
null
|
|
52
|
+
)
|
|
53
|
+
}
|
|
22
54
|
}
|
|
23
55
|
}
|
|
@@ -12,7 +12,11 @@ class PrizorSdkModule: NSObject {
|
|
|
12
12
|
func start(jsonString: String) -> Void {
|
|
13
13
|
DispatchQueue.main.async {
|
|
14
14
|
if let viewController = RCTPresentedViewController(), !jsonString.isEmpty, let jsonData = jsonString.data(using: .utf8) {
|
|
15
|
-
PrizorManager.startPrizor(
|
|
15
|
+
PrizorManager.startPrizor(
|
|
16
|
+
from: viewController,
|
|
17
|
+
withJson: jsonData,
|
|
18
|
+
animated: false
|
|
19
|
+
)
|
|
16
20
|
}
|
|
17
21
|
}
|
|
18
22
|
}
|
|
@@ -21,7 +25,11 @@ class PrizorSdkModule: NSObject {
|
|
|
21
25
|
func start(keyValuePairs: [String: Any]) -> Void {
|
|
22
26
|
DispatchQueue.main.async {
|
|
23
27
|
if let viewController = RCTPresentedViewController() {
|
|
24
|
-
PrizorManager.startPrizor(
|
|
28
|
+
PrizorManager.startPrizor(
|
|
29
|
+
from: viewController,
|
|
30
|
+
with: keyValuePairs,
|
|
31
|
+
animated: false
|
|
32
|
+
)
|
|
25
33
|
}
|
|
26
34
|
}
|
|
27
35
|
}
|
package/package.json
CHANGED
|
@@ -10,7 +10,7 @@ Pod::Spec.new do |s|
|
|
|
10
10
|
s.license = package["license"]
|
|
11
11
|
s.authors = package["author"]
|
|
12
12
|
|
|
13
|
-
s.platforms = { :ios => "
|
|
13
|
+
s.platforms = { :ios => "12.0" }
|
|
14
14
|
s.source = { :git => "https://git-ext.crmall.com/npm/react-native-prizor-sdk-module.git", :tag => "#{s.version}" }
|
|
15
15
|
|
|
16
16
|
s.source_files = "ios/**/*.{h,m,mm,swift}"
|