reactnative-plugin-appice 1.6.4 → 1.6.5

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.
@@ -69,7 +69,7 @@ repositories {
69
69
  url "https://gitlab.com/api/v4/projects/10636887/packages/maven"
70
70
  credentials(HttpHeaderCredentials) {
71
71
  name = "Deploy-Token"
72
- value = "S2WnyKYP_YpPxsBfeRtZ"
72
+ value = "PJMsxXdArqsmqDx4x5B6"
73
73
  }
74
74
  authentication {
75
75
  header(HttpHeaderAuthentication)
@@ -114,12 +114,12 @@ dependencies {
114
114
  annotationProcessor "androidx.lifecycle:lifecycle-compiler:2.3.1"
115
115
 
116
116
  //appice
117
- implementation 'appice.io.android:sdk:2.5.62'
117
+ implementation 'appice.io.android:sdk:2.5.66-release'
118
+ //implementation files('libs/libsdk-release.aar')
118
119
 
119
120
  //glide
120
121
  implementation "com.github.bumptech.glide:glide:4.11.0"
121
122
  annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
122
-
123
123
  }
124
124
 
125
125
  def configureReactNativePom(def pom) {
@@ -4,33 +4,27 @@
4
4
  <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
5
5
  <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
6
6
  <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
7
- <uses-permission android:name="android.permission.INTERNET"/>
7
+ <uses-permission android:name="android.permission.INTERNET" />
8
8
  <uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" />
9
- <uses-permission android:name="android.permission.VIBRATE"/>
9
+ <uses-permission android:name="android.permission.VIBRATE" />
10
10
 
11
- <uses-permission android:name="android.permission.WAKE_LOCK"/>
12
- <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
13
- <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE"/>
11
+ <uses-permission android:name="android.permission.WAKE_LOCK" />
12
+ <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
13
+ <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
14
14
 
15
15
  <uses-permission android:name="com.google.android.gms.permission.AD_ID" />
16
16
 
17
-
18
- <permission
19
- android:name="${applicationId}.permission.MIPUSH_RECEIVE"
20
- android:protectionLevel="signature" />
21
-
22
- <uses-permission android:name="${applicationId}.permission.MIPUSH_RECEIVE" />
23
-
24
17
  <application>
25
-
26
- <service android:name="com.reactlibrary.NotificationEventService"
18
+ <service
19
+ android:name="com.reactlibrary.NotificationEventService"
27
20
  android:exported="false">
28
21
  <intent-filter>
29
22
  <action android:name="com.appice.campaignEvent" />
30
23
  </intent-filter>
31
24
  </service>
32
25
 
33
- <receiver android:name="com.reactlibrary.CampaignCampsReceiver"
26
+ <receiver
27
+ android:name="com.reactlibrary.CampaignCampsReceiver"
34
28
  android:exported="false">
35
29
  <intent-filter>
36
30
  <action android:name="com.appice.campaignEvent" />
@@ -41,42 +35,31 @@
41
35
  <service
42
36
  android:name="semusi.activitysdk.Api"
43
37
  android:exported="false"
44
- android:protectionLevel="signature"/>
45
- <activity
46
-
47
- android:name="com.xiaomi.mipush.sdk.NotificationClickedActivity"
48
-
49
- android:theme="@android:style/Theme.Translucent.NoTitleBar"
38
+ android:protectionLevel="signature" />
50
39
 
51
- android:launchMode="singleInstance"
52
-
53
- android:exported="false"
54
-
55
- android:enabled="true">
56
-
57
- </activity>
58
40
  <activity
59
41
  android:name="semusi.context.ui.UIEventsHandler"
60
42
  android:exported="false"
61
43
  android:protectionLevel="signature"
62
- android:theme="@android:style/Theme.Translucent.NoTitleBar"/>
44
+ android:theme="@android:style/Theme.Translucent.NoTitleBar" />
63
45
 
64
- <activity android:name="semusi.context.ui.AppICENotifUI"
46
+ <activity
47
+ android:name="semusi.context.ui.AppICENotifUI"
65
48
  android:exported="false">
66
49
  <intent-filter>
67
- <action android:name="AppICE.Notification.FCM_Action"/>
68
- <category android:name="android.intent.category.DEFAULT"/>
50
+ <action android:name="AppICE.Notification.FCM_Action" />
51
+ <category android:name="android.intent.category.DEFAULT" />
69
52
  </intent-filter>
70
53
 
71
54
  <intent-filter>
72
- <action android:name="android.intent.action.VIEW"/>
55
+ <action android:name="android.intent.action.VIEW" />
73
56
 
74
- <category android:name="android.intent.category.DEFAULT"/>
75
- <category android:name="android.intent.category.BROWSABLE"/>
57
+ <category android:name="android.intent.category.DEFAULT" />
58
+ <category android:name="android.intent.category.BROWSABLE" />
76
59
 
77
60
  <data
78
61
  android:host="ai.io"
79
- android:scheme="https"/>
62
+ android:scheme="https" />
80
63
  </intent-filter>
81
64
  </activity>
82
65
 
@@ -85,7 +68,7 @@
85
68
  android:exported="false"
86
69
  android:protectionLevel="signature">
87
70
  <intent-filter>
88
- <action android:name="com.google.firebase.MESSAGING_EVENT"/>
71
+ <action android:name="com.google.firebase.MESSAGING_EVENT" />
89
72
  </intent-filter>
90
73
  </service>
91
74
 
@@ -94,141 +77,78 @@
94
77
  android:exported="false"
95
78
  android:protectionLevel="signature">
96
79
  <intent-filter android:priority="9999">
97
- <action android:name="android.intent.action.PACKAGE_ADDED"/>
98
- <action android:name="android.intent.action.PACKAGE_REMOVED"/>
99
- <action android:name="android.intent.action.PACKAGE_REPLACED"/>
80
+ <action android:name="android.intent.action.PACKAGE_ADDED" />
81
+ <action android:name="android.intent.action.PACKAGE_REMOVED" />
82
+ <action android:name="android.intent.action.PACKAGE_REPLACED" />
100
83
 
101
- <data android:scheme="package"/>
84
+ <data android:scheme="package" />
102
85
  </intent-filter>
103
86
  </receiver>
104
87
 
105
88
  <receiver
106
89
  android:name="semusi.context.counthandler.DataSyncReceiver"
107
90
  android:exported="false"
108
- android:protectionLevel="signature"/>
91
+ android:protectionLevel="signature" />
109
92
  <receiver
110
93
  android:name="semusi.context.counthandler.TimeTickReceiver"
111
94
  android:exported="false"
112
- android:protectionLevel="signature"/>
95
+ android:protectionLevel="signature" />
113
96
  <receiver
114
97
  android:name="semusi.context.counthandler.NotificationEventReceiver"
115
98
  android:exported="false"
116
- android:protectionLevel="signature"/>
99
+ android:protectionLevel="signature" />
117
100
  <receiver
118
101
  android:name="semusi.context.counthandler.ActionEventReceiver"
119
102
  android:exported="false"
120
- android:protectionLevel="signature"/>
103
+ android:protectionLevel="signature" />
121
104
  <receiver
122
105
  android:name="semusi.analytics.handler.SessionReceiver"
123
106
  android:exported="false"
124
- android:protectionLevel="signature"/>
107
+ android:protectionLevel="signature" />
125
108
 
126
109
  <receiver
127
110
  android:name="semusi.context.counthandler.DeviceBootReceiver"
128
- android:protectionLevel="signature"
129
- android:exported="false">
111
+ android:exported="false"
112
+ android:protectionLevel="signature">
130
113
  <intent-filter>
131
- <action android:name="android.intent.action.BOOT_COMPLETED"/>
132
- <action android:name="android.intent.action.QUICKBOOT_POWERON"/>
133
- <action android:name="com.htc.intent.action.QUICKBOOT_POWERON"/>
114
+ <action android:name="android.intent.action.BOOT_COMPLETED" />
115
+ <action android:name="android.intent.action.QUICKBOOT_POWERON" />
116
+ <action android:name="com.htc.intent.action.QUICKBOOT_POWERON" />
134
117
  </intent-filter>
135
118
  </receiver>
136
119
 
137
120
  <service
138
121
  android:name="semusi.ruleengine.pushmanager.NotificationEventService"
139
- android:permission="android.permission.BIND_JOB_SERVICE">
140
- </service>
122
+ android:permission="android.permission.BIND_JOB_SERVICE"></service>
141
123
  <!-- Semusi setup end -->
142
124
  <!-- Semusi Job Start -->
143
125
 
144
- <receiver android:name="semusi.context.ui.Carousel.CarouselEventReceiver"
126
+ <receiver
127
+ android:name="semusi.context.ui.Carousel.CarouselEventReceiver"
145
128
  android:exported="false">
146
129
  <intent-filter>
147
- <action android:name="io.appice.CAROUSELNOTIFICATIONFIRED"/>
130
+ <action android:name="io.appice.CAROUSELNOTIFICATIONFIRED" />
148
131
  </intent-filter>
149
132
  </receiver>
150
133
 
151
134
 
152
-
153
135
  <!--</receiver>-->
154
- <receiver android:name="semusi.geofencing.AIGeofenceReceiver"
155
- android:exported="false">
156
- </receiver>
157
-
158
- <receiver android:name="semusi.geofencing.LocationUpdateReceiver"
159
- android:exported="false">
160
- </receiver>
161
-
162
- <receiver android:name="semusi.geofencing.AIGeofenceBootReceiver"
163
- android:exported="false">
164
- <intent-filter>
165
- <action android:name="android.location.PROVIDERS_CHANGED"/>
166
- <action android:name="android.intent.action.BOOT_COMPLETED"/>
167
- </intent-filter>
168
- </receiver>
169
- <receiver android:name="semusi.geofencing.GeofenceReceiver"/>
170
-
171
136
  <receiver
172
- android:name="semusi.ruleengine.pushmanager.XiaomiMessageReceiver"
173
- android:exported="false">
174
- <intent-filter>
175
- <action android:name="com.xiaomi.mipush.RECEIVE_MESSAGE" />
176
- </intent-filter>
177
- <intent-filter>
178
- <action android:name="com.xiaomi.mipush.MESSAGE_ARRIVED" />
179
- </intent-filter>
180
- <intent-filter>
181
- <action android:name="com.xiaomi.mipush.ERROR" />
182
- </intent-filter>
183
- </receiver>
184
-
137
+ android:name="semusi.geofencing.AIGeofenceReceiver"
138
+ android:exported="false"></receiver>
185
139
 
186
140
  <receiver
187
- android:name="com.xiaomi.push.service.receivers.NetworkStatusReceiver"
188
- android:exported="false">
189
- <intent-filter>
190
- <action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
191
-
192
- <category android:name="android.intent.category.DEFAULT" />
193
- </intent-filter>
194
- </receiver>
195
-
196
-
197
-
198
- <!-- // xiaomi setting-->
199
- <service
200
- android:name="com.xiaomi.push.service.XMPushService"
201
- android:exported="false"
202
- android:enabled="false"
203
- android:process=":pushservice" />
204
-
205
- <!--Note: This service must be added to the version 3.0.1 or later (including version 3.0.1)-->
206
- <service
207
- android:name="com.xiaomi.push.service.XMJobService"
208
- android:enabled="true"
209
- android:exported="false"
210
- android:permission="android.permission.BIND_JOB_SERVICE"
211
- android:process=":pushservice" />
212
-
213
- <service
214
- android:name="com.xiaomi.mipush.sdk.PushMessageHandler"
215
- android:enabled="true"
216
- android:exported="false" />
217
-
218
- <!--Note: This service must be added to version 2.2.5 or later (including version 2.2.5)-->
219
- <service
220
- android:name="com.xiaomi.mipush.sdk.MessageHandleService"
221
- android:exported="false"
222
- android:enabled="true" />
141
+ android:name="semusi.geofencing.LocationUpdateReceiver"
142
+ android:exported="false"></receiver>
223
143
 
224
144
  <receiver
225
- android:name="com.xiaomi.push.service.receivers.PingReceiver"
226
- android:exported="false"
227
- android:process=":pushservice">
145
+ android:name="semusi.geofencing.AIGeofenceBootReceiver"
146
+ android:exported="false">
228
147
  <intent-filter>
229
- <action android:name="com.xiaomi.push.PING_TIMER" />
148
+ <action android:name="android.location.PROVIDERS_CHANGED" />
149
+ <action android:name="android.intent.action.BOOT_COMPLETED" />
230
150
  </intent-filter>
231
151
  </receiver>
232
-
152
+ <receiver android:name="semusi.geofencing.GeofenceReceiver" />
233
153
  </application>
234
154
  </manifest>
@@ -1,7 +1,5 @@
1
1
  package com.reactlibrary;
2
2
 
3
- import android.util.Log;
4
-
5
3
  import com.facebook.react.bridge.Arguments;
6
4
  import com.facebook.react.bridge.ReadableArray;
7
5
  import com.facebook.react.bridge.ReadableMap;
@@ -10,10 +8,6 @@ import com.facebook.react.bridge.ReadableType;
10
8
  import com.facebook.react.bridge.WritableArray;
11
9
  import com.facebook.react.bridge.WritableMap;
12
10
 
13
- import org.json.JSONArray;
14
- import org.json.JSONException;
15
- import org.json.JSONObject;
16
-
17
11
  import java.util.ArrayList;
18
12
  import java.util.HashMap;
19
13
  import java.util.Iterator;
@@ -24,42 +18,20 @@ import semusi.context.ui.appInbox.AppICEInboxMessage;
24
18
  public class AppICEUtils {
25
19
  private static final String TAG = "AppICEUtils";
26
20
 
27
- @SuppressWarnings({"TypeParameterExplicitlyExtendsObject", "rawtypes"})
28
- public static WritableMap getWritableMapFromMap(Map<String, ? extends Object> var1) {
29
- JSONObject extras = var1 != null ? new JSONObject(var1) : new JSONObject();
30
- WritableMap extrasParams = Arguments.createMap();
31
- Iterator extrasKeys = extras.keys();
32
- while (extrasKeys.hasNext()) {
33
- String key = null;
34
- String value = null;
35
- try {
36
- key = extrasKeys.next().toString();
37
- value = extras.get(key).toString();
38
- } catch (Throwable t) {
39
- Log.e(TAG, t.getLocalizedMessage());
40
- }
41
-
42
- if (key != null && value != null) {
43
- extrasParams.putString(key, value);
44
- }
45
- }
46
- return extrasParams;
47
- }
48
-
49
21
  public static WritableMap convertClassToWritableMap(AppICEInboxMessage inboxMessage){
50
22
  WritableMap inboxObject = Arguments.createMap();
51
23
  try {
52
24
  if (inboxMessage != null) {
53
- inboxObject.putString(Constants.INBOX_MESSAGE_ID, inboxMessage.getMessageId());
54
- inboxObject.putString(Constants.INBOX_CAMPAIGN_ID, inboxMessage.getCampId());
55
- inboxObject.putString(Constants.INBOX_CAMPAIGN_TYPE, inboxMessage.getMessageCampType());
56
- inboxObject.putString(Constants.INBOX_MESSAGE_CATEGORY, inboxMessage.getCategory());
57
- inboxObject.putString(Constants.INBOX_MESSAGE_STATUS, inboxMessage.getMessageStatus());
58
- inboxObject.putString(Constants.INBOX_MESSAGE_LANGUAGE, inboxMessage.getMessageLanguage());
59
- inboxObject.putString(Constants.INBOX_TITLE, inboxMessage.getMessageTitle());
60
- inboxObject.putString(Constants.INBOX_MESSAGE, inboxMessage.getMessageBody());
61
- inboxObject.putString(Constants.INBOX_MESSAGE_ICON, inboxMessage.getMessageIcon());
62
- inboxObject.putMap(Constants.INBOX_CUSTOM_DATA, toWritableMap(inboxMessage.getCustomData()));
25
+ inboxObject.putString(EnumConstants.INBOX_MESSAGE_ID.getValue(), inboxMessage.getMessageId());
26
+ inboxObject.putString(EnumConstants.INBOX_CAMPAIGN_ID.getValue(), inboxMessage.getCampId());
27
+ inboxObject.putString(EnumConstants.INBOX_CAMPAIGN_TYPE.getValue(), inboxMessage.getMessageCampType());
28
+ inboxObject.putString(EnumConstants.INBOX_MESSAGE_CATEGORY.getValue(), inboxMessage.getCategory());
29
+ inboxObject.putString(EnumConstants.INBOX_MESSAGE_STATUS.getValue(), inboxMessage.getMessageStatus());
30
+ inboxObject.putString(EnumConstants.INBOX_MESSAGE_LANGUAGE.getValue(), inboxMessage.getMessageLanguage());
31
+ inboxObject.putString(EnumConstants.INBOX_TITLE.getValue(), inboxMessage.getMessageTitle());
32
+ inboxObject.putString(EnumConstants.INBOX_MESSAGE.getValue(), inboxMessage.getMessageBody());
33
+ inboxObject.putString(EnumConstants.INBOX_MESSAGE_ICON.getValue(), inboxMessage.getMessageIcon());
34
+ inboxObject.putMap(EnumConstants.INBOX_CUSTOM_DATA.getValue(), toWritableMap(inboxMessage.getCustomData()));
63
35
  }
64
36
  }catch (Throwable throwable){}
65
37
  return inboxObject;
@@ -150,62 +122,7 @@ public class AppICEUtils {
150
122
  }
151
123
  return array;
152
124
  }
153
-
154
- public static JSONArray jsonArrayFromReadableArray(ReadableArray readableArray) throws JSONException {
155
- JSONArray array = new JSONArray();
156
- for (int i = 0; i < readableArray.size(); i++) {
157
- switch (readableArray.getType(i)) {
158
- case Null:
159
- break;
160
- case Boolean:
161
- array.put(readableArray.getBoolean(i));
162
- break;
163
- case Number:
164
- array.put(readableArray.getDouble(i));
165
- break;
166
- case String:
167
- array.put(readableArray.getString(i));
168
- break;
169
- case Map:
170
- array.put(jsonObjectFromReadableMap(readableArray.getMap(i)));
171
- break;
172
- case Array:
173
- array.put(jsonArrayFromReadableArray(readableArray.getArray(i)));
174
- break;
175
- }
176
- }
177
- return array;
178
- }
179
-
180
- public static JSONObject jsonObjectFromReadableMap(ReadableMap readableMap) throws JSONException {
181
- JSONObject object = new JSONObject();
182
- ReadableMapKeySetIterator iterator = readableMap.keySetIterator();
183
- while (iterator.hasNextKey()) {
184
- String key = iterator.nextKey();
185
- switch (readableMap.getType(key)) {
186
- case Null:
187
- object.put(key, JSONObject.NULL);
188
- break;
189
- case Boolean:
190
- object.put(key, readableMap.getBoolean(key));
191
- break;
192
- case Number:
193
- object.put(key, readableMap.getDouble(key));
194
- break;
195
- case String:
196
- object.put(key, readableMap.getString(key));
197
- break;
198
- case Map:
199
- object.put(key, jsonObjectFromReadableMap(readableMap.getMap(key)));
200
- break;
201
- case Array:
202
- object.put(key, jsonArrayFromReadableArray(readableMap.getArray(key)));
203
- break;
204
- }
205
- }
206
- return object;
207
- }
208
-
125
+
209
126
  /**
210
127
  * @param propsMap took data from js and iterate it and store in hashmap
211
128
  * @return map of the props data
@@ -232,14 +149,14 @@ public class AppICEUtils {
232
149
  try {
233
150
  props.put(key, propsMap.getInt(key));
234
151
  } catch (Throwable t1) {
235
- Log.d(TAG, "Unhandled ReadableType.Number from ReadableMap");
152
+ AppICEUtils.printLog(TAG, "Unhandled ReadableType.Number from ReadableMap");
236
153
  }
237
154
  }
238
155
  } else {
239
- Log.d(TAG, "Unhandled event property ReadableType");
156
+ AppICEUtils.printLog(TAG, "Unhandled event property ReadableType");
240
157
  }
241
158
  } catch (Throwable t) {
242
- Log.d(TAG, t.getLocalizedMessage());
159
+ AppICEUtils.printLog(TAG, t.getLocalizedMessage());
243
160
  }
244
161
  }
245
162
  return props;
@@ -248,4 +165,4 @@ public class AppICEUtils {
248
165
  public static void printLog(String TAG, String message){
249
166
  System.out.println(TAG+", "+message);
250
167
  }
251
- }
168
+ }