reactnative-plugin-appice 1.4.2 → 1.4.3
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/example/App.js +4 -8
- package/example/android/.gradle/7.3.3/checksums/checksums.lock +0 -0
- package/example/android/.gradle/7.3.3/checksums/md5-checksums.bin +0 -0
- package/example/android/.gradle/7.3.3/checksums/sha1-checksums.bin +0 -0
- package/example/android/.gradle/7.3.3/dependencies-accessors/dependencies-accessors.lock +0 -0
- package/example/android/.gradle/7.3.3/dependencies-accessors/gc.properties +0 -0
- package/example/android/.gradle/7.3.3/executionHistory/executionHistory.lock +0 -0
- package/example/android/.gradle/7.3.3/fileChanges/last-build.bin +0 -0
- package/example/android/.gradle/7.3.3/fileHashes/fileHashes.bin +0 -0
- package/example/android/.gradle/7.3.3/fileHashes/fileHashes.lock +0 -0
- package/example/android/.gradle/7.3.3/fileHashes/resourceHashesCache.bin +0 -0
- package/example/android/.gradle/7.3.3/gc.properties +0 -0
- package/example/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/example/android/.gradle/buildOutputCleanup/cache.properties +2 -0
- package/example/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
- package/example/android/.gradle/vcs-1/gc.properties +0 -0
- package/example/android/.idea/.name +1 -0
- package/example/android/.idea/compiler.xml +6 -0
- package/example/android/.idea/gradle.xml +34 -0
- package/example/android/.idea/jarRepositories.xml +55 -0
- package/example/android/.idea/misc.xml +10 -0
- package/example/android/.idea/vcs.xml +6 -0
- package/example/android/app/build.gradle +1 -0
- package/example/android/app/google-services.json +275 -0
- package/example/android/build.gradle +1 -0
- package/example/android/local.properties +8 -0
- package/example/ios/Podfile +8 -0
- package/example/ios/example/AppDelegate.mm +3 -4
- package/example/package-lock.json +1059 -18
- package/example/package.json +2 -1
- package/example/yarn.lock +377 -11
- package/index.js +10 -2
- package/ios/AppICEReactEvent.h +1 -1
- package/ios/AppICEReactEvent.m +2 -2
- package/ios/AppIceReactPlugin.h +1 -0
- package/ios/AppIceReactPlugin.m +7 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
import { DeviceEventEmitter, NativeEventEmitter, NativeModules } from 'react-native';
|
|
2
|
+
import { Platform, Component } from 'react-native';
|
|
2
3
|
|
|
3
4
|
const AppIceReactPlugin = NativeModules.AppIceReactPlugin;
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
var eventEmitter;
|
|
6
|
+
if(Platform.OS === 'ios')
|
|
7
|
+
{
|
|
8
|
+
eventEmitter = NativeModules.AppICEReactEvent ? new NativeEventEmitter(NativeModules.AppICEReactEvent) : DeviceEventEmitter;
|
|
9
|
+
}
|
|
10
|
+
else
|
|
11
|
+
{
|
|
12
|
+
eventEmitter = new NativeEventEmitter(NativeModules.AppIceReactPlugin);
|
|
13
|
+
}
|
|
6
14
|
var AppICEReact = {
|
|
7
15
|
AppICEPushNotificationClicked: AppIceReactPlugin.AppICEPushNotificationClicked,
|
|
8
16
|
name: AppIceReactPlugin.n,
|
package/ios/AppICEReactEvent.h
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
NS_ASSUME_NONNULL_BEGIN
|
|
15
15
|
|
|
16
16
|
@interface AppICEReactEvent : RCTEventEmitter <RCTBridgeModule, UNUserNotificationCenterDelegate>
|
|
17
|
-
-(void)didReceiveNotificationResponse:(
|
|
17
|
+
-(void)didReceiveNotificationResponse:(NSNotification *)event;
|
|
18
18
|
+ (id)allocWithZone:(NSZone *)zone;
|
|
19
19
|
|
|
20
20
|
@end
|
package/ios/AppICEReactEvent.m
CHANGED
|
@@ -56,8 +56,8 @@ RCT_EXPORT_MODULE();
|
|
|
56
56
|
|
|
57
57
|
|
|
58
58
|
|
|
59
|
-
-(void)didReceiveNotificationResponse:(
|
|
60
|
-
[self sendEventWithName:kAppICEPushNotificationClicked body:
|
|
59
|
+
-(void)didReceiveNotificationResponse:(NSNotification *)event{
|
|
60
|
+
[self sendEventWithName:kAppICEPushNotificationClicked body:event.userInfo];
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
|
package/ios/AppIceReactPlugin.h
CHANGED
|
@@ -14,5 +14,6 @@ static NSString *const kis_emp = @"is_emp";
|
|
|
14
14
|
@interface AppIceReactPlugin : NSObject <RCTBridgeModule,UNUserNotificationCenterDelegate>
|
|
15
15
|
+(void)didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken;
|
|
16
16
|
+ (void)pushNotificationClicked:(NSDictionary *)userInfo;
|
|
17
|
+
+ (void)pushNotificationReceived:(NSDictionary *)userInfo;
|
|
17
18
|
@end
|
|
18
19
|
|
package/ios/AppIceReactPlugin.m
CHANGED
|
@@ -132,5 +132,11 @@ RCT_EXPORT_METHOD(setUser:(NSDictionary*)userProfile)
|
|
|
132
132
|
}
|
|
133
133
|
|
|
134
134
|
+ (void)pushNotificationClicked:(NSDictionary *)userInfo {
|
|
135
|
-
|
|
135
|
+
NSDictionary *event = @{ kAppICEPushNotificationClicked : userInfo};
|
|
136
|
+
[[NSNotificationCenter defaultCenter] postNotificationName:kAppICEPushNotificationClicked object:nil userInfo:event];
|
|
136
137
|
}
|
|
138
|
+
+ (void)pushNotificationReceived:(NSDictionary *)userInfo {
|
|
139
|
+
[[appICE sharedInstance]pushNotificationReceived:userInfo];
|
|
140
|
+
}
|
|
141
|
+
@end
|
|
142
|
+
|