reactnative-plugin-appice 1.6.0 → 1.6.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.
Files changed (124) hide show
  1. package/README.md +37 -37
  2. package/android/README.md +14 -14
  3. package/android/android.iml +150 -150
  4. package/android/build.gradle +152 -152
  5. package/android/gitignore +47 -47
  6. package/android/src/main/AndroidManifest.xml +234 -234
  7. package/android/src/main/java/com/reactlibrary/AppICEUtils.java +38 -38
  8. package/android/src/main/java/com/reactlibrary/AppIceReactPluginModule.java +503 -473
  9. package/android/src/main/java/com/reactlibrary/AppIceReactPluginPackage.java +28 -28
  10. package/android/src/main/java/com/reactlibrary/CampaignCampsReceiver.java +73 -73
  11. package/android/src/main/java/com/reactlibrary/InAppWebView.java +67 -67
  12. package/android/src/main/java/com/reactlibrary/NotificationEventService.java +62 -62
  13. package/example/App.js +148 -148
  14. package/example/Gemfile +6 -6
  15. package/example/__tests__/App-test.js +14 -14
  16. package/example/android/app/_BUCK +55 -55
  17. package/example/android/app/build.gradle +320 -320
  18. package/example/android/app/build_defs.bzl +19 -19
  19. package/example/android/app/proguard-rules.pro +10 -10
  20. package/example/android/app/src/debug/AndroidManifest.xml +13 -13
  21. package/example/android/app/src/debug/java/com/example/ReactNativeFlipper.java +73 -73
  22. package/example/android/app/src/main/AndroidManifest.xml +72 -72
  23. package/example/android/app/src/main/java/com/example/MainActivity.java +48 -48
  24. package/example/android/app/src/main/java/com/example/MainApplication.java +91 -91
  25. package/example/android/app/src/main/java/com/example/newarchitecture/MainApplicationReactNativeHost.java +116 -116
  26. package/example/android/app/src/main/java/com/example/newarchitecture/components/MainComponentsRegistry.java +36 -36
  27. package/example/android/app/src/main/java/com/example/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java +48 -48
  28. package/example/android/app/src/main/jni/Android.mk +48 -48
  29. package/example/android/app/src/main/jni/MainApplicationModuleProvider.cpp +24 -24
  30. package/example/android/app/src/main/jni/MainApplicationModuleProvider.h +16 -16
  31. package/example/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp +45 -45
  32. package/example/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h +38 -38
  33. package/example/android/app/src/main/jni/MainComponentsRegistry.cpp +61 -61
  34. package/example/android/app/src/main/jni/MainComponentsRegistry.h +32 -32
  35. package/example/android/app/src/main/jni/OnLoad.cpp +11 -11
  36. package/example/android/app/src/main/res/drawable/rn_edit_text_material.xml +36 -36
  37. package/example/android/app/src/main/res/values/strings.xml +3 -3
  38. package/example/android/app/src/main/res/values/styles.xml +9 -9
  39. package/example/android/build.gradle +53 -53
  40. package/example/android/gradle/wrapper/gradle-wrapper.properties +5 -5
  41. package/example/android/gradle.properties +40 -40
  42. package/example/android/gradlew +234 -234
  43. package/example/android/settings.gradle +11 -11
  44. package/example/app.json +3 -3
  45. package/example/babel.config.js +3 -3
  46. package/example/index.js +9 -9
  47. package/example/ios/Podfile +44 -44
  48. package/example/ios/Podfile.lock +561 -561
  49. package/example/ios/_xcode.env +11 -11
  50. package/example/ios/example/AppDelegate.h +8 -8
  51. package/example/ios/example/AppDelegate.mm +174 -174
  52. package/example/ios/example/Images.xcassets/AppIcon.appiconset/Contents.json +53 -53
  53. package/example/ios/example/Images.xcassets/Contents.json +6 -6
  54. package/example/ios/example/Info.plist +62 -62
  55. package/example/ios/example/LaunchScreen.storyboard +47 -47
  56. package/example/ios/example/example.entitlements +8 -8
  57. package/example/ios/example/main.m +10 -10
  58. package/example/ios/example.xcodeproj/project.pbxproj +712 -712
  59. package/example/ios/example.xcodeproj/xcshareddata/xcschemes/example.xcscheme +88 -88
  60. package/example/ios/example.xcworkspace/contents.xcworkspacedata +10 -10
  61. package/example/ios/example.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -8
  62. package/example/ios/exampleTests/Info.plist +24 -24
  63. package/example/ios/exampleTests/exampleTests.m +66 -66
  64. package/example/metro.config.js +17 -17
  65. package/example/package.json +34 -34
  66. package/index.js +181 -124
  67. package/ios/AppICEReactEvent.h +23 -23
  68. package/ios/AppICEReactEvent.m +86 -77
  69. package/ios/AppIceReactPlugin.h +22 -22
  70. package/ios/AppIceReactPlugin.m +214 -191
  71. package/ios/AppIceReactPlugin.xcodeproj/project.pbxproj +364 -434
  72. package/ios/AppIceReactPlugin.xcodeproj/project.xcworkspace/contents.xcworkspacedata +4 -4
  73. package/ios/AppIceReactPlugin.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -8
  74. package/ios/AppIceReactPlugin.xcodeproj/xcuserdata/Adi.xcuserdatad/xcschemes/xcschememanagement.plist +14 -14
  75. package/ios/AppIceReactPlugin.xcodeproj/xcuserdata/user214879.xcuserdatad/xcschemes/xcschememanagement.plist +14 -0
  76. package/ios/AppIceReactPlugin.xcworkspace/contents.xcworkspacedata +10 -10
  77. package/ios/AppIceReactPlugin.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -8
  78. package/ios/AppIceReactPlugin.xcworkspace/xcuserdata/user214879.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  79. package/ios/Podfile +10 -10
  80. package/ios/Podfile.lock +3 -3
  81. package/ios/Pods/Manifest.lock +3 -3
  82. package/ios/Pods/Pods.xcodeproj/project.pbxproj +395 -395
  83. package/ios/Pods/Pods.xcodeproj/xcuserdata/Adi.xcuserdatad/xcschemes/Pods-AppIceReactPlugin.xcscheme +58 -58
  84. package/ios/Pods/Pods.xcodeproj/xcuserdata/Adi.xcuserdatad/xcschemes/xcschememanagement.plist +18 -18
  85. package/ios/Pods/Pods.xcodeproj/xcuserdata/user214879.xcuserdatad/xcschemes/xcschememanagement.plist +14 -0
  86. package/ios/Pods/Target Support Files/Pods-AppIceReactPlugin/Pods-AppIceReactPlugin-Info.plist +26 -26
  87. package/ios/Pods/Target Support Files/Pods-AppIceReactPlugin/Pods-AppIceReactPlugin-acknowledgements.markdown +3 -3
  88. package/ios/Pods/Target Support Files/Pods-AppIceReactPlugin/Pods-AppIceReactPlugin-acknowledgements.plist +29 -29
  89. package/ios/Pods/Target Support Files/Pods-AppIceReactPlugin/Pods-AppIceReactPlugin-dummy.m +5 -5
  90. package/ios/Pods/Target Support Files/Pods-AppIceReactPlugin/Pods-AppIceReactPlugin-umbrella.h +16 -16
  91. package/ios/Pods/Target Support Files/Pods-AppIceReactPlugin/Pods-AppIceReactPlugin.debug.xcconfig +6 -6
  92. package/ios/Pods/Target Support Files/Pods-AppIceReactPlugin/Pods-AppIceReactPlugin.modulemap +6 -6
  93. package/ios/Pods/Target Support Files/Pods-AppIceReactPlugin/Pods-AppIceReactPlugin.release.xcconfig +6 -6
  94. package/package.json +40 -40
  95. package/reactnative-plugin-appice.podspec +30 -30
  96. package/ios/AppICESDK/appICE.momd/VersionInfo.plist +0 -0
  97. package/ios/AppICESDK/appICE.momd/appICE 2.mom +0 -0
  98. package/ios/AppICESDK/appICE.momd/appICE 3.mom +0 -0
  99. package/ios/AppICESDK/appICE.momd/appICE 4.mom +0 -0
  100. package/ios/AppICESDK/appICE.momd/appICE 4.omo +0 -0
  101. package/ios/AppICESDK/appICE.momd/appICE.mom +0 -0
  102. package/ios/AppICESDK/appICE.momd/appICE2.mom +0 -0
  103. package/ios/AppICESDK/appICEBundle.bundle/APPChildViewController.nib +0 -0
  104. package/ios/AppICESDK/appICEBundle.bundle/AppICE_btn.png +0 -0
  105. package/ios/AppICESDK/appICEBundle.bundle/Black button.png +0 -0
  106. package/ios/AppICESDK/appICEBundle.bundle/HAlfFooterNOTINAppViewController.nib +0 -0
  107. package/ios/AppICESDK/appICEBundle.bundle/HAlfHeaderINAppViewController.nib +0 -0
  108. package/ios/AppICESDK/appICEBundle.bundle/HAlfINAppViewController.nib +0 -0
  109. package/ios/AppICESDK/appICEBundle.bundle/INAppViewController.nib/objects-11.0+.nib +0 -0
  110. package/ios/AppICESDK/appICEBundle.bundle/INAppViewController.nib/runtime.nib +0 -0
  111. package/ios/AppICESDK/appICEBundle.bundle/Info.plist +0 -0
  112. package/ios/AppICESDK/appICEBundle.bundle/RatingViewController.nib +0 -0
  113. package/ios/AppICESDK/appICEBundle.bundle/SurveyViewController.nib +0 -0
  114. package/ios/AppICESDK/appICEBundle.bundle/checked.png +0 -0
  115. package/ios/AppICESDK/appICEBundle.bundle/close-button.png +0 -0
  116. package/ios/AppICESDK/appICEBundle.bundle/sound2.caf +0 -0
  117. package/ios/AppICESDK/appICEBundle.bundle/unchecked.png +0 -0
  118. package/ios/AppICESDK/include/iosAppiceSDK/AppICEInboxMessage.h +0 -43
  119. package/ios/AppICESDK/include/iosAppiceSDK/AppICEJSInterface.h +0 -21
  120. package/ios/AppICESDK/include/iosAppiceSDK/appICE.h +0 -190
  121. package/ios/AppICESDK/include/iosAppiceSDK/appICEUserDetails.h +0 -87
  122. package/ios/AppICESDK/include/iosAppiceSDK/isrgrootx1.der +0 -0
  123. package/ios/AppICESDK/include/iosAppiceSDK/lets-encrypt-r3.der +0 -0
  124. package/ios/AppICESDK/libiosAppiceSDK_v1.7.56.a +0 -0
