react-native-netmera 1.4.3 → 1.4.4
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/.idea/misc.xml +4 -0
- package/android/.gradle/4.10.1/fileHashes/fileHashes.bin +0 -0
- package/android/.gradle/4.10.1/fileHashes/fileHashes.lock +0 -0
- package/android/.idea/gradle.xml +1 -0
- package/android/build/intermediates/compile_library_classes_jar/debug/classes.jar +0 -0
- package/android/build/intermediates/javac/debug/classes/com/netmera/reactnativesdk/RNNetmera.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/netmera/reactnativesdk/RNNetmeraPushBroadcastReceiver.class +0 -0
- package/android/build/intermediates/runtime_library_classes_jar/debug/classes.jar +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
- package/android/src/main/java/com/netmera/reactnativesdk/RNNetmera.java +1 -1
- package/ios/RNNetmera.m +1 -1
- package/ios/RNNetmera.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- package/ios/RNNetmera.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/ios/RNNetmera.xcodeproj/project.xcworkspace/xcuserdata/gunesbaki.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/RNNetmeraRCTEventEmitter.m +48 -16
- package/package.json +1 -1
package/.idea/misc.xml
ADDED
|
Binary file
|
|
Binary file
|
package/android/.idea/gradle.xml
CHANGED
|
Binary file
|
package/android/build/intermediates/javac/debug/classes/com/netmera/reactnativesdk/RNNetmera.class
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -16,7 +16,7 @@ public class RNNetmera {
|
|
|
16
16
|
static void setNetmeraHeaders() {
|
|
17
17
|
ContentValues headerValues = new ContentValues();
|
|
18
18
|
headerValues.put("X-netmera-framework", "react");
|
|
19
|
-
headerValues.put("X-netmera-frameworkV", "1.4.
|
|
19
|
+
headerValues.put("X-netmera-frameworkV", "1.4.4");
|
|
20
20
|
Netmera.setNetmeraHeaders(headerValues);
|
|
21
21
|
}
|
|
22
22
|
}
|
package/ios/RNNetmera.m
CHANGED
|
@@ -46,7 +46,7 @@ NSString *const ERROR_MESSAGE_SET_CATEGORY_PREFERENCE = @"Error occurred while s
|
|
|
46
46
|
|
|
47
47
|
+ (void)setNetmeraHeaders {
|
|
48
48
|
[Netmera setFramework:@"react"];
|
|
49
|
-
[Netmera setFrameworkVersion:@"1.4.
|
|
49
|
+
[Netmera setFrameworkVersion:@"1.4.4"];
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
+ (void)setPushDelegate:(NSObject<NetmeraPushDelegate> *)delegate {
|
|
Binary file
|
|
@@ -9,23 +9,39 @@
|
|
|
9
9
|
#import "RNNetmeraRCTEventEmitter.h"
|
|
10
10
|
|
|
11
11
|
@implementation RNNetmeraRCTEventEmitter
|
|
12
|
-
|
|
13
|
-
bool hasListeners;
|
|
14
|
-
}
|
|
12
|
+
|
|
15
13
|
RCT_EXPORT_MODULE();
|
|
16
14
|
|
|
17
|
-
|
|
15
|
+
bool isReactBridgeInitialized;
|
|
18
16
|
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
NSDictionary* waitingOnPushRegister = nil;
|
|
18
|
+
NSDictionary* waitingOnPushReceive = nil;
|
|
19
|
+
NSDictionary* waitingOnPushOpen = nil;
|
|
20
|
+
NSDictionary* waitingOnPushDismiss = nil;
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
-(void)startObserving {
|
|
23
|
+
isReactBridgeInitialized = YES;
|
|
24
|
+
|
|
25
|
+
if (waitingOnPushRegister != nil) {
|
|
26
|
+
[[NSNotificationCenter defaultCenter] postNotificationName:@"onPushRegister" object:nil userInfo: waitingOnPushRegister];
|
|
27
|
+
waitingOnPushRegister = nil;
|
|
28
|
+
}
|
|
29
|
+
if (waitingOnPushReceive != nil) {
|
|
30
|
+
[[NSNotificationCenter defaultCenter] postNotificationName:@"onPushReceive" object:nil userInfo: waitingOnPushReceive];
|
|
31
|
+
waitingOnPushReceive = nil;
|
|
32
|
+
}
|
|
33
|
+
if (waitingOnPushOpen != nil) {
|
|
34
|
+
[[NSNotificationCenter defaultCenter] postNotificationName:@"onPushOpen" object:nil userInfo: waitingOnPushOpen];
|
|
35
|
+
waitingOnPushOpen = nil;
|
|
36
|
+
}
|
|
37
|
+
if (waitingOnPushDismiss != nil) {
|
|
38
|
+
[[NSNotificationCenter defaultCenter] postNotificationName:@"onPushDismiss" object:nil userInfo: waitingOnPushDismiss];
|
|
39
|
+
waitingOnPushDismiss = nil;
|
|
40
|
+
}
|
|
25
41
|
}
|
|
26
42
|
|
|
27
43
|
-(void)stopObserving {
|
|
28
|
-
|
|
44
|
+
isReactBridgeInitialized = NO;
|
|
29
45
|
}
|
|
30
46
|
|
|
31
47
|
- (NSArray<NSString *> *)supportedEvents
|
|
@@ -48,7 +64,7 @@ NSDictionary* pushToken = nil;
|
|
|
48
64
|
}
|
|
49
65
|
|
|
50
66
|
- (void)emitEvent:(NSNotification *)notification {
|
|
51
|
-
if (
|
|
67
|
+
if (isReactBridgeInitialized) {
|
|
52
68
|
[self sendEventWithName:notification.name body:notification.userInfo];
|
|
53
69
|
}
|
|
54
70
|
}
|
|
@@ -61,21 +77,37 @@ NSDictionary* pushToken = nil;
|
|
|
61
77
|
for (NSUInteger i = 0; i < deviceToken.length; i++) {
|
|
62
78
|
[deviceTokenString appendFormat:@"%02x", bytes[i]];
|
|
63
79
|
}
|
|
64
|
-
pushToken = @{@"pushToken" : deviceTokenString};
|
|
80
|
+
NSDictionary* pushToken = @{@"pushToken" : deviceTokenString};
|
|
65
81
|
|
|
66
|
-
|
|
82
|
+
if (isReactBridgeInitialized) {
|
|
83
|
+
[[NSNotificationCenter defaultCenter] postNotificationName:@"onPushRegister" object:nil userInfo:pushToken];
|
|
84
|
+
} else {
|
|
85
|
+
waitingOnPushRegister = pushToken;
|
|
86
|
+
}
|
|
67
87
|
}
|
|
68
88
|
|
|
69
89
|
+ (void)onPushReceive:(NSDictionary *)body {
|
|
70
|
-
|
|
90
|
+
if (isReactBridgeInitialized) {
|
|
91
|
+
[[NSNotificationCenter defaultCenter] postNotificationName:@"onPushReceive" object:nil userInfo:body];
|
|
92
|
+
} else {
|
|
93
|
+
waitingOnPushReceive = body;
|
|
94
|
+
}
|
|
71
95
|
}
|
|
72
96
|
|
|
73
97
|
+ (void)onPushOpen:(NSDictionary *)body {
|
|
74
|
-
|
|
98
|
+
if (isReactBridgeInitialized) {
|
|
99
|
+
[[NSNotificationCenter defaultCenter] postNotificationName:@"onPushOpen" object:nil userInfo:body];
|
|
100
|
+
} else {
|
|
101
|
+
waitingOnPushOpen = body;
|
|
102
|
+
}
|
|
75
103
|
}
|
|
76
104
|
|
|
77
105
|
+ (void)onPushDismiss:(NSDictionary *)body {
|
|
78
|
-
|
|
106
|
+
if (isReactBridgeInitialized) {
|
|
107
|
+
[[NSNotificationCenter defaultCenter] postNotificationName:@"onPushDismiss" object:nil userInfo:body];
|
|
108
|
+
} else {
|
|
109
|
+
waitingOnPushDismiss = body;
|
|
110
|
+
}
|
|
79
111
|
}
|
|
80
112
|
|
|
81
113
|
@end
|