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.
Files changed (37) hide show
  1. package/example/App.js +4 -8
  2. package/example/android/.gradle/7.3.3/checksums/checksums.lock +0 -0
  3. package/example/android/.gradle/7.3.3/checksums/md5-checksums.bin +0 -0
  4. package/example/android/.gradle/7.3.3/checksums/sha1-checksums.bin +0 -0
  5. package/example/android/.gradle/7.3.3/dependencies-accessors/dependencies-accessors.lock +0 -0
  6. package/example/android/.gradle/7.3.3/dependencies-accessors/gc.properties +0 -0
  7. package/example/android/.gradle/7.3.3/executionHistory/executionHistory.lock +0 -0
  8. package/example/android/.gradle/7.3.3/fileChanges/last-build.bin +0 -0
  9. package/example/android/.gradle/7.3.3/fileHashes/fileHashes.bin +0 -0
  10. package/example/android/.gradle/7.3.3/fileHashes/fileHashes.lock +0 -0
  11. package/example/android/.gradle/7.3.3/fileHashes/resourceHashesCache.bin +0 -0
  12. package/example/android/.gradle/7.3.3/gc.properties +0 -0
  13. package/example/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  14. package/example/android/.gradle/buildOutputCleanup/cache.properties +2 -0
  15. package/example/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
  16. package/example/android/.gradle/vcs-1/gc.properties +0 -0
  17. package/example/android/.idea/.name +1 -0
  18. package/example/android/.idea/compiler.xml +6 -0
  19. package/example/android/.idea/gradle.xml +34 -0
  20. package/example/android/.idea/jarRepositories.xml +55 -0
  21. package/example/android/.idea/misc.xml +10 -0
  22. package/example/android/.idea/vcs.xml +6 -0
  23. package/example/android/app/build.gradle +1 -0
  24. package/example/android/app/google-services.json +275 -0
  25. package/example/android/build.gradle +1 -0
  26. package/example/android/local.properties +8 -0
  27. package/example/ios/Podfile +8 -0
  28. package/example/ios/example/AppDelegate.mm +3 -4
  29. package/example/package-lock.json +1059 -18
  30. package/example/package.json +2 -1
  31. package/example/yarn.lock +377 -11
  32. package/index.js +10 -2
  33. package/ios/AppICEReactEvent.h +1 -1
  34. package/ios/AppICEReactEvent.m +2 -2
  35. package/ios/AppIceReactPlugin.h +1 -0
  36. package/ios/AppIceReactPlugin.m +7 -1
  37. 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
- const eventEmitter = new NativeEventEmitter(NativeModules.AppIceReactPlugin);
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,
@@ -14,7 +14,7 @@
14
14
  NS_ASSUME_NONNULL_BEGIN
15
15
 
16
16
  @interface AppICEReactEvent : RCTEventEmitter <RCTBridgeModule, UNUserNotificationCenterDelegate>
17
- -(void)didReceiveNotificationResponse:(UNNotificationResponse *)response;
17
+ -(void)didReceiveNotificationResponse:(NSNotification *)event;
18
18
  + (id)allocWithZone:(NSZone *)zone;
19
19
 
20
20
  @end
@@ -56,8 +56,8 @@ RCT_EXPORT_MODULE();
56
56
 
57
57
 
58
58
 
59
- -(void)didReceiveNotificationResponse:(NSDictionary *)response{
60
- [self sendEventWithName:kAppICEPushNotificationClicked body:response];
59
+ -(void)didReceiveNotificationResponse:(NSNotification *)event{
60
+ [self sendEventWithName:kAppICEPushNotificationClicked body:event.userInfo];
61
61
  }
62
62
 
63
63
 
@@ -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
 
@@ -132,5 +132,11 @@ RCT_EXPORT_METHOD(setUser:(NSDictionary*)userProfile)
132
132
  }
133
133
 
134
134
  + (void)pushNotificationClicked:(NSDictionary *)userInfo {
135
- [[NSNotificationCenter defaultCenter] postNotificationName:kAppICEPushNotificationClicked object:nil userInfo:userInfo];
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
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "reactnative-plugin-appice",
3
- "version": "1.4.2",
3
+ "version": "1.4.3",
4
4
  "description": "appICE React Native SDK",
5
5
  "main": "index.js",
6
6
  "files": [