From 0059891009b6c27feaf61f38e2ba443b1304c4c9 Mon Sep 17 00:00:00 2001 From: Lidan Hifi Date: Wed, 6 Apr 2016 23:52:46 +0300 Subject: [PATCH] change package index file, fix example app --- example/index.ios.js | 6 +----- .../ios/NotificationsExampleApp.xcodeproj/project.pbxproj | 8 ++++---- example/ios/NotificationsExampleApp/AppDelegate.m | 2 +- package.json | 6 +++--- 4 files changed, 9 insertions(+), 13 deletions(-) diff --git a/example/index.ios.js b/example/index.ios.js index ed540fc..38afc94 100644 --- a/example/index.ios.js +++ b/example/index.ios.js @@ -19,7 +19,7 @@ class NotificationsExampleApp extends Component { constructor() { super(); PushNotificationIOS.addEventListener('register', this.onPushRegistered.bind(this)); - // PushNotificationIOS.addEventListener('notification', this.onPushNotification.bind(this)); + NotificationsIOS.addEventListener('notificationReceivedForeground', this.onNotificationReceivedForeground.bind(this)); NotificationsIOS.addEventListener('notificationReceivedBackground', this.onNotificationReceivedBackground.bind(this)); NotificationsIOS.addEventListener('notificationOpened', this.onNotificationOpened.bind(this)); @@ -41,10 +41,6 @@ class NotificationsExampleApp extends Component { console.log("Notification Opened: " + JSON.stringify(notification)); } - onPushNotification(notification) { - console.log("Notification Received: " + JSON.stringify(notification)); - } - render() { PushNotificationIOS.requestPermissions(); diff --git a/example/ios/NotificationsExampleApp.xcodeproj/project.pbxproj b/example/ios/NotificationsExampleApp.xcodeproj/project.pbxproj index 936fe6c..6c548c4 100644 --- a/example/ios/NotificationsExampleApp.xcodeproj/project.pbxproj +++ b/example/ios/NotificationsExampleApp.xcodeproj/project.pbxproj @@ -12,13 +12,13 @@ 00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */; }; 00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */; }; 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */; }; - 00E356F31AD99517003FC87E /* NotificationsExampleAppTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* NotificationsExampleAppTests.m */; }; 133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 78C398B91ACF4ADC00677621 /* libRCTLinking.a */; }; 139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */; }; 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */; }; 146834051AC3E58100842450 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; }; 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; }; D86588561CA2F4EF0076A9C8 /* libRCTPushNotification.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D86588551CA2F49C0076A9C8 /* libRCTPushNotification.a */; }; + D892FB7C1CB5AD7600B2CCF9 /* SmartNotificationsAppTests.m in Sources */ = {isa = PBXBuildFile; fileRef = D892FB7B1CB5AD7600B2CCF9 /* SmartNotificationsAppTests.m */; }; D89EF3AC1CB586FE0029DCD6 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = D89EF3A71CB586FE0029DCD6 /* AppDelegate.m */; }; D89EF3AD1CB586FE0029DCD6 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = D89EF3A91CB586FE0029DCD6 /* Images.xcassets */; }; D89EF3AE1CB586FE0029DCD6 /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = D89EF3AA1CB586FE0029DCD6 /* Info.plist */; }; @@ -129,7 +129,6 @@ 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTVibration.xcodeproj; path = "../node_modules/react-native/Libraries/Vibration/RCTVibration.xcodeproj"; sourceTree = ""; }; 00E356EE1AD99517003FC87E /* NotificationsExampleAppTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = NotificationsExampleAppTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 00E356F21AD99517003FC87E /* NotificationsExampleAppTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = NotificationsExampleAppTests.m; sourceTree = ""; }; 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTSettings.xcodeproj; path = "../node_modules/react-native/Libraries/Settings/RCTSettings.xcodeproj"; sourceTree = ""; }; 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTWebSocket.xcodeproj; path = "../node_modules/react-native/Libraries/WebSocket/RCTWebSocket.xcodeproj"; sourceTree = ""; }; 13B07F961A680F5B00A75B9A /* NotificationsExampleApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = NotificationsExampleApp.app; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -137,6 +136,7 @@ 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = "../node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj"; sourceTree = ""; }; 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "../node_modules/react-native/Libraries/Text/RCTText.xcodeproj"; sourceTree = ""; }; D86588501CA2F49C0076A9C8 /* RCTPushNotification.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTPushNotification.xcodeproj; path = "../node_modules/react-native/Libraries/PushNotificationIOS/RCTPushNotification.xcodeproj"; sourceTree = ""; }; + D892FB7B1CB5AD7600B2CCF9 /* SmartNotificationsAppTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SmartNotificationsAppTests.m; sourceTree = ""; }; D89EF3A71CB586FE0029DCD6 /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = NotificationsExampleApp/AppDelegate.m; sourceTree = ""; }; D89EF3A81CB586FE0029DCD6 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = NotificationsExampleApp/AppDelegate.h; sourceTree = ""; }; D89EF3A91CB586FE0029DCD6 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = NotificationsExampleApp/Images.xcassets; sourceTree = ""; }; @@ -219,7 +219,7 @@ 00E356EF1AD99517003FC87E /* NotificationsExampleAppTests */ = { isa = PBXGroup; children = ( - 00E356F21AD99517003FC87E /* NotificationsExampleAppTests.m */, + D892FB7B1CB5AD7600B2CCF9 /* SmartNotificationsAppTests.m */, 00E356F01AD99517003FC87E /* Supporting Files */, ); path = NotificationsExampleAppTests; @@ -602,7 +602,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 00E356F31AD99517003FC87E /* NotificationsExampleAppTests.m in Sources */, + D892FB7C1CB5AD7600B2CCF9 /* SmartNotificationsAppTests.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/example/ios/NotificationsExampleApp/AppDelegate.m b/example/ios/NotificationsExampleApp/AppDelegate.m index ee2ee6e..379709d 100644 --- a/example/ios/NotificationsExampleApp/AppDelegate.m +++ b/example/ios/NotificationsExampleApp/AppDelegate.m @@ -32,7 +32,7 @@ * on the same Wi-Fi network. */ - jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle?platform=ios&dev=true"]; + jsCodeLocation = [NSURL URLWithString:@"http://192.168.1.15:8081/index.ios.bundle?platform=ios&dev=true"]; /** * OPTION 2 diff --git a/package.json b/package.json index b46daec..c3fedec 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "type": "git", "url": "https://github.com/wix-private/react-native-notifications.git" }, - "version": "0.0.2", + "version": "0.0.3", "description": "Advanced Push Notifications (Silent, interactive notifications) for iOS & Android", "keywords": [ "react-component", @@ -26,7 +26,7 @@ "dependencies": { "core-js": "^1.0.0" }, - "author": "Lidan Hifi ", - "main": "index.js", + "author": "Lidan Hifi ", + "main": "index.ios.js", "license": "MIT" } -- 2.26.2