@@ -1,28 +1,28 @@
1
- package com.reactlibrary;
2
-
3
- import java.util.Arrays;
4
- import java.util.Collections;
5
- import java.util.List;
6
-
7
- import com.facebook.react.ReactPackage;
8
- import com.facebook.react.bridge.NativeModule;
9
- import com.facebook.react.bridge.ReactApplicationContext;
10
- import com.facebook.react.uimanager.ViewManager;
11
- import com.facebook.react.bridge.JavaScriptModule;
12
-
13
- public class AppIceReactPluginPackage implements ReactPackage {
14
- @Override
15
- public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
16
- return Arrays.<NativeModule>asList(new AppIceReactPluginModule(reactContext));
17
- }
18
-
19
- // Deprecated from RN 0.47
20
- public List<Class<? extends JavaScriptModule>> createJSModules() {
21
- return Collections.emptyList();
22
- }
23
-
24
- @Override
25
- public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
26
- return Collections.emptyList();
27
- }
28
- }
1
+ package com.reactlibrary;
2
+
3
+ import java.util.Arrays;
4
+ import java.util.Collections;
5
+ import java.util.List;
6
+
7
+ import com.facebook.react.ReactPackage;
8
+ import com.facebook.react.bridge.NativeModule;
9
+ import com.facebook.react.bridge.ReactApplicationContext;
10
+ import com.facebook.react.uimanager.ViewManager;
11
+ import com.facebook.react.bridge.JavaScriptModule;
12
+
13
+ public class AppIceReactPluginPackage implements ReactPackage {
14
+ @Override
15
+ public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
16
+ return Arrays.<NativeModule>asList(new AppIceReactPluginModule(reactContext));
17
+ }
18
+
19
+ // Deprecated from RN 0.47
20
+ public List<Class<? extends JavaScriptModule>> createJSModules() {
21
+ return Collections.emptyList();
22
+ }
23
+
24
+ @Override
25
+ public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
26
+ return Collections.emptyList();
27
+ }
28
+ }
@@ -1,73 +1,73 @@
1
- package com.reactlibrary;
2
-
3
- import android.content.BroadcastReceiver;
4
- import android.content.Context;
5
- import android.content.Intent;
6
- import android.net.Uri;
7
- import android.os.Bundle;
8
- import android.util.Log;
9
-
10
- import com.facebook.react.bridge.Arguments;
11
- import com.facebook.react.bridge.WritableMap;
12
-
13
- import org.json.JSONException;
14
- import org.json.JSONObject;
15
-
16
- import java.net.URLDecoder;
17
- import java.util.HashMap;
18
- import java.util.Iterator;
19
- import java.util.Map;
20
- import java.util.Set;
21
-
22
- import semusi.activitysdk.ContextSdk;
23
-
24
-
25
- public class CampaignCampsReceiver extends BroadcastReceiver {
26
- private static final String TAG = "CampaignCampsReceiver";
27
-
28
- public static ClickCallback clickCallback;
29
-
30
- public CampaignCampsReceiver(ClickCallback clickCallback){
31
- this.clickCallback = clickCallback;
32
- }
33
- public CampaignCampsReceiver(){
34
- }
35
-
36
- @Override
37
- public void onReceive(Context context, Intent intent) {
38
- try {
39
- sendCallback(intent.getExtras(), context);
40
- } catch (Exception e) {
41
- }
42
- }
43
-
44
- public void sendCallback(Bundle extra, Context context) {
45
- try {
46
-
47
- String cdata = extra.getString("cdata");
48
- String ai_content = extra.getString("ai_content");
49
- boolean category = extra.getBoolean("ai_inapp");
50
-
51
- if (category) {
52
- if (cdata != null && cdata.length() > 0) {
53
- WritableMap params = Arguments.createMap();
54
- params.putString(AppIceReactPluginModule.APPICE_INAPP_NOTIFICATION_CLICKED, cdata);
55
- AppIceReactPluginModule.sendEvent(AppIceReactPluginModule.APPICE_INAPP_NOTIFICATION_CLICKED, params);
56
- }
57
- }
58
-
59
- if (ai_content != null && ai_content.length()>0){
60
- JSONObject pushContent = new JSONObject(ai_content);
61
- if (pushContent != null){
62
- WritableMap params = Arguments.createMap();
63
- if (pushContent != null){
64
- params.putString(AppIceReactPluginModule.APPICE_PUSH_NOTIFICATION_CLICKED, pushContent.toString());
65
- AppIceReactPluginModule.sendEvent(AppIceReactPluginModule.APPICE_PUSH_NOTIFICATION_CLICKED, params);
66
- }
67
- }
68
- }
69
- } catch (Exception e) {
70
- e.printStackTrace();
71
- }
72
- }
73
- }
1
+ package com.reactlibrary;
2
+
3
+ import android.content.BroadcastReceiver;
4
+ import android.content.Context;
5
+ import android.content.Intent;
6
+ import android.net.Uri;
7
+ import android.os.Bundle;
8
+ import android.util.Log;
9
+
10
+ import com.facebook.react.bridge.Arguments;
11
+ import com.facebook.react.bridge.WritableMap;
12
+
13
+ import org.json.JSONException;
14
+ import org.json.JSONObject;
15
+
16
+ import java.net.URLDecoder;
17
+ import java.util.HashMap;
18
+ import java.util.Iterator;
19
+ import java.util.Map;
20
+ import java.util.Set;
21
+
22
+ import semusi.activitysdk.ContextSdk;
23
+
24
+
25
+ public class CampaignCampsReceiver extends BroadcastReceiver {
26
+ private static final String TAG = "CampaignCampsReceiver";
27
+
28
+ public static ClickCallback clickCallback;
29
+
30
+ public CampaignCampsReceiver(ClickCallback clickCallback){
31
+ this.clickCallback = clickCallback;
32
+ }
33
+ public CampaignCampsReceiver(){
34
+ }
35
+
36
+ @Override
37
+ public void onReceive(Context context, Intent intent) {
38
+ try {
39
+ sendCallback(intent.getExtras(), context);
40
+ } catch (Exception e) {
41
+ }
42
+ }
43
+
44
+ public void sendCallback(Bundle extra, Context context) {
45
+ try {
46
+
47
+ String cdata = extra.getString("cdata");
48
+ String ai_content = extra.getString("ai_content");
49
+ boolean category = extra.getBoolean("ai_inapp");
50
+
51
+ if (category) {
52
+ if (cdata != null && cdata.length() > 0) {
53
+ WritableMap params = Arguments.createMap();
54
+ params.putString(AppIceReactPluginModule.APPICE_INAPP_NOTIFICATION_CLICKED, cdata);
55
+ AppIceReactPluginModule.sendEvent(AppIceReactPluginModule.APPICE_INAPP_NOTIFICATION_CLICKED, params);
56
+ }
57
+ }
58
+
59
+ if (ai_content != null && ai_content.length()>0){
60
+ JSONObject pushContent = new JSONObject(ai_content);
61
+ if (pushContent != null){
62
+ WritableMap params = Arguments.createMap();
63
+ if (pushContent != null){
64
+ params.putString(AppIceReactPluginModule.APPICE_PUSH_NOTIFICATION_CLICKED, pushContent.toString());
65
+ AppIceReactPluginModule.sendEvent(AppIceReactPluginModule.APPICE_PUSH_NOTIFICATION_CLICKED, params);
66
+ }
67
+ }
68
+ }
69
+ } catch (Exception e) {
70
+ e.printStackTrace();
71
+ }
72
+ }
73
+ }
@@ -1,68 +1,68 @@
1
- package com.reactlibrary;
2
- import android.annotation.SuppressLint;
3
- import android.content.Context;
4
- import android.graphics.Point;
5
- import android.util.DisplayMetrics;
6
- import android.util.TypedValue;
7
- import android.view.View;
8
- import android.webkit.WebView;
9
-
10
- @SuppressLint("ViewConstructor")
11
- class InAppWebView extends WebView {
12
-
13
- final Point dim = new Point();
14
-
15
- private int height;
16
-
17
- private int heightPercentage;
18
-
19
- private int width;
20
-
21
- private int widthPercentage;
22
-
23
- @SuppressLint("ResourceType")
24
- public InAppWebView(Context context, int width, int height, int widthPercentage, int heightPercentage) {
25
- super(context);
26
- this.width = width;
27
- this.height = height;
28
- this.widthPercentage = widthPercentage;
29
- this.heightPercentage = heightPercentage;
30
- setHorizontalScrollBarEnabled(false);
31
- setVerticalScrollBarEnabled(false);
32
- setHorizontalFadingEdgeEnabled(false);
33
- setVerticalFadingEdgeEnabled(false);
34
- setOverScrollMode(View.OVER_SCROLL_NEVER);
35
- setBackgroundColor(0x00000000);
36
- //noinspection ResourceType
37
- setId(188293);
38
- }
39
-
40
- @Override
41
- public boolean performClick() {
42
- return super.performClick();
43
- }
44
-
45
- @Override
46
- protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
47
- super.onMeasure(widthMeasureSpec, heightMeasureSpec);
48
- updateDimension();
49
- setMeasuredDimension(dim.x, dim.y);
50
- }
51
-
52
- void updateDimension() {
53
- if (width != 0) {
54
- dim.x = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
55
- width, getResources().getDisplayMetrics());
56
- } else {
57
- DisplayMetrics metrics = getResources().getDisplayMetrics();
58
- dim.x = (int) (metrics.widthPixels * widthPercentage / 100f);
59
- }
60
- if (height != 0) {
61
- dim.y = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
62
- height, getResources().getDisplayMetrics());
63
- } else {
64
- DisplayMetrics metrics = getResources().getDisplayMetrics();
65
- dim.y = (int) (metrics.heightPixels * heightPercentage / 100f);
66
- }
67
- }
1
+ package com.reactlibrary;
2
+ import android.annotation.SuppressLint;
3
+ import android.content.Context;
4
+ import android.graphics.Point;
5
+ import android.util.DisplayMetrics;
6
+ import android.util.TypedValue;
7
+ import android.view.View;
8
+ import android.webkit.WebView;
9
+
10
+ @SuppressLint("ViewConstructor")
11
+ class InAppWebView extends WebView {
12
+
13
+ final Point dim = new Point();
14
+
15
+ private int height;
16
+
17
+ private int heightPercentage;
18
+
19
+ private int width;
20
+
21
+ private int widthPercentage;
22
+
23
+ @SuppressLint("ResourceType")
24
+ public InAppWebView(Context context, int width, int height, int widthPercentage, int heightPercentage) {
25
+ super(context);
26
+ this.width = width;
27
+ this.height = height;
28
+ this.widthPercentage = widthPercentage;
29
+ this.heightPercentage = heightPercentage;
30
+ setHorizontalScrollBarEnabled(false);
31
+ setVerticalScrollBarEnabled(false);
32
+ setHorizontalFadingEdgeEnabled(false);
33
+ setVerticalFadingEdgeEnabled(false);
34
+ setOverScrollMode(View.OVER_SCROLL_NEVER);
35
+ setBackgroundColor(0x00000000);
36
+ //noinspection ResourceType
37
+ setId(188293);
38
+ }
39
+
40
+ @Override
41
+ public boolean performClick() {
42
+ return super.performClick();
43
+ }
44
+
45
+ @Override
46
+ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
47
+ super.onMeasure(widthMeasureSpec, heightMeasureSpec);
48
+ updateDimension();
49
+ setMeasuredDimension(dim.x, dim.y);
50
+ }
51
+
52
+ void updateDimension() {
53
+ if (width != 0) {
54
+ dim.x = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
55
+ width, getResources().getDisplayMetrics());
56
+ } else {
57
+ DisplayMetrics metrics = getResources().getDisplayMetrics();
58
+ dim.x = (int) (metrics.widthPixels * widthPercentage / 100f);
59
+ }
60
+ if (height != 0) {
61
+ dim.y = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
62
+ height, getResources().getDisplayMetrics());
63
+ } else {
64
+ DisplayMetrics metrics = getResources().getDisplayMetrics();
65
+ dim.y = (int) (metrics.heightPixels * heightPercentage / 100f);
66
+ }
67
+ }
68
68
  }
@@ -1,62 +1,62 @@
1
- package com.reactlibrary;
2
-
3
- import android.annotation.TargetApi;
4
- import android.app.job.JobParameters;
5
- import android.app.job.JobService;
6
- import android.os.Build;
7
- import android.os.Bundle;
8
- import android.os.PersistableBundle;
9
- import androidx.annotation.RequiresApi;
10
- import androidx.work.Configuration;
11
-
12
- import java.util.Timer;
13
- import java.util.TimerTask;
14
- import java.util.concurrent.atomic.AtomicReference;
15
-
16
- @TargetApi(Build.VERSION_CODES.LOLLIPOP)
17
- public class NotificationEventService extends JobService {
18
-
19
- @Override
20
- public boolean onStartJob(final JobParameters params) {
21
- if (params != null) {
22
- PersistableBundle bundle = params.getExtras();
23
- if (bundle != null) {
24
- final Bundle bundle1 = toBundle(bundle);
25
- if (bundle1 != null) {
26
- new Timer("AppICE-NotifService-Timer").schedule(new TimerTask() {
27
- @Override
28
- public void run() {
29
- CampaignCampsReceiver rc = new CampaignCampsReceiver();
30
- System.out.println("NotificationEventService : data "+bundle1);
31
- rc.sendCallback(bundle1, getApplicationContext());
32
- jobFinished(params,false);
33
- }
34
- }, 1 * 1000);
35
- }
36
- }
37
- }
38
-
39
- return true;
40
- }
41
-
42
- public static Bundle toBundle(PersistableBundle persistableBundle) {
43
- try {
44
- if (persistableBundle == null) {
45
- return null;
46
- }
47
- Bundle bundle = new Bundle();
48
- if (Build.VERSION.SDK_INT >= 21)
49
- bundle.putAll(persistableBundle);
50
- return bundle;
51
- } catch (Exception e) {
52
- }
53
-
54
- return null;
55
- }
56
-
57
- @Override
58
- public boolean onStopJob(JobParameters params) {
59
- return false;
60
- }
61
- }
62
-
1
+ package com.reactlibrary;
2
+
3
+ import android.annotation.TargetApi;
4
+ import android.app.job.JobParameters;
5
+ import android.app.job.JobService;
6
+ import android.os.Build;
7
+ import android.os.Bundle;
8
+ import android.os.PersistableBundle;
9
+ import androidx.annotation.RequiresApi;
10
+ import androidx.work.Configuration;
11
+
12
+ import java.util.Timer;
13
+ import java.util.TimerTask;
14
+ import java.util.concurrent.atomic.AtomicReference;
15
+
16
+ @TargetApi(Build.VERSION_CODES.LOLLIPOP)
17
+ public class NotificationEventService extends JobService {
18
+
19
+ @Override
20
+ public boolean onStartJob(final JobParameters params) {
21
+ if (params != null) {
22
+ PersistableBundle bundle = params.getExtras();
23
+ if (bundle != null) {
24
+ final Bundle bundle1 = toBundle(bundle);
25
+ if (bundle1 != null) {
26
+ new Timer("AppICE-NotifService-Timer").schedule(new TimerTask() {
27
+ @Override
28
+ public void run() {
29
+ CampaignCampsReceiver rc = new CampaignCampsReceiver();
30
+ System.out.println("NotificationEventService : data "+bundle1);
31
+ rc.sendCallback(bundle1, getApplicationContext());
32
+ jobFinished(params,false);
33
+ }
34
+ }, 1 * 1000);
35
+ }
36
+ }
37
+ }
38
+
39
+ return true;
40
+ }
41
+
42
+ public static Bundle toBundle(PersistableBundle persistableBundle) {
43
+ try {
44
+ if (persistableBundle == null) {
45
+ return null;
46
+ }
47
+ Bundle bundle = new Bundle();
48
+ if (Build.VERSION.SDK_INT >= 21)
49
+ bundle.putAll(persistableBundle);
50
+ return bundle;
51
+ } catch (Exception e) {
52
+ }
53
+
54
+ return null;
55
+ }
56
+
57
+ @Override
58
+ public boolean onStopJob(JobParameters params) {
59
+ return false;
60
+ }
61
+ }
62
+