@customerglu/react-native-customerglu 2.1.2-1.0-beta → 3.0.0-beta-1.1

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 (85) hide show
  1. package/LICENSE +20 -15
  2. package/README.md +2 -2
  3. package/ReactNativeCustomerglu.podspec +47 -0
  4. package/android/build.gradle +78 -33
  5. package/android/generated/java/com/customerglu/reactnativecustomerglu/NativeReactNativeCustomergluSpec.java +144 -0
  6. package/android/generated/jni/CMakeLists.txt +36 -0
  7. package/android/generated/jni/RNCustomergluSpec-generated.cpp +188 -0
  8. package/android/generated/jni/RNCustomergluSpec.h +31 -0
  9. package/android/generated/jni/react/renderer/components/RNCustomergluSpec/RNCustomergluSpecJSI-generated.cpp +237 -0
  10. package/android/generated/jni/react/renderer/components/RNCustomergluSpec/RNCustomergluSpecJSI.h +305 -0
  11. package/android/gradle.properties +5 -0
  12. package/android/src/main/AndroidManifest.xml +1 -6
  13. package/android/src/main/AndroidManifestNew.xml +2 -0
  14. package/android/src/main/java/com/customerglu/reactnativecustomerglu/BannerView.kt +76 -0
  15. package/android/src/main/java/com/customerglu/reactnativecustomerglu/BannerViewManager.kt +19 -0
  16. package/android/src/main/java/com/customerglu/reactnativecustomerglu/CGEmbededView.kt +102 -0
  17. package/android/src/main/java/com/customerglu/reactnativecustomerglu/CGEmbededViewManager.kt +18 -0
  18. package/android/src/main/java/com/customerglu/reactnativecustomerglu/RnCustomergluModule.kt +698 -0
  19. package/android/src/main/java/com/customerglu/reactnativecustomerglu/RnCustomergluPackage.kt +41 -0
  20. package/ios/IosBannerView.h +16 -0
  21. package/ios/IosBannerView.mm +126 -0
  22. package/ios/IosBannerViewManager.mm +24 -0
  23. package/ios/ReactNativeCustomerglu-Bridging-Header.h +19 -0
  24. package/ios/Rncustomerglu.h +9 -0
  25. package/ios/Rncustomerglu.mm +499 -0
  26. package/ios/generated/RNCustomergluSpec/RNCustomergluSpec-generated.mm +221 -0
  27. package/ios/generated/RNCustomergluSpec/RNCustomergluSpec.h +106 -0
  28. package/ios/generated/RNCustomergluSpecJSI-generated.cpp +237 -0
  29. package/ios/generated/RNCustomergluSpecJSI.h +305 -0
  30. package/lib/commonjs/NativeReactNativeCustomerglu.js +9 -0
  31. package/lib/commonjs/NativeReactNativeCustomerglu.js.map +1 -0
  32. package/lib/commonjs/index.js +30 -193
  33. package/lib/commonjs/index.js.map +1 -1
  34. package/lib/module/NativeReactNativeCustomerglu.js +5 -0
  35. package/lib/module/NativeReactNativeCustomerglu.js.map +1 -0
  36. package/lib/module/index.js +32 -166
  37. package/lib/module/index.js.map +1 -1
  38. package/lib/typescript/commonjs/package.json +1 -0
  39. package/lib/typescript/commonjs/src/NativeReactNativeCustomerglu.d.ts +33 -0
  40. package/lib/typescript/commonjs/src/NativeReactNativeCustomerglu.d.ts.map +1 -0
  41. package/lib/typescript/commonjs/src/index.d.ts +35 -0
  42. package/lib/typescript/commonjs/src/index.d.ts.map +1 -0
  43. package/lib/typescript/module/package.json +1 -0
  44. package/lib/typescript/module/src/NativeReactNativeCustomerglu.d.ts +33 -0
  45. package/lib/typescript/module/src/NativeReactNativeCustomerglu.d.ts.map +1 -0
  46. package/lib/typescript/module/src/index.d.ts +35 -0
  47. package/lib/typescript/module/src/index.d.ts.map +1 -0
  48. package/package.json +91 -45
  49. package/react-native.config.js +12 -0
  50. package/src/NativeReactNativeCustomerglu.ts +36 -0
  51. package/src/index.tsx +76 -216
  52. package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  53. package/android/gradle/wrapper/gradle-wrapper.properties +0 -5
  54. package/android/gradlew +0 -185
  55. package/android/gradlew.bat +0 -89
  56. package/android/src/main/java/com/reactnativerncustomerglu/Bannerwidget/Bannerwidget/BannerWidgetViewGroupManager.java +0 -40
  57. package/android/src/main/java/com/reactnativerncustomerglu/Bannerwidget/Bannerwidget/bannerWidget.java +0 -43
  58. package/android/src/main/java/com/reactnativerncustomerglu/Bannerwidget/wrapperview/WrapperView.java +0 -61
  59. package/android/src/main/java/com/reactnativerncustomerglu/CGUtils.java +0 -13
  60. package/android/src/main/java/com/reactnativerncustomerglu/EmbedBannerwidget/EWrapperview/EWrapperView.java +0 -61
  61. package/android/src/main/java/com/reactnativerncustomerglu/EmbedBannerwidget/EmbedBannerwidget/EBannerWidget.java +0 -35
  62. package/android/src/main/java/com/reactnativerncustomerglu/EmbedBannerwidget/EmbedBannerwidget/EBannerWidgetVGManager.java +0 -40
  63. package/android/src/main/java/com/reactnativerncustomerglu/RncustomergluModule.java +0 -1033
  64. package/android/src/main/java/com/reactnativerncustomerglu/RncustomergluPackage.java +0 -35
  65. package/android/src/main/res/drawable/bottom_sheet_edges.xml +0 -7
  66. package/android/src/main/res/drawable/floating_close_layout.xml +0 -10
  67. package/android/src/main/res/drawable/ic_arrow_back.xml +0 -5
  68. package/android/src/main/res/drawable/ic_back.xml +0 -10
  69. package/android/src/main/res/drawable/ic_delete_bin.xml +0 -5
  70. package/android/src/main/res/drawable/ic_delete_bin_red.xml +0 -5
  71. package/android/src/main/res/drawable/ij.png +0 -0
  72. package/android/src/main/res/drawable/notification.png +0 -0
  73. package/android/src/main/res/drawable/progress_bg.xml +0 -33
  74. package/android/src/main/res/values/colors.xml +0 -13
  75. package/android/src/main/res/values/themes.xml +0 -15
  76. package/android/src/main/res/xml/provider_path.xml +0 -4
  77. package/ios/CustomPlayer.m +0 -30
  78. package/ios/Rncustomerglu-Bridging-Header.h +0 -4
  79. package/ios/Rncustomerglu.m +0 -83
  80. package/ios/Rncustomerglu.swift +0 -647
  81. package/ios/Rncustomerglu.xcodeproj/project.pbxproj +0 -293
  82. package/ios/Rncustomerglu.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -4
  83. package/ios/Rncustomerglu.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
  84. package/lib/typescript/index.d.ts +0 -62
  85. package/react-native-customerglu.podspec +0 -23
