Skip to content

Commit

Permalink
fix build config for notification
Browse files Browse the repository at this point in the history
  • Loading branch information
kdnakt committed Mar 29, 2018
1 parent 7a99e47 commit e4ea06f
Show file tree
Hide file tree
Showing 6 changed files with 137 additions and 0 deletions.
4 changes: 4 additions & 0 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,10 @@ dependencies {
compile project(':react-native-background-timer')
compile project(':realm')
compile project(':react-native-vector-icons')
compile project(':react-native-push-notification')
compile project(':react-native-background-timer')
compile project(':realm')
compile project(':react-native-vector-icons')
compile project(':react-native-vector-icons')
compile project(':react-native-background-timer')
compile project(':react-native-vector-icons')
Expand Down
8 changes: 8 additions & 0 deletions android/app/src/main/java/com/plank/MainApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
import com.ocetnik.timer.BackgroundTimerPackage;
import io.realm.react.RealmReactPackage;
import com.oblador.vectoricons.VectorIconsPackage;
import com.dieam.reactnativepushnotification.ReactNativePushNotificationPackage;
import com.ocetnik.timer.BackgroundTimerPackage;
import io.realm.react.RealmReactPackage;
import com.oblador.vectoricons.VectorIconsPackage;
import com.oblador.vectoricons.VectorIconsPackage;
import com.ocetnik.timer.BackgroundTimerPackage;
import com.oblador.vectoricons.VectorIconsPackage;
Expand Down Expand Up @@ -39,6 +43,10 @@ protected List<ReactPackage> getPackages() {
new BackgroundTimerPackage(),
new RealmReactPackage(),
new VectorIconsPackage(),
new ReactNativePushNotificationPackage(),
new BackgroundTimerPackage(),
new RealmReactPackage(),
new VectorIconsPackage(),
new VectorIconsPackage(),
new BackgroundTimerPackage(),
new VectorIconsPackage(),
Expand Down
8 changes: 8 additions & 0 deletions android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ include ':realm'
project(':realm').projectDir = new File(rootProject.projectDir, '../node_modules/realm/android')
include ':react-native-vector-icons'
project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android')
include ':react-native-push-notification'
project(':react-native-push-notification').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-push-notification/android')
include ':react-native-background-timer'
project(':react-native-background-timer').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-background-timer/android')
include ':realm'
project(':realm').projectDir = new File(rootProject.projectDir, '../node_modules/realm/android')
include ':react-native-vector-icons'
project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android')
include ':react-native-vector-icons'
project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android')
include ':react-native-background-timer'
Expand Down
103 changes: 103 additions & 0 deletions ios/plank.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@
};
objectVersion = 46;
objects = {

/* Begin PBXBuildFile section */
00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */; };
00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */; };
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 /* plankTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* plankTests.m */; };
080B1244206D777700B295D3 /* libRCTPushNotification.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 080B122F206D76D400B295D3 /* libRCTPushNotification.a */; };
08851EE6AF8843049E5B9717 /* EvilIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = FDEE713AD7644EDB9B6CB7C5 /* EvilIcons.ttf */; };
08B8592E2041D81C009FB0B7 /* FontAwesome.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 08B859042041D81C009FB0B7 /* FontAwesome.ttf */; };
08B859B320446D9F009FB0B7 /* libRCTAnimation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E9157331DD0AC6500FF2AA8 /* libRCTAnimation.a */; };
Expand Down Expand Up @@ -98,6 +100,34 @@
remoteGlobalIDString = 13B07F861A680F5B00A75B9A;
remoteInfo = plank;
};
080B122E206D76D400B295D3 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 080B1229206D76D400B295D3 /* RCTPushNotification.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 134814201AA4EA6300B7C361;
remoteInfo = RCTPushNotification;
};
080B1230206D76D400B295D3 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 080B1229206D76D400B295D3 /* RCTPushNotification.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 3D05745F1DE6004600184BB4;
remoteInfo = "RCTPushNotification-tvOS";
};
080B1240206D776B00B295D3 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 080B123B206D776B00B295D3 /* RCTPushNotification.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 134814201AA4EA6300B7C361;
remoteInfo = RCTPushNotification;
};
080B1242206D776B00B295D3 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 080B123B206D776B00B295D3 /* RCTPushNotification.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 3D05745F1DE6004600184BB4;
remoteInfo = "RCTPushNotification-tvOS";
};
08B859692041DA1E009FB0B7 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = AADAC0A745034D8D80727EA1 /* RNVectorIcons.xcodeproj */;
Expand Down Expand Up @@ -383,6 +413,9 @@
00E356EE1AD99517003FC87E /* plankTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = plankTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
00E356F21AD99517003FC87E /* plankTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = plankTests.m; sourceTree = "<group>"; };
080B1228206D756D00B295D3 /* plank.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; name = plank.entitlements; path = plank/plank.entitlements; sourceTree = "<group>"; };
080B1229206D76D400B295D3 /* RCTPushNotification.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTPushNotification.xcodeproj; path = "../node_modules/react-native/Libraries/PushNotificationIOS/RCTPushNotification.xcodeproj"; sourceTree = "<group>"; };
080B123B206D776B00B295D3 /* RCTPushNotification.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTPushNotification.xcodeproj; path = "../node_modules/react-native/Libraries/PushNotificationIOS/RCTPushNotification.xcodeproj"; sourceTree = "<group>"; };
08B859042041D81C009FB0B7 /* FontAwesome.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = FontAwesome.ttf; path = "../node_modules/react-native-vector-icons/Fonts/FontAwesome.ttf"; sourceTree = "<group>"; };
08D30D2C203DD3D90004BAD9 /* ART.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = ART.xcodeproj; path = "../node_modules/react-native/Libraries/ART/ART.xcodeproj"; sourceTree = "<group>"; };
138F6F4F24244B96B95AF103 /* libc++.tbd */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = "libc++.tbd"; path = "usr/lib/libc++.tbd"; sourceTree = SDKROOT; };
Expand Down Expand Up @@ -435,6 +468,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
080B1244206D777700B295D3 /* libRCTPushNotification.a in Frameworks */,
08D30D35203DD41A0004BAD9 /* libART.a in Frameworks */,
ADBDB9381DFEBF1600ED6528 /* libRCTBlob.a in Frameworks */,
08B859B320446D9F009FB0B7 /* libRCTAnimation.a in Frameworks */,
Expand Down Expand Up @@ -540,6 +574,24 @@
name = "Supporting Files";
sourceTree = "<group>";
};
080B122A206D76D400B295D3 /* Products */ = {
isa = PBXGroup;
children = (
080B122F206D76D400B295D3 /* libRCTPushNotification.a */,
080B1231206D76D400B295D3 /* libRCTPushNotification-tvOS.a */,
);
name = Products;
sourceTree = "<group>";
};
080B123C206D776B00B295D3 /* Products */ = {
isa = PBXGroup;
children = (
080B1241206D776B00B295D3 /* libRCTPushNotification.a */,
080B1243206D776B00B295D3 /* libRCTPushNotification-tvOS.a */,
);
name = Products;
sourceTree = "<group>";
};
08B859662041DA1E009FB0B7 /* Products */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -607,6 +659,7 @@
13B07FAE1A68108700A75B9A /* plank */ = {
isa = PBXGroup;
children = (
080B1228206D756D00B295D3 /* plank.entitlements */,
008F07F21AC5B25A0029DE68 /* main.jsbundle */,
13B07FAF1A68108700A75B9A /* AppDelegate.h */,
13B07FB01A68108700A75B9A /* AppDelegate.m */,
Expand Down Expand Up @@ -644,6 +697,7 @@
2D16E6871FA4F8E400B85C8A /* Frameworks */ = {
isa = PBXGroup;
children = (
080B1229206D76D400B295D3 /* RCTPushNotification.xcodeproj */,
2D16E6891FA4F8E400B85C8A /* libReact.a */,
138F6F4F24244B96B95AF103 /* libc++.tbd */,
910BAD457A82493AB853FB49 /* libz.tbd */,
Expand Down Expand Up @@ -672,6 +726,7 @@
832341AE1AAA6A7D00B99B32 /* Libraries */ = {
isa = PBXGroup;
children = (
080B123B206D776B00B295D3 /* RCTPushNotification.xcodeproj */,
08D30D2C203DD3D90004BAD9 /* ART.xcodeproj */,
5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */,
146833FF1AC3E56700842450 /* React.xcodeproj */,
Expand Down Expand Up @@ -843,6 +898,14 @@
CreatedOnToolsVersion = 6.2;
TestTargetID = 13B07F861A680F5B00A75B9A;
};
13B07F861A680F5B00A75B9A = {
DevelopmentTeam = H73MKK7JRT;
SystemCapabilities = {
com.apple.Push = {
enabled = 1;
};
};
};
2D02E47A1E0B4A5D006451C7 = {
CreatedOnToolsVersion = 8.2.1;
ProvisioningStyle = Automatic;
Expand Down Expand Up @@ -898,6 +961,14 @@
ProductGroup = 00C302D41ABCB9D200DB3ED1 /* Products */;
ProjectRef = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */;
},
{
ProductGroup = 080B122A206D76D400B295D3 /* Products */;
ProjectRef = 080B1229206D76D400B295D3 /* RCTPushNotification.xcodeproj */;
},
{
ProductGroup = 080B123C206D776B00B295D3 /* Products */;
ProjectRef = 080B123B206D776B00B295D3 /* RCTPushNotification.xcodeproj */;
},
{
ProductGroup = 139105B71AF99BAD00B5F7CC /* Products */;
ProjectRef = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */;
Expand Down Expand Up @@ -977,6 +1048,34 @@
remoteRef = 00C302E31ABCB9EE00DB3ED1 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
080B122F206D76D400B295D3 /* libRCTPushNotification.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = libRCTPushNotification.a;
remoteRef = 080B122E206D76D400B295D3 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
080B1231206D76D400B295D3 /* libRCTPushNotification-tvOS.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = "libRCTPushNotification-tvOS.a";
remoteRef = 080B1230206D76D400B295D3 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
080B1241206D776B00B295D3 /* libRCTPushNotification.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = libRCTPushNotification.a;
remoteRef = 080B1240206D776B00B295D3 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
080B1243206D776B00B295D3 /* libRCTPushNotification-tvOS.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = "libRCTPushNotification-tvOS.a";
remoteRef = 080B1242206D776B00B295D3 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
08B8596A2041DA1E009FB0B7 /* libRNVectorIcons.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
Expand Down Expand Up @@ -1451,8 +1550,10 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = plank/plank.entitlements;
CURRENT_PROJECT_VERSION = 1;
DEAD_CODE_STRIPPING = NO;
DEVELOPMENT_TEAM = H73MKK7JRT;
HEADER_SEARCH_PATHS = (
"$(inherited)",
"$(SRCROOT)/../node_modules/react-native-background-timer/ios",
Expand All @@ -1476,7 +1577,9 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = plank/plank.entitlements;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = H73MKK7JRT;
HEADER_SEARCH_PATHS = (
"$(inherited)",
"$(SRCROOT)/../node_modules/react-native-background-timer/ios",
Expand Down
8 changes: 8 additions & 0 deletions ios/plank/plank.entitlements
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>aps-environment</key>
<string>development</string>
</dict>
</plist>
6 changes: 6 additions & 0 deletions src/TimerScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ import {
formatTime,
formatDate,
} from './util/Utils';
import PushNotification from 'react-native-push-notification';
import NativeEventEmitter from 'NativeEventEmitter';

class TimerScreen extends Component {

Expand Down Expand Up @@ -76,6 +78,10 @@ class TimerScreen extends Component {
this.updateTargetTime();
this.resetStopwatch();
});
PushNotification.localNotificationSchedule({
message: "My Notification Message", // (required)
date: new Date(Date.now() + (60 * 1000)) // in 60 secs
});
}

updateTargetTime() {
Expand Down

0 comments on commit e4ea06f

Please sign in to comment.