Commit 0b9170e5 authored by Lidan Hifi's avatar Lidan Hifi

rename package

parent 1ee9741b
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
#import "RCTBridgeModule.h" #import "RCTBridgeModule.h"
@interface SmartNotifications : NSObject <RCTBridgeModule> @interface RNNotifications : NSObject <RCTBridgeModule>
+ (void)didReceiveRemoteNotification:(NSDictionary *)notification; + (void)didReceiveRemoteNotification:(NSDictionary *)notification;
+ (void)didReceiveLocalNotification:(UILocalNotification *)notification; + (void)didReceiveLocalNotification:(UILocalNotification *)notification;
......
...@@ -2,18 +2,18 @@ ...@@ -2,18 +2,18 @@
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import "RCTBridge.h" #import "RCTBridge.h"
#import "RCTEventDispatcher.h" #import "RCTEventDispatcher.h"
#import "SmartNotifications.h" #import "RNNotifications.h"
#import "RCTUtils.h" #import "RCTUtils.h"
NSString *const SmartNotificationCreateAction = @"CREATE"; NSString *const RNNotificationCreateAction = @"CREATE";
NSString *const SmartNotificationClearAction = @"CLEAR"; NSString *const RNNotificationClearAction = @"CLEAR";
NSString *const SmartNotificationReceivedForeground = @"SmartNotificationReceivedForeground"; NSString *const RNNotificationReceivedForeground = @"RNNotificationReceivedForeground";
NSString *const SmartNotificationReceivedBackground = @"SmartNotificationReceivedBackground"; NSString *const RNNotificationReceivedBackground = @"RNNotificationReceivedBackground";
NSString *const SmartNotificationOpened = @"SmartNotificationOpened"; NSString *const RNNotificationOpened = @"RNNotificationOpened";
@implementation SmartNotifications @implementation RNNotifications
RCT_EXPORT_MODULE() RCT_EXPORT_MODULE()
...@@ -32,17 +32,17 @@ static NSString* username; ...@@ -32,17 +32,17 @@ static NSString* username;
[[NSNotificationCenter defaultCenter] addObserver:self [[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(handleNotificationReceivedForeground:) selector:@selector(handleNotificationReceivedForeground:)
name:SmartNotificationReceivedForeground name:RNNotificationReceivedForeground
object:nil]; object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self [[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(handleNotificationReceivedBackground:) selector:@selector(handleNotificationReceivedBackground:)
name:SmartNotificationReceivedBackground name:RNNotificationReceivedBackground
object:nil]; object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self [[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(handleNotificationOpened:) selector:@selector(handleNotificationOpened:)
name:SmartNotificationOpened name:RNNotificationOpened
object:nil]; object:nil];
} }
...@@ -80,7 +80,7 @@ static NSString* username; ...@@ -80,7 +80,7 @@ static NSString* username;
*/ */
+ (void)didReceiveNotificationOnForegroundState:(NSDictionary *)notification + (void)didReceiveNotificationOnForegroundState:(NSDictionary *)notification
{ {
[[NSNotificationCenter defaultCenter] postNotificationName:SmartNotificationReceivedForeground [[NSNotificationCenter defaultCenter] postNotificationName:RNNotificationReceivedForeground
object:self object:self
userInfo:notification]; userInfo:notification];
} }
...@@ -94,24 +94,24 @@ static NSString* username; ...@@ -94,24 +94,24 @@ static NSString* username;
if (action) { if (action) {
// create or delete notification // create or delete notification
if ([action isEqualToString: SmartNotificationCreateAction] if ([action isEqualToString: RNNotificationCreateAction]
&& notificationId && notificationId
&& alert) { && alert) {
[self dispatchLocalNotificationFromNotification:notification]; [self dispatchLocalNotificationFromNotification:notification];
} else if ([action isEqualToString: SmartNotificationClearAction] && notificationId) { } else if ([action isEqualToString: RNNotificationClearAction] && notificationId) {
[self clearNotificationFromNotificationsCenter:notificationId]; [self clearNotificationFromNotificationsCenter:notificationId];
} }
} }
[[NSNotificationCenter defaultCenter] postNotificationName:SmartNotificationReceivedBackground [[NSNotificationCenter defaultCenter] postNotificationName:RNNotificationReceivedBackground
object:self object:self
userInfo:notification]; userInfo:notification];
} }
+ (void)didNotificationOpen:(NSDictionary *)notification + (void)didNotificationOpen:(NSDictionary *)notification
{ {
[[NSNotificationCenter defaultCenter] postNotificationName:SmartNotificationOpened [[NSNotificationCenter defaultCenter] postNotificationName:RNNotificationOpened
object:self object:self
userInfo:notification]; userInfo:notification];
} }
...@@ -127,7 +127,7 @@ static NSString* username; ...@@ -127,7 +127,7 @@ static NSString* username;
NSString* action = [customData objectForKey:@"action"]; NSString* action = [customData objectForKey:@"action"];
NSString* notificationId = [customData objectForKey:@"notificationId"]; NSString* notificationId = [customData objectForKey:@"notificationId"];
if ([action isEqualToString: SmartNotificationCreateAction] if ([action isEqualToString: RNNotificationCreateAction]
&& notificationId && notificationId
&& alert) { && alert) {
...@@ -193,12 +193,12 @@ static NSString* username; ...@@ -193,12 +193,12 @@ static NSString* username;
RCT_EXPORT_METHOD(dispatchLocalNotificationFromNotification:(NSDictionary *)notification) RCT_EXPORT_METHOD(dispatchLocalNotificationFromNotification:(NSDictionary *)notification)
{ {
[SmartNotifications dispatchLocalNotificationFromNotification:notification]; [RNNotifications dispatchLocalNotificationFromNotification:notification];
} }
RCT_EXPORT_METHOD(clearNotificationFromNotificationsCenter:(NSString *)notificationId) RCT_EXPORT_METHOD(clearNotificationFromNotificationsCenter:(NSString *)notificationId)
{ {
[SmartNotifications clearNotificationFromNotificationsCenter:notificationId]; [RNNotifications clearNotificationFromNotificationsCenter:notificationId];
} }
@end @end
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
objects = { objects = {
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
13BE3DEE1AC21097009241FE /* SmartNotifications.m in Sources */ = {isa = PBXBuildFile; fileRef = 13BE3DED1AC21097009241FE /* SmartNotifications.m */; }; D8A2F7551CB57F1A002CC8F5 /* RNNotifications.m in Sources */ = {isa = PBXBuildFile; fileRef = D8A2F7541CB57F1A002CC8F5 /* RNNotifications.m */; };
/* End PBXBuildFile section */ /* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */ /* Begin PBXCopyFilesBuildPhase section */
...@@ -23,9 +23,9 @@ ...@@ -23,9 +23,9 @@
/* End PBXCopyFilesBuildPhase section */ /* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */ /* Begin PBXFileReference section */
134814201AA4EA6300B7C361 /* libSmartNotifications.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libSmartNotifications.a; sourceTree = BUILT_PRODUCTS_DIR; }; 134814201AA4EA6300B7C361 /* libRNNotifications.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRNNotifications.a; sourceTree = BUILT_PRODUCTS_DIR; };
13BE3DEC1AC21097009241FE /* SmartNotifications.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SmartNotifications.h; sourceTree = "<group>"; }; D8A2F7541CB57F1A002CC8F5 /* RNNotifications.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNNotifications.m; sourceTree = "<group>"; };
13BE3DED1AC21097009241FE /* SmartNotifications.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SmartNotifications.m; sourceTree = "<group>"; }; D8A2F7561CB57F28002CC8F5 /* RNNotifications.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNNotifications.h; sourceTree = "<group>"; };
/* End PBXFileReference section */ /* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */ /* Begin PBXFrameworksBuildPhase section */
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
134814211AA4EA7D00B7C361 /* Products */ = { 134814211AA4EA7D00B7C361 /* Products */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
134814201AA4EA6300B7C361 /* libSmartNotifications.a */, 134814201AA4EA6300B7C361 /* libRNNotifications.a */,
); );
name = Products; name = Products;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -50,8 +50,8 @@ ...@@ -50,8 +50,8 @@
58B511D21A9E6C8500147676 = { 58B511D21A9E6C8500147676 = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
13BE3DEC1AC21097009241FE /* SmartNotifications.h */, D8A2F7561CB57F28002CC8F5 /* RNNotifications.h */,
13BE3DED1AC21097009241FE /* SmartNotifications.m */, D8A2F7541CB57F1A002CC8F5 /* RNNotifications.m */,
134814211AA4EA7D00B7C361 /* Products */, 134814211AA4EA7D00B7C361 /* Products */,
); );
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -59,9 +59,9 @@ ...@@ -59,9 +59,9 @@
/* End PBXGroup section */ /* End PBXGroup section */
/* Begin PBXNativeTarget section */ /* Begin PBXNativeTarget section */
58B511DA1A9E6C8500147676 /* SmartNotifications */ = { 58B511DA1A9E6C8500147676 /* RNNotifications */ = {
isa = PBXNativeTarget; isa = PBXNativeTarget;
buildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "SmartNotifications" */; buildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "RNNotifications" */;
buildPhases = ( buildPhases = (
58B511D71A9E6C8500147676 /* Sources */, 58B511D71A9E6C8500147676 /* Sources */,
58B511D81A9E6C8500147676 /* Frameworks */, 58B511D81A9E6C8500147676 /* Frameworks */,
...@@ -71,9 +71,9 @@ ...@@ -71,9 +71,9 @@
); );
dependencies = ( dependencies = (
); );
name = SmartNotifications; name = RNNotifications;
productName = RCTDataManager; productName = RCTDataManager;
productReference = 134814201AA4EA6300B7C361 /* libSmartNotifications.a */; productReference = 134814201AA4EA6300B7C361 /* libRNNotifications.a */;
productType = "com.apple.product-type.library.static"; productType = "com.apple.product-type.library.static";
}; };
/* End PBXNativeTarget section */ /* End PBXNativeTarget section */
...@@ -90,7 +90,7 @@ ...@@ -90,7 +90,7 @@
}; };
}; };
}; };
buildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "SmartNotifications" */; buildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "RNNotifications" */;
compatibilityVersion = "Xcode 3.2"; compatibilityVersion = "Xcode 3.2";
developmentRegion = English; developmentRegion = English;
hasScannedForEncodings = 0; hasScannedForEncodings = 0;
...@@ -102,7 +102,7 @@ ...@@ -102,7 +102,7 @@
projectDirPath = ""; projectDirPath = "";
projectRoot = ""; projectRoot = "";
targets = ( targets = (
58B511DA1A9E6C8500147676 /* SmartNotifications */, 58B511DA1A9E6C8500147676 /* RNNotifications */,
); );
}; };
/* End PBXProject section */ /* End PBXProject section */
...@@ -112,7 +112,7 @@ ...@@ -112,7 +112,7 @@
isa = PBXSourcesBuildPhase; isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
13BE3DEE1AC21097009241FE /* SmartNotifications.m in Sources */, D8A2F7551CB57F1A002CC8F5 /* RNNotifications.m in Sources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
...@@ -204,7 +204,7 @@ ...@@ -204,7 +204,7 @@
); );
LIBRARY_SEARCH_PATHS = ""; LIBRARY_SEARCH_PATHS = "";
OTHER_LDFLAGS = "-ObjC"; OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = SmartNotifications; PRODUCT_NAME = RNNotifications;
SKIP_INSTALL = YES; SKIP_INSTALL = YES;
}; };
name = Debug; name = Debug;
...@@ -220,7 +220,7 @@ ...@@ -220,7 +220,7 @@
); );
LIBRARY_SEARCH_PATHS = ""; LIBRARY_SEARCH_PATHS = "";
OTHER_LDFLAGS = "-ObjC"; OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = SmartNotifications; PRODUCT_NAME = RNNotifications;
SKIP_INSTALL = YES; SKIP_INSTALL = YES;
}; };
name = Release; name = Release;
...@@ -228,7 +228,7 @@ ...@@ -228,7 +228,7 @@
/* End XCBuildConfiguration section */ /* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */ /* Begin XCConfigurationList section */
58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "SmartNotifications" */ = { 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "RNNotifications" */ = {
isa = XCConfigurationList; isa = XCConfigurationList;
buildConfigurations = ( buildConfigurations = (
58B511ED1A9E6C8500147676 /* Debug */, 58B511ED1A9E6C8500147676 /* Debug */,
...@@ -237,7 +237,7 @@ ...@@ -237,7 +237,7 @@
defaultConfigurationIsVisible = 0; defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release; defaultConfigurationName = Release;
}; };
58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "SmartNotifications" */ = { 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "RNNotifications" */ = {
isa = XCConfigurationList; isa = XCConfigurationList;
buildConfigurations = ( buildConfigurations = (
58B511F01A9E6C8500147676 /* Debug */, 58B511F01A9E6C8500147676 /* Debug */,
......
...@@ -81,7 +81,7 @@ android { ...@@ -81,7 +81,7 @@ android {
buildToolsVersion "23.0.1" buildToolsVersion "23.0.1"
defaultConfig { defaultConfig {
applicationId "com.smartnotificationsapp" applicationId "com.notifications-example-app"
minSdkVersion 16 minSdkVersion 16
targetSdkVersion 22 targetSdkVersion 22
versionCode 1 versionCode 1
......
...@@ -15,7 +15,7 @@ public class MainActivity extends ReactActivity { ...@@ -15,7 +15,7 @@ public class MainActivity extends ReactActivity {
*/ */
@Override @Override
protected String getMainComponentName() { protected String getMainComponentName() {
return "SmartNotificationsApp"; return "NotificationsExampleApp";
} }
/** /**
......
<resources> <resources>
<string name="app_name">SmartNotificationsApp</string> <string name="app_name">NotificationsExampleApp</string>
</resources> </resources>
rootProject.name = 'SmartNotificationsApp' rootProject.name = 'NotificationsExampleApp'
include ':app' include ':app'
...@@ -11,12 +11,12 @@ import React, { ...@@ -11,12 +11,12 @@ import React, {
View View
} from 'react-native'; } from 'react-native';
class SmartNotificationsApp extends Component { class NotificationsExampleApp extends Component {
render() { render() {
return ( return (
<View style={styles.container}> <View style={styles.container}>
<Text style={styles.welcome}> <Text style={styles.welcome}>
Welcome to React Native! Welcome to React Native Notifications Demo App!
</Text> </Text>
<Text style={styles.instructions}> <Text style={styles.instructions}>
To get started, edit index.android.js To get started, edit index.android.js
...@@ -48,4 +48,4 @@ const styles = StyleSheet.create({ ...@@ -48,4 +48,4 @@ const styles = StyleSheet.create({
}, },
}); });
AppRegistry.registerComponent('SmartNotificationsApp', () => SmartNotificationsApp); AppRegistry.registerComponent('NotificationsExampleApp', () => NotificationsExampleApp);
...@@ -12,17 +12,17 @@ import React, { ...@@ -12,17 +12,17 @@ import React, {
PushNotificationIOS PushNotificationIOS
} from 'react-native'; } from 'react-native';
import SmartNotificationsIOS from 'react-native-smart-notifications'; import NotificationsIOS from 'react-native-notifications';
class SmartNotificationsApp extends Component { class NotificationsExampleApp extends Component {
constructor() { constructor() {
super(); super();
PushNotificationIOS.addEventListener('register', this.onPushRegistered.bind(this)); PushNotificationIOS.addEventListener('register', this.onPushRegistered.bind(this));
// PushNotificationIOS.addEventListener('notification', this.onPushNotification.bind(this)); // PushNotificationIOS.addEventListener('notification', this.onPushNotification.bind(this));
SmartNotificationsIOS.addEventListener('notificationReceivedForeground', this.onNotificationReceivedForeground.bind(this)); NotificationsIOS.addEventListener('notificationReceivedForeground', this.onNotificationReceivedForeground.bind(this));
SmartNotificationsIOS.addEventListener('notificationReceivedBackground', this.onNotificationReceivedBackground.bind(this)); NotificationsIOS.addEventListener('notificationReceivedBackground', this.onNotificationReceivedBackground.bind(this));
SmartNotificationsIOS.addEventListener('notificationOpened', this.onNotificationOpened.bind(this)); NotificationsIOS.addEventListener('notificationOpened', this.onNotificationOpened.bind(this));
} }
onPushRegistered(deviceToken) { onPushRegistered(deviceToken) {
...@@ -51,7 +51,7 @@ class SmartNotificationsApp extends Component { ...@@ -51,7 +51,7 @@ class SmartNotificationsApp extends Component {
return ( return (
<View style={styles.container}> <View style={styles.container}>
<Text style={styles.welcome}> <Text style={styles.welcome}>
Welcome to Smart Notifications Demo App! Welcome to React Native Notifications Demo App!
</Text> </Text>
<Text style={styles.instructions}> <Text style={styles.instructions}>
To get started, edit index.ios.js To get started, edit index.ios.js
...@@ -65,9 +65,9 @@ class SmartNotificationsApp extends Component { ...@@ -65,9 +65,9 @@ class SmartNotificationsApp extends Component {
} }
componentWillUnmount() { componentWillUnmount() {
SmartNotificationsIOS.removeEventListener('notificationReceivedForeground', this.onNotificationReceivedForeground.bind(this)); NotificationsIOS.removeEventListener('notificationReceivedForeground', this.onNotificationReceivedForeground.bind(this));
SmartNotificationsIOS.removeEventListener('notificationReceivedBackground', this.onNotificationReceivedBackground.bind(this)); NotificationsIOS.removeEventListener('notificationReceivedBackground', this.onNotificationReceivedBackground.bind(this));
SmartNotificationsIOS.removeEventListener('notificationOpened', this.onNotificationOpened.bind(this)); NotificationsIOS.removeEventListener('notificationOpened', this.onNotificationOpened.bind(this));
} }
_onNotification(notification) { _onNotification(notification) {
...@@ -101,4 +101,4 @@ const styles = StyleSheet.create({ ...@@ -101,4 +101,4 @@ const styles = StyleSheet.create({
}, },
}); });
AppRegistry.registerComponent('SmartNotificationsApp', () => SmartNotificationsApp); AppRegistry.registerComponent('NotificationsExampleApp', () => NotificationsExampleApp);
...@@ -15,9 +15,9 @@ ...@@ -15,9 +15,9 @@
<BuildableReference <BuildableReference
BuildableIdentifier = "primary" BuildableIdentifier = "primary"
BlueprintIdentifier = "13B07F861A680F5B00A75B9A" BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
BuildableName = "SmartNotificationsApp.app" BuildableName = "NotificationsExampleApp.app"
BlueprintName = "SmartNotificationsApp" BlueprintName = "NotificationsExampleApp"
ReferencedContainer = "container:SmartNotificationsApp.xcodeproj"> ReferencedContainer = "container:NotificationsExampleApp.xcodeproj">
</BuildableReference> </BuildableReference>
</BuildActionEntry> </BuildActionEntry>
<BuildActionEntry <BuildActionEntry
...@@ -29,9 +29,9 @@ ...@@ -29,9 +29,9 @@
<BuildableReference <BuildableReference
BuildableIdentifier = "primary" BuildableIdentifier = "primary"
BlueprintIdentifier = "00E356ED1AD99517003FC87E" BlueprintIdentifier = "00E356ED1AD99517003FC87E"
BuildableName = "SmartNotificationsAppTests.xctest" BuildableName = "NotificationsExampleAppTests.xctest"
BlueprintName = "SmartNotificationsAppTests" BlueprintName = "NotificationsExampleAppTests"
ReferencedContainer = "container:SmartNotificationsApp.xcodeproj"> ReferencedContainer = "container:NotificationsExampleApp.xcodeproj">
</BuildableReference> </BuildableReference>
</BuildActionEntry> </BuildActionEntry>
</BuildActionEntries> </BuildActionEntries>
...@@ -47,9 +47,9 @@ ...@@ -47,9 +47,9 @@
<BuildableReference <BuildableReference
BuildableIdentifier = "primary" BuildableIdentifier = "primary"
BlueprintIdentifier = "00E356ED1AD99517003FC87E" BlueprintIdentifier = "00E356ED1AD99517003FC87E"
BuildableName = "SmartNotificationsAppTests.xctest" BuildableName = "NotificationsExampleAppTests.xctest"
BlueprintName = "SmartNotificationsAppTests" BlueprintName = "NotificationsExampleAppTests"
ReferencedContainer = "container:SmartNotificationsApp.xcodeproj"> ReferencedContainer = "container:NotificationsExampleApp.xcodeproj">
</BuildableReference> </BuildableReference>
</TestableReference> </TestableReference>
</Testables> </Testables>
...@@ -57,9 +57,9 @@ ...@@ -57,9 +57,9 @@
<BuildableReference <BuildableReference
BuildableIdentifier = "primary" BuildableIdentifier = "primary"
BlueprintIdentifier = "13B07F861A680F5B00A75B9A" BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
BuildableName = "SmartNotificationsApp.app" BuildableName = "NotificationsExampleApp.app"
BlueprintName = "SmartNotificationsApp" BlueprintName = "NotificationsExampleApp"
ReferencedContainer = "container:SmartNotificationsApp.xcodeproj"> ReferencedContainer = "container:NotificationsExampleApp.xcodeproj">
</BuildableReference> </BuildableReference>
</MacroExpansion> </MacroExpansion>
<AdditionalOptions> <AdditionalOptions>
...@@ -80,9 +80,9 @@ ...@@ -80,9 +80,9 @@
<BuildableReference <BuildableReference
BuildableIdentifier = "primary" BuildableIdentifier = "primary"
BlueprintIdentifier = "13B07F861A680F5B00A75B9A" BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
BuildableName = "SmartNotificationsApp.app" BuildableName = "NotificationsExampleApp.app"
BlueprintName = "SmartNotificationsApp" BlueprintName = "NotificationsExampleApp"
ReferencedContainer = "container:SmartNotificationsApp.xcodeproj"> ReferencedContainer = "container:NotificationsExampleApp.xcodeproj">
</BuildableReference> </BuildableReference>
</BuildableProductRunnable> </BuildableProductRunnable>
<AdditionalOptions> <AdditionalOptions>
...@@ -99,9 +99,9 @@ ...@@ -99,9 +99,9 @@
<BuildableReference <BuildableReference
BuildableIdentifier = "primary" BuildableIdentifier = "primary"
BlueprintIdentifier = "13B07F861A680F5B00A75B9A" BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
BuildableName = "SmartNotificationsApp.app" BuildableName = "NotificationsExampleApp.app"
BlueprintName = "SmartNotificationsApp" BlueprintName = "NotificationsExampleApp"
ReferencedContainer = "container:SmartNotificationsApp.xcodeproj"> ReferencedContainer = "container:NotificationsExampleApp.xcodeproj">
</BuildableReference> </BuildableReference>
</BuildableProductRunnable> </BuildableProductRunnable>
</ProfileAction> </ProfileAction>
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#import "AppDelegate.h" #import "AppDelegate.h"
#import "RCTPushNotificationManager.h" #import "RCTPushNotificationManager.h"
#import "RCTRootView.h" #import "RCTRootView.h"
#import "SmartNotifications.h" #import "RNNotifications.h"
@implementation AppDelegate @implementation AppDelegate
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
// jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; // jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
moduleName:@"SmartNotificationsApp" moduleName:@"NotificationsExampleApp"
initialProperties:nil initialProperties:nil
launchOptions:launchOptions]; launchOptions:launchOptions];
...@@ -72,13 +72,13 @@ ...@@ -72,13 +72,13 @@
// Required for the notification event. // Required for the notification event.
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)notification - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)notification
{ {
[SmartNotifications didReceiveRemoteNotification:notification]; [RNNotifications didReceiveRemoteNotification:notification];
} }
// Required for the localNotification event. // Required for the localNotification event.
- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification - (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification
{ {
[SmartNotifications didReceiveLocalNotification:notification]; [RNNotifications didReceiveLocalNotification:notification];
} }
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/> <color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="SmartNotificationsApp" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="kId-c2-rCX"> <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="NotificationsExampleApp" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="kId-c2-rCX">
<rect key="frame" x="20" y="140" width="441" height="43"/> <rect key="frame" x="20" y="140" width="441" height="43"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="36"/> <fontDescription key="fontDescription" type="boldSystem" pointSize="36"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/> <color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
......
...@@ -29,16 +29,16 @@ ...@@ -29,16 +29,16 @@
</dict> </dict>
<key>NSLocationWhenInUseUsageDescription</key> <key>NSLocationWhenInUseUsageDescription</key>
<string></string> <string></string>
<key>UIBackgroundModes</key>
<array>
<string>remote-notification</string>
</array>
<key>UILaunchStoryboardName</key> <key>UILaunchStoryboardName</key>
<string>LaunchScreen</string> <string>LaunchScreen</string>
<key>UIRequiredDeviceCapabilities</key> <key>UIRequiredDeviceCapabilities</key>
<array> <array>
<string>armv7</string> <string>armv7</string>
</array> </array>
<key>UIBackgroundModes</key>
<array>
<string>remote-notification</string>
</array>
<key>UISupportedInterfaceOrientations</key> <key>UISupportedInterfaceOrientations</key>
<array> <array>
<string>UIInterfaceOrientationPortrait</string> <string>UIInterfaceOrientationPortrait</string>
......
...@@ -16,11 +16,11 @@ ...@@ -16,11 +16,11 @@
#define TIMEOUT_SECONDS 240 #define TIMEOUT_SECONDS 240
#define TEXT_TO_LOOK_FOR @"Welcome to React Native!" #define TEXT_TO_LOOK_FOR @"Welcome to React Native!"
@interface SmartNotificationsAppTests : XCTestCase @interface NotificationsExampleAppTests : XCTestCase
@end @end
@implementation SmartNotificationsAppTests @implementation NotificationsExampleAppTests
- (BOOL)findSubviewInView:(UIView *)view matching:(BOOL(^)(UIView *view))test - (BOOL)findSubviewInView:(UIView *)view matching:(BOOL(^)(UIView *view))test
{ {
......
{ {
"name": "SmartNotificationsApp", "name": "NotificationsExampleApp",
"version": "0.0.1", "version": "0.0.1",
"private": true, "private": true,
"scripts": { "scripts": {
...@@ -8,6 +8,6 @@ ...@@ -8,6 +8,6 @@
"dependencies": { "dependencies": {
"react": "^0.14.7", "react": "^0.14.7",
"react-native": "^0.22.2", "react-native": "^0.22.2",
"react-native-smart-notifications": "../" "react-native-notifications": "../"
} }
} }
/** /**
* @providesModule SmartNotifications * @providesModule RNNotifications
* @flow * @flow
*/ */
'use strict'; 'use strict';
import { NativeModules, DeviceEventEmitter } from 'react-native'; import { NativeModules, DeviceEventEmitter } from 'react-native';
import Map from 'core-js/library/es6/map'; import Map from 'core-js/library/es6/map';
var NativeSmartNotifications = NativeModules.SmartNotifications; var NativeRNNotifications = NativeModules.RNNotifications;
var DEVICE_NOTIFICATION_RECEIVED_FOREGROUND_EVENT = 'notificationReceivedForeground'; var DEVICE_NOTIFICATION_RECEIVED_FOREGROUND_EVENT = 'notificationReceivedForeground';
var DEVICE_NOTIFICATION_RECEIVED_BACKGROUND_EVENT = 'notificationReceivedBackground'; var DEVICE_NOTIFICATION_RECEIVED_BACKGROUND_EVENT = 'notificationReceivedBackground';
...@@ -13,7 +13,7 @@ var DEVICE_NOTIFICATION_OPENED_EVENT = 'notificationOpened'; ...@@ -13,7 +13,7 @@ var DEVICE_NOTIFICATION_OPENED_EVENT = 'notificationOpened';
var _notificationHandlers = new Map(); var _notificationHandlers = new Map();
class SmartNotificationsIOS { class NotificationsIOS {
/** /**
* Attaches a listener to remote notification events while the app is running * Attaches a listener to remote notification events while the app is running
* in the foreground or the background. * in the foreground or the background.
...@@ -58,4 +58,4 @@ class SmartNotificationsIOS { ...@@ -58,4 +58,4 @@ class SmartNotificationsIOS {
} }
} }
module.exports = SmartNotificationsIOS; module.exports = NotificationsIOS;
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
"type": "git", "type": "git",
"url": "https://github.com/wix-private/react-native-notifications.git" "url": "https://github.com/wix-private/react-native-notifications.git"
}, },
"version": "0.0.1", "version": "0.0.2",
"description": "Advanced Push Notifications (Silent, interactive notifications) for iOS & Android", "description": "Advanced Push Notifications (Silent, interactive notifications) for iOS & Android",
"keywords": [ "keywords": [
"react-component", "react-component",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment