cordova-plugin-appice 2.0.8 → 2.0.10

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.
Files changed (31) hide show
  1. package/README.md +120 -122
  2. package/package.json +45 -27
  3. package/plugin.xml +168 -103
  4. package/scripts/BeforeAndroidBuilt.js +160 -126
  5. package/scripts/BeforeIosBuilt.js +38 -38
  6. package/scripts/androidAfterPluginAdd.js +159 -159
  7. package/scripts/androidAfterPluginRm.js +195 -195
  8. package/scripts/iOSAfterPluginAdd.js +98 -98
  9. package/scripts/iOSAfterPluginRm.js +73 -74
  10. package/src/android/AppICEMFPPush.java +177 -0
  11. package/{libcordova/src/main/java/com/appice/cordova → src/android}/AppICEPlugin.java +405 -489
  12. package/{libcordova/src/main/java/com/appice/cordova → src/android}/CampaignCampsReceiver.java +8 -9
  13. package/{libcordova/src/main/java/com/appice/cordova → src/android}/NotificationEventService.java +16 -7
  14. package/src/build.gradle +16 -14
  15. package/src/firebase/modified/android/FirebasePluginMessagingService.java +356 -356
  16. package/src/firebase/modified/ios/AppDelegate+FirebasePlugin.m +529 -529
  17. package/src/firebase/original/android/FirebasePluginMessagingService.java +348 -348
  18. package/src/firebase/original/ios/AppDelegate+FirebasePlugin.m +519 -519
  19. package/src/ios/AppDelegate+AppICEPlugin.h +8 -8
  20. package/src/ios/AppDelegate+AppICEPlugin.m +278 -191
  21. package/src/ios/AppICEPlugin.h +93 -90
  22. package/src/ios/AppICEPlugin.m +1161 -1062
  23. package/www/AppICE.js +289 -284
  24. package/libcordova/android-release-aar.gradle +0 -63
  25. package/libcordova/build.gradle +0 -50
  26. package/libcordova/cordova.jar +0 -0
  27. package/libcordova/proguard-rules.pro +0 -21
  28. package/libcordova/src/main/AndroidManifest.xml +0 -24
  29. package/libcordova/src/main/res/values/strings.xml +0 -3
  30. package/src/firebase/modified/modified.iml +0 -11
  31. package/src/firebase/original/original.iml +0 -11
@@ -5,28 +5,23 @@ import android.content.Context;
5
5
  import android.content.Intent;
6
6
  import android.net.Uri;
7
7
  import android.os.Bundle;
8
-
9
- import org.json.JSONException;
8
+ import android.util.Log;
10
9
  import org.json.JSONObject;
11
-
12
10
  import java.net.URLDecoder;
13
11
  import java.util.HashMap;
14
12
  import java.util.Iterator;
15
13
  import java.util.Set;
16
-
17
14
  import semusi.activitysdk.ContextSdk;
18
15
 
19
- /**
20
- * Created by aman on 14/03/16.
21
- */
22
-
23
16
  public class CampaignCampsReceiver extends BroadcastReceiver {
17
+ private static final String TAG = CampaignCampsReceiver.class.getSimpleName();
24
18
 
25
19
  @Override
26
20
  public void onReceive(Context context, Intent intent) {
27
21
  try {
28
22
  sendCallback(intent.getExtras(), context);
29
23
  } catch (Throwable e) {
24
+ Log.e(TAG, "onReceive: error ", e);
30
25
  }
31
26
  }
32
27
 
@@ -50,10 +45,12 @@ public class CampaignCampsReceiver extends BroadcastReceiver {
50
45
  try {
51
46
  json.put(key, deeplinkData.get(key));
52
47
  } catch (Throwable e) {
48
+ Log.e(TAG, "sendCallback: error ",e );
53
49
  }
54
50
  }
55
51
  }
56
52
  } catch (Throwable e) {
53
+ Log.e(TAG, "sendCallback: error ",e );
57
54
  }
58
55
 
59
56
  // Gather extra data from json object root
@@ -69,11 +66,11 @@ public class CampaignCampsReceiver extends BroadcastReceiver {
69
66
  json.put(key, URLDecoder.decode((String) obj, "UTF-8"));
70
67
  else
71
68
  json.put(key, obj);
72
-
73
69
  }
