@woosmap/react-native-plugin-geofencing 0.12.3 → 0.13.0
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/CHANGELOG.md
CHANGED
|
@@ -16,6 +16,7 @@ import java.util.Map;
|
|
|
16
16
|
import java.util.TimeZone;
|
|
17
17
|
import org.json.JSONException;
|
|
18
18
|
import org.json.JSONObject;
|
|
19
|
+
import com.google.gson.Gson;
|
|
19
20
|
|
|
20
21
|
public class AirshipPushHelper implements AbstractPushHelper {
|
|
21
22
|
SimpleDateFormat displayDateFormatAirship;
|
|
@@ -40,23 +41,38 @@ public class AirshipPushHelper implements AbstractPushHelper {
|
|
|
40
41
|
String key;
|
|
41
42
|
Class type;
|
|
42
43
|
for (Map.Entry<String, Object> entry : data.entrySet()) {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
44
|
+
try{
|
|
45
|
+
key = entry.getKey();
|
|
46
|
+
keyData = entry.getValue();
|
|
47
|
+
if (keyData == null){
|
|
48
|
+
keyData = "";
|
|
49
|
+
}
|
|
50
|
+
type = keyData.getClass();
|
|
51
|
+
if (type.getName().equals("java.lang.Double")){
|
|
52
|
+
type = double.class;
|
|
53
|
+
}
|
|
54
|
+
else if (type.getName().equals("java.lang.Integer")){
|
|
55
|
+
type = int.class;
|
|
56
|
+
}
|
|
57
|
+
else if (type.getName().equals("java.lang.Boolean")){
|
|
58
|
+
type = boolean.class;
|
|
59
|
+
}
|
|
60
|
+
else if (type.getName().equals("java.lang.Long")){
|
|
61
|
+
type = long.class;
|
|
62
|
+
}
|
|
63
|
+
else if (type.getName().equals("com.google.gson.internal.LinkedTreeMap")) {
|
|
64
|
+
type = String.class;
|
|
65
|
+
keyData = new Gson().toJson(keyData);
|
|
66
|
+
} else {
|
|
67
|
+
type = String.class;
|
|
68
|
+
keyData = keyData.toString();
|
|
69
|
+
}
|
|
70
|
+
addProp = builderClass.getMethod("addProperty", String.class, type);
|
|
71
|
+
addProp.invoke(builderInstance,key, keyData);
|
|
54
72
|
}
|
|
55
|
-
|
|
56
|
-
|
|
73
|
+
catch (Exception ex){
|
|
74
|
+
Log.e(TAG, ex.toString());
|
|
57
75
|
}
|
|
58
|
-
addProp = builderClass.getMethod("addProperty", String.class, type);
|
|
59
|
-
addProp.invoke(builderInstance,key, keyData);
|
|
60
76
|
}
|
|
61
77
|
|
|
62
78
|
Method build = builderClass.getMethod("build");
|
|
@@ -71,7 +87,7 @@ public class AirshipPushHelper implements AbstractPushHelper {
|
|
|
71
87
|
Method track = eventClass.getMethod("track");
|
|
72
88
|
Object trackResult = track.invoke(eventInstance);
|
|
73
89
|
Log.d(TAG,"event tracked");
|
|
74
|
-
|
|
90
|
+
break;
|
|
75
91
|
}
|
|
76
92
|
catch (Exception ex) {
|
|
77
93
|
Log.e(TAG, ex.toString());
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@woosmap/react-native-plugin-geofencing",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"description": "This react-native plugin extends the functionality offered by the Woosmap Geofencing Mobile SDKs. Find more about the Woosmap Geofencing SDK",
|
|
5
5
|
"main": "lib/commonjs/index",
|
|
6
6
|
"module": "lib/module/index",
|