@metrixorg/react-native-plugin 2.2.12 → 2.2.14

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.
@@ -38,9 +38,9 @@ rootProject.allprojects {
38
38
  dependencies {
39
39
  implementation 'com.facebook.react:react-native:+'
40
40
 
41
- implementation 'ir.metrix.analytics:metrix-reactnative:2.2.11'
42
- implementation 'ir.metrix.attribution:metrix-reactnative:2.2.11'
41
+ implementation 'ir.metrix.analytics:metrix-reactnative:2.2.14'
42
+ implementation 'ir.metrix.attribution:metrix-reactnative:2.2.14'
43
43
  if (project.ext.notificationEnabled) {
44
- api 'ir.metrix.notification:metrix-reactnative:2.2.11'
44
+ api 'ir.metrix.notification:metrix-reactnative:2.2.14'
45
45
  }
46
46
  }
@@ -194,6 +194,14 @@ public class MetrixModule extends ReactContextBaseJavaModule {
194
194
  ir.metrix.attribution.MetrixAttribution.setPushToken(token);
195
195
  }
196
196
 
197
+ @ReactMethod
198
+ public void loadInAppMessages() {
199
+ ir.metrix.reactnative.Reflection.invokeStaticMethod(
200
+ "ir.metrix.notification.MetrixNotification",
201
+ "loadInAppMessages"
202
+ );
203
+ }
204
+
197
205
  @ReactMethod
198
206
  public void setOnAttributionChangedListener() {
199
207
  ir.metrix.attribution.MetrixAttribution.setOnAttributionChangedListener(
@@ -0,0 +1,12 @@
1
+ package ir.metrix.reactnative;
2
+
3
+ import java.lang.reflect.Method;
4
+
5
+ public class Reflection {
6
+
7
+ public static Object invokeStaticMethod(String className, String methodName) throws Exception {
8
+ Class<?> clazz = Class.forName(className);
9
+ Method method = clazz.getDeclaredMethod(methodName);
10
+ return method.invoke(null);
11
+ }
12
+ }
package/index.js CHANGED
@@ -171,6 +171,12 @@ Metrix.setUserFcmToken = function (fcmToken) {
171
171
  }
172
172
  }
173
173
 
174
+ Metrix.loadInAppMessages = function () {
175
+ if (Platform.OS === "android") {
176
+ module_metrix.loadInAppMessages();
177
+ }
178
+ }
179
+
174
180
  Metrix.userChannelEnabled = function (channel) {
175
181
  if (Platform.OS === "android") {
176
182
  if (typeof channel === 'string') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metrixorg/react-native-plugin",
3
- "version": "2.2.12",
3
+ "version": "2.2.14",
4
4
  "description": "Metrix React native plugin",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -8,7 +8,7 @@
8
8
  "deploy": "git checkout master && git pull && git merge develop",
9
9
  "major": "2",
10
10
  "minor": "2",
11
- "patch": "12"
11
+ "patch": "14"
12
12
  },
13
13
  "author": "Metrix",
14
14
  "license": "Apache 2.0",