74
70
  }
75
71
  }
76
72
  } catch (Throwable e) {
73
+ Log.e(TAG, "sendCallback: error ",e );
77
74
  }
78
75
 
79
76
  json.put("tap", tap);
@@ -86,10 +83,12 @@ public class CampaignCampsReceiver extends BroadcastReceiver {
86
83
  json.put("path", path.getPath());
87
84
  }
88
85
  } catch (Throwable e) {
86
+ Log.e(TAG, "sendCallback: error ",e );
89
87
  }
90
88
 
91
89
  AppICEPlugin.sendNotification(json, context);
92
90
  } catch (Throwable e) {
91
+ Log.e(TAG, "sendCallback: error ",e );
93
92
  }
94
93
  }
95
94
  }
@@ -5,16 +5,27 @@ import android.app.job.JobService;
5
5
  import android.os.Build;
6
6
  import android.os.Bundle;
7
7
  import android.os.PersistableBundle;
8
-
8
+ import android.util.Log;
9
+ import androidx.work.Configuration;
9
10
  import java.util.Timer;
10
11
  import java.util.TimerTask;
12
+ import java.util.concurrent.atomic.AtomicReference;
11
13
 
12
14
  public class NotificationEventService extends JobService {
15
+ private static final String TAG = NotificationEventService.class.getSimpleName();
16
+
17
+ public NotificationEventService() {
18
+ AtomicReference<Configuration.Builder> notificationBuilder = new AtomicReference<>(new Configuration.Builder());
19
+ notificationBuilder.get().setJobSchedulerJobIdRange(0, 1000);
20
+ }
13
21
 
14
22
  @Override
15
23
  public boolean onStartJob(JobParameters params) {
16
24
  if (params != null) {
17
- PersistableBundle bundle = params.getExtras();
25
+ PersistableBundle bundle = null;
26
+ if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
27
+ bundle = params.getExtras();
28
+ }
18
29
  if (bundle != null) {
19
30
  final Bundle bundle1 = toBundle(bundle);
20
31
  if (bundle1 != null) {
@@ -24,11 +35,10 @@ public class NotificationEventService extends JobService {
24
35
  CampaignCampsReceiver rc = new CampaignCampsReceiver();
25
36
  rc.sendCallback(bundle1, getApplicationContext());
26
37
  }
27
- }, 2 * 1000);
38
+ }, 1000);
28
39
  }
29
40
  }
30
41
  }
31
-
32
42
  return true;
33
43
  }
34
44
 
@@ -42,8 +52,8 @@ public class NotificationEventService extends JobService {
42
52
  bundle.putAll(persistableBundle);
43
53
  return bundle;
44
54
  } catch (Throwable e) {
55
+ Log.e(TAG, "toBundle: error ", e);
45
56
  }
46
-
47
57
  return null;
48
58
  }
49
59
 
@@ -51,5 +61,4 @@ public class NotificationEventService extends JobService {
51
61
  public boolean onStopJob(JobParameters params) {
52
62
  return false;
53
63
  }
54
- }
55
-
64
+ }
package/src/build.gradle CHANGED
@@ -1,15 +1,17 @@
1
- allprojects {
2
- apply from: 'repositories.gradle'
3
- repositories {
4
- maven {
5
- url "https://gitlab.com/api/v4/projects/10636887/packages/maven"
6
- credentials(HttpHeaderCredentials) {
7
- name = "Deploy-Token"
8
- value = ""
9
- }
10
- authentication {
11
- header(HttpHeaderAuthentication)
12
- }
13
- }
14
- }
1
+ allprojects {
2
+ apply from: 'repositories.gradle'
3
+ repositories {
4
+ maven { url "https://jitpack.io" }
5
+ maven {
6
+ url "https://gitlab.com/api/v4/projects/10636887/packages/maven"
7
+ credentials(HttpHeaderCredentials) {
8
+ name = "Deploy-Token"
9
+ value = "PJMsxXdArqsmqDx4x5B6"
10
+ }
11
+ authentication {
12
+ header(HttpHeaderAuthentication)
13
+ }
14
+ }
15
+
16
+ }
15
17
  }