@@ -0,0 +1,41 @@
1
+ package com.customerglu.reactnativecustomerglu
2
+
3
+ import com.facebook.react.BaseReactPackage
4
+ import com.facebook.react.bridge.NativeModule
5
+ import com.facebook.react.bridge.ReactApplicationContext
6
+ import com.facebook.react.module.model.ReactModuleInfo
7
+ import com.facebook.react.module.model.ReactModuleInfoProvider
8
+ import com.facebook.react.uimanager.ViewManager
9
+ import java.util.HashMap
10
+
11
+ class RnCustomergluPackage : BaseReactPackage() {
12
+ override fun getModule(name: String, reactContext: ReactApplicationContext): NativeModule? {
13
+ return if (name == RnCustomergluModule.NAME) {
14
+ RnCustomergluModule(reactContext)
15
+ } else {
16
+ null
17
+ }
18
+ }
19
+
20
+ override fun createViewManagers(reactContext: ReactApplicationContext): List<ViewManager<*, *>> {
21
+ return listOf(
22
+ BannerViewManager(),
23
+ CGEmbededViewManager()
24
+ )
25
+ }
26
+
27
+ override fun getReactModuleInfoProvider(): ReactModuleInfoProvider {
28
+ return ReactModuleInfoProvider {
29
+ val moduleInfos: MutableMap<String, ReactModuleInfo> = HashMap()
30
+ moduleInfos[RnCustomergluModule.NAME] = ReactModuleInfo(
31
+ RnCustomergluModule.NAME,
32
+ RnCustomergluModule.NAME,
33
+ false, // canOverrideExistingModule
34
+ false, // needsEagerInit
35
+ false, // isCxxModule
36
+ true // isTurboModule
37
+ )
38
+ moduleInfos
39
+ }
40
+ }
41
+ }
@@ -0,0 +1,16 @@
1
+ #import <React/RCTView.h>
2
+ #import <WebKit/WebKit.h>
3
+ #import <UserNotifications/UserNotifications.h>
4
+ #import <UserNotifications/UNNotification.h>
5
+ #import <UIKit/UIKit.h>
6
+
7
+ NS_ASSUME_NONNULL_BEGIN
8
+
9
+ @interface IosBannerView : RCTView
10
+
11
+ @property (nonatomic, strong) NSString *bannerId;
12
+ - (void)setBannerId:(NSString *)bannerId;
13
+
14
+ @end
15
+
16
+ NS_ASSUME_NONNULL_END
@@ -0,0 +1,126 @@
1
+ #import "IosBannerView.h"
2
+ #import <WebKit/WebKit.h>
3
+ #import <UserNotifications/UserNotifications.h>
4
+ #import <UserNotifications/UNNotification.h>
5
+ #import <CustomerGlu/CustomerGlu-Swift.h>
6
+ #import <objc/runtime.h>
7
+
8
+ @implementation IosBannerView {
9
+ BannerView *_bannerView;
10
+ NSString *_bannerId;
11
+ BOOL _bannerInitialized;
12
+ BOOL _isHeightUpdated;
13
+ }
14
+
15
+ - (instancetype)initWithFrame:(CGRect)frame {
16
+ if (self = [super initWithFrame:frame]) {
17
+ // Initialize view
18
+ self.userInteractionEnabled = YES;
19
+ _bannerInitialized = NO;
20
+ NSLog(@"[IosView] Initialized with frame: %@, userInteractionEnabled: %d", NSStringFromCGRect(frame), self.userInteractionEnabled);
21
+ }
22
+ return self;
23
+ }
24
+
25
+ - (void)setBannerId:(NSString *)bannerId {
26
+ NSLog(@"[IosView] setBannerId called with: %@", bannerId);
27
+ _bannerId = bannerId;
28
+
29
+ if (!_bannerInitialized || ![_bannerId isEqualToString:bannerId]) {
30
+ // Remove existing banner if any
31
+ if (_bannerView) {
32
+ [_bannerView removeFromSuperview];
33
+ _bannerView = nil;
34
+ NSLog(@"[IosView] Removed existing banner view");
35
+ }
36
+
37
+ if (bannerId) {
38
+ [self createBannerView];
39
+ }
40
+ }
41
+ }
42
+
43
+ - (void)createBannerView {
44
+ NSLog(@"[IosView] Creating banner view");
45
+ dispatch_async(dispatch_get_main_queue(), ^{
46
+ self->_bannerView = [[BannerView alloc] initWithFrame:self.bounds bannerId:self->_bannerId];
47
+
48
+ if (self->_bannerView) {
49
+ self.userInteractionEnabled = YES;
50
+ self->_bannerView.userInteractionEnabled = YES;
51
+ NSLog(@"[IosView] Banner view created, userInteractionEnabled: %d", self->_bannerView.userInteractionEnabled);
52
+
53
+ [self addSubview:self->_bannerView];
54
+ self->_bannerView.frame = self.bounds;
55
+ self->_bannerView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
56
+ self->_bannerInitialized = YES;
57
+ [self setNeedsLayout];
58
+
59
+ } else {
60
+ [self showError:@"Failed to create banner view"];
61
+ NSLog(@"[IosView] Failed to create banner view");
62
+ }
63
+ });
64
+ }
65
+
66
+ - (void)showError:(NSString *)message {
67
+ UILabel *errorLabel = [[UILabel alloc] init];
68
+ errorLabel.text = message;
69
+ errorLabel.textColor = [UIColor redColor];
70
+ errorLabel.textAlignment = NSTextAlignmentCenter;
71
+ errorLabel.numberOfLines = 0;
72
+ [self addSubview:errorLabel];
73
+ errorLabel.frame = self.bounds;
74
+ }
75
+
76
+ //- (void)layoutSubviews {
77
+ // [super layoutSubviews];
78
+ //
79
+ // if (_bannerView) {
80
+ // _bannerView.frame = self.bounds;
81
+ // }
82
+ //}
83
+
84
+ //- (void)didMoveToSuperview {
85
+ // [super didMoveToSuperview];
86
+ //
87
+ // if (_bannerId && !_bannerView) {
88
+ // NSLog(@"[IosView] didMoveToSuperview - recreating banner view");
89
+ // [self createBannerView];
90
+ // }
91
+ //}
92
+ //
93
+ //- (void)didMoveToWindow {
94
+ // [super didMoveToWindow];
95
+ //
96
+ // if (self.window && _bannerId && !_bannerView) {
97
+ // NSLog(@"[IosView] didMoveToWindow - recreating banner view");
98
+ // [self createBannerView];
99
+ // }
100
+ //}
101
+
102
+ // Direct touch handling to manually forward touches to BannerView
103
+ - (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
104
+ NSLog(@"[IosView] touchesBegan detected in IosView");
105
+
106
+ if (_bannerView) {
107
+ UITouch *touch = [touches anyObject];
108
+ CGPoint point = [touch locationInView:self];
109
+
110
+ // Check if the touch is within the banner view
111
+ if (CGRectContainsPoint(_bannerView.frame, point)) {
112
+ NSLog(@"[IosView] Touch is within banner view bounds");
113
+
114
+ // Option 1: Try calling handleTap: with nil since we can't create a properly configured gesture recognizer
115
+ NSLog(@"[IosView] Directly calling handleTap: on BannerView");
116
+ [_bannerView performSelector:@selector(handleTap:) withObject:nil];
117
+
118
+ // Don't call super so we consume the event
119
+ return;
120
+ }
121
+ }
122
+
123
+ [super touchesBegan:touches withEvent:event];
124
+ }
125
+
126
+ @end
@@ -0,0 +1,24 @@
1
+ #import <React/RCTViewManager.h>
2
+ #import <WebKit/WebKit.h>
3
+ #import <UserNotifications/UserNotifications.h>
4
+ #import <UserNotifications/UNNotification.h>
5
+ #import "IosBannerView.h"
6
+
7
+ @interface IosBannerViewManager : RCTViewManager
8
+ @end
9
+
10
+ @implementation IosBannerViewManager
11
+
12
+ RCT_EXPORT_MODULE(BannerView)
13
+
14
+ - (UIView *)view {
15
+ return [[IosBannerView alloc] init];
16
+ }
17
+
18
+ RCT_EXPORT_VIEW_PROPERTY(bannerId, NSString)
19
+
20
+ + (BOOL)requiresMainQueueSetup {
21
+ return YES;
22
+ }
23
+
24
+ @end
@@ -0,0 +1,19 @@
1
+ //
2
+ // ReactNativeCustomerglu-Bridging-Header.h
3
+ // Pods
4
+ //
5
+ // Created by Himanshu Trehan on 27/02/25.
6
+ //
7
+
8
+ #ifndef ReactNativeCustomerglu_Bridging_Header_h
9
+ #define ReactNativeCustomerglu_Bridging_Header_h
10
+
11
+ #import "React/RCTBridgeModule.h"
12
+ #import "React/RCTEventEmitter.h"
13
+
14
+ #import <ReactNativeCustomerglu/Rncustomerglu.h>
15
+ #import <WebKit/WebKit.h>
16
+ #import <UserNotifications/UserNotifications.h>
17
+ #import <UserNotifications/UNNotification.h>
18
+
19
+ #endif /* ReactNativeCustomerglu_Bridging_Header_h */
@@ -0,0 +1,9 @@
1
+
2
+ #import "generated/RNCustomergluSpec/RNCustomergluSpec.h"
3
+ #import <WebKit/WebKit.h>
4
+ #import <UserNotifications/UNNotification.h>
5
+ #import <React/RCTEventEmitter.h>
6
+
7
+ @interface Rncustomerglu : RCTEventEmitter <NativeReactNativeCustomergluSpec>
8
+
9
+ @end