Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SRCT
whats-open-ios
Commits
6a26a4c8
Unverified
Commit
6a26a4c8
authored
Jan 27, 2019
by
Zach Knox
Browse files
got notifications good to go
and updated podfile
parent
a3235b5f
Changes
35
Expand all
Hide whitespace changes
Inline
Side-by-side
WhatsOpen/AlertNotificationExtention/Base.lproj/MainInterface.storyboard
View file @
6a26a4c8
<?xml version="1.0" encoding="UTF-8"?>
<document
type=
"com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB"
version=
"3.0"
toolsVersion=
"13122.16"
targetRuntime=
"iOS.CocoaTouch"
propertyAccessControl=
"none"
useAutolayout=
"YES"
useTraitCollections=
"YES"
useSafeAreas=
"YES"
colorMatched=
"YES"
initialViewController=
"M4Y-Lb-cyx"
>
<document
type=
"com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB"
version=
"3.0"
toolsVersion=
"14460.31"
targetRuntime=
"iOS.CocoaTouch"
propertyAccessControl=
"none"
useAutolayout=
"YES"
useTraitCollections=
"YES"
useSafeAreas=
"YES"
colorMatched=
"YES"
initialViewController=
"M4Y-Lb-cyx"
>
<device
id=
"retina4_7"
orientation=
"portrait"
>
<adaptation
id=
"fullscreen"
/>
</device>
<dependencies>
<plugIn
identifier=
"com.apple.InterfaceBuilder.IBCocoaTouchPlugin"
version=
"13104.12"
/>
<deployment
identifier=
"iOS"
/>
<plugIn
identifier=
"com.apple.InterfaceBuilder.IBCocoaTouchPlugin"
version=
"14460.20"
/>
<capability
name=
"Safe area layout guides"
minToolsVersion=
"9.0"
/>
<capability
name=
"documents saved in the Xcode 8 format"
minToolsVersion=
"8.0"
/>
</dependencies>
...
...
@@ -9,23 +13,24 @@
<!--Notification View Controller-->
<scene
sceneID=
"cwh-vc-ff4"
>
<objects>
<viewController
id=
"M4Y-Lb-cyx"
userLabel=
"Notification View Controller"
customClass=
"NotificationViewController"
customModuleProvider=
"target"
sceneMemberID=
"viewController"
>
<viewController
id=
"M4Y-Lb-cyx"
userLabel=
"Notification View Controller"
customClass=
"NotificationViewController"
customModule=
"AlertNotificationExtention"
customModuleProvider=
"target"
sceneMemberID=
"viewController"
>
<view
key=
"view"
contentMode=
"scaleToFill"
simulatedAppContext=
"notificationCenter"
id=
"S3S-Oj-5AN"
>
<rect
key=
"frame"
x=
"0.0"
y=
"0.0"
width=
"320"
height=
"37"
/>
<autoresizingMask
key=
"autoresizingMask"
widthSizable=
"YES"
heightSizable=
"YES"
/>
<subviews>
<label
opaque=
"NO"
clipsSubviews=
"YES"
userInteractionEnabled=
"NO"
contentMode=
"top"
horizontalHuggingPriority=
"251"
verticalHuggingPriority=
"251"
text=
"Hello World"
textAlignment=
"center"
lineBreakMode=
"tailTruncation"
numberOfLines=
"0"
baselineAdjustment=
"alignBaselines"
adjustsFontSizeToFit=
"NO"
preferredMaxLayoutWidth=
"280"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"GcN-lo-r42"
>
<fontDescription
key=
"fontDescription"
type=
"system"
pointSize=
"17"
/>
<color
key=
"textColor"
red=
"0.0"
green=
"0.0"
blue=
"0.0"
alpha=
"1"
colorSpace=
"custom"
customColorSpace=
"sRGB"
/>
<nil
key=
"highlightedColor"
/>
</label>
<containerView
opaque=
"NO"
contentMode=
"scaleToFill"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"1mD-z3-WYh"
>
<rect
key=
"frame"
x=
"0.0"
y=
"0.0"
width=
"320"
height=
"37"
/>
<connections>
<segue
destination=
"9W9-6Q-a2K"
kind=
"embed"
id=
"XVL-2A-S2F"
/>
</connections>
</containerView>
</subviews>
<color
key=
"backgroundColor"
red=
"0.45882353186607361"
green=
"0.74901962280273438"
blue=
"0.66666668653488159"
alpha=
"1"
colorSpace=
"custom"
customColorSpace=
"sRGB"
/>
<constraints>
<constraint
firstItem=
"
2BE-c3-nQJ
"
firstAttribute=
"
bottom
"
secondItem=
"
GcN-lo-r42
"
secondAttribute=
"
bottom"
constant=
"8"
symbolic=
"YES"
id=
"0Q0-KW-PJ6
"
/>
<constraint
firstItem=
"
GcN-lo-r42
"
firstAttribute=
"
leading
"
secondItem=
"2BE-c3-nQJ"
secondAttribute=
"
leading"
constant=
"20"
symbolic=
"YES"
id=
"6Vq-gs-PHe
"
/>
<constraint
firstItem=
"
2BE-c3-nQJ
"
firstAttribute=
"
trailing
"
secondItem=
"
GcN-lo-r42
"
secondAttribute=
"
trailing"
constant=
"20"
symbolic=
"YES"
id=
"L8K-9R-egU
"
/>
<constraint
firstItem=
"
GcN-lo-r42
"
firstAttribute=
"
top
"
secondItem=
"
2BE-c3-nQJ
"
secondAttribute=
"
top"
constant=
"8"
symbolic=
"YES"
id=
"mYS-Cv-VNx
"
/>
<constraint
firstItem=
"
1mD-z3-WYh
"
firstAttribute=
"
height
"
secondItem=
"
S3S-Oj-5AN
"
secondAttribute=
"
height"
id=
"Dmj-pC-GXQ
"
/>
<constraint
firstItem=
"
1mD-z3-WYh
"
firstAttribute=
"
centerX
"
secondItem=
"2BE-c3-nQJ"
secondAttribute=
"
centerX"
id=
"SNc-7e-O8z
"
/>
<constraint
firstItem=
"
1mD-z3-WYh
"
firstAttribute=
"
centerY
"
secondItem=
"
2BE-c3-nQJ
"
secondAttribute=
"
centerY"
id=
"dul-Ck-Oww
"
/>
<constraint
firstItem=
"
1mD-z3-WYh
"
firstAttribute=
"
width
"
secondItem=
"
S3S-Oj-5AN
"
secondAttribute=
"
width"
id=
"r24-qT-usG
"
/>
</constraints>
<viewLayoutGuide
key=
"safeArea"
id=
"2BE-c3-nQJ"
/>
</view>
...
...
@@ -33,11 +38,26 @@
<freeformSimulatedSizeMetrics
key=
"simulatedDestinationMetrics"
/>
<size
key=
"freeformSize"
width=
"320"
height=
"37"
/>
<connections>
<outlet
property=
"
label
"
destination=
"
GcN-lo-r42"
id=
"lpW-cU-7IG
"
/>
<outlet
property=
"
containerView
"
destination=
"
1mD-z3-WYh"
id=
"FhD-cv-isU
"
/>
</connections>
</viewController>
<placeholder
placeholderIdentifier=
"IBFirstResponder"
id=
"vXp-U4-Rya"
userLabel=
"First Responder"
sceneMemberID=
"firstResponder"
/>
</objects>
<point
key=
"canvasLocation"
x=
"41.600000000000001"
y=
"25.637181409295355"
/>
</scene>
<!--View Controller-->
<scene
sceneID=
"8Dg-Dp-Wr9"
>
<objects>
<viewController
id=
"9W9-6Q-a2K"
sceneMemberID=
"viewController"
>
<view
key=
"view"
contentMode=
"scaleToFill"
id=
"iRA-Nc-NVT"
>
<rect
key=
"frame"
x=
"0.0"
y=
"0.0"
width=
"320"
height=
"37"
/>
<autoresizingMask
key=
"autoresizingMask"
widthSizable=
"YES"
heightSizable=
"YES"
/>
<color
key=
"backgroundColor"
white=
"1"
alpha=
"1"
colorSpace=
"custom"
customColorSpace=
"genericGamma22GrayColorSpace"
/>
</view>
</viewController>
<placeholder
placeholderIdentifier=
"IBFirstResponder"
id=
"yGU-sF-ZdX"
userLabel=
"First Responder"
sceneMemberID=
"firstResponder"
/>
</objects>
<point
key=
"canvasLocation"
x=
"42"
y=
"200"
/>
</scene>
</scenes>
</document>
WhatsOpen/AlertNotificationExtention/Info.plist
View file @
6a26a4c8
...
...
@@ -25,9 +25,11 @@
<key>
NSExtensionAttributes
</key>
<dict>
<key>
UNNotificationExtensionCategory
</key>
<string>
myNotificationCategor
y
</string>
<string>
alertNotif
y
</string>
<key>
UNNotificationExtensionInitialContentSizeRatio
</key>
<real>
1
</real>
<integer>
1
</integer>
<key>
UNNotificationExtensionDefaultContentHidden
</key>
<true/>
</dict>
<key>
NSExtensionMainStoryboard
</key>
<string>
MainInterface
</string>
...
...
WhatsOpen/AlertNotificationExtention/NotificationViewController.swift
View file @
6a26a4c8
...
...
@@ -10,17 +10,75 @@ import UIKit
import
UserNotifications
import
UserNotificationsUI
import
RealmSwift
import
WhatsOpenKit
class
NotificationViewController
:
UIViewController
,
UNNotificationContentExtension
{
@IBOutlet
var
label
:
UILabel
?
override
func
viewDidLoad
()
{
@IBOutlet
var
containerView
:
UIView
!
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
// Do any required interface initialization here.
}
func
didReceive
(
_
notification
:
UNNotification
)
{
self
.
label
?
.
text
=
notification
.
request
.
content
.
body
let
realm
=
try!
Realm
(
configuration
:
WOPDatabaseController
.
getConfig
())
let
results
=
realm
.
objects
(
WOPFacilitiesModel
.
self
)
if
results
.
count
>
0
{
let
model
=
results
[
0
]
let
alerts
=
model
.
alerts
let
objs
=
alerts
.
filter
(
NSPredicate
(
format
:
"id =
\(
(
notification
.
request
.
content
.
userInfo
[
"alertID"
])
!
)
"
))
if
objs
.
count
>
0
{
let
alert
=
objs
.
first
let
storyboard
=
UIStoryboard
(
name
:
"WOPSharedUI"
,
bundle
:
Bundle
(
for
:
WOPAlertDetailViewController
.
self
))
let
detailVC
=
storyboard
.
instantiateViewController
(
withIdentifier
:
"detailView"
)
as!
WOPAlertDetailViewController
detailVC
.
alert
=
alert
self
.
addChild
(
detailVC
)
self
.
addSubview
(
detailVC
.
view
,
toView
:
containerView
)
//attachChild(detailVC)
}
else
{
return
}
}
else
{
return
}
}
func
addSubview
(
_
subView
:
UIView
,
toView
parentView
:
UIView
)
{
parentView
.
addSubview
(
subView
)
var
viewBindingsDict
=
[
String
:
AnyObject
]()
viewBindingsDict
[
"subView"
]
=
subView
parentView
.
addConstraints
(
NSLayoutConstraint
.
constraints
(
withVisualFormat
:
"H:|[subView]|"
,
options
:
[],
metrics
:
nil
,
views
:
viewBindingsDict
))
parentView
.
addConstraints
(
NSLayoutConstraint
.
constraints
(
withVisualFormat
:
"V:|[subView]|"
,
options
:
[],
metrics
:
nil
,
views
:
viewBindingsDict
))
}
// Taken from Apple's SoupChef sample code
private
func
attachChild
(
_
viewController
:
UIViewController
)
{
addChild
(
viewController
)
if
let
subview
=
viewController
.
view
{
view
.
addSubview
(
subview
)
subview
.
translatesAutoresizingMaskIntoConstraints
=
false
// Set the child controller's view to be the exact same size as the parent controller's view.
subview
.
widthAnchor
.
constraint
(
equalTo
:
view
.
widthAnchor
)
.
isActive
=
true
subview
.
heightAnchor
.
constraint
(
equalTo
:
view
.
heightAnchor
)
.
isActive
=
true
subview
.
centerXAnchor
.
constraint
(
equalTo
:
view
.
centerXAnchor
)
.
isActive
=
true
subview
.
centerYAnchor
.
constraint
(
equalTo
:
view
.
centerYAnchor
)
.
isActive
=
true
}
viewController
.
didMove
(
toParent
:
self
)
}
}
WhatsOpen/Podfile
View file @
6a26a4c8
...
...
@@ -47,6 +47,10 @@ target 'ShortcutsExtensionUI' do
important_pods
end
target
'AlertNotificationExtention'
do
important_pods
end
post_install
do
|
installer
|
installer
.
pods_project
.
targets
.
each
do
|
target
|
target
.
build_configurations
.
each
do
|
config
|
...
...
WhatsOpen/Podfile.lock
View file @
6a26a4c8
...
...
@@ -40,6 +40,6 @@ SPEC CHECKSUMS:
Realm: 50071da38fe079e0735e47c9f2eae738c68c5996
RealmSwift: 8a1e6a02b7a08cd17a31e3115143fb69fe5f3fb9
PODFILE CHECKSUM:
c2fa08440be1a2902ec4a3ed351464719891fc3a
PODFILE CHECKSUM:
0589552d0fa556d4bb7ac2395184d9884a95f850
COCOAPODS: 1.6.0.beta.2
WhatsOpen/Pods/Manifest.lock
View file @
6a26a4c8
...
...
@@ -40,6 +40,6 @@ SPEC CHECKSUMS:
Realm: 50071da38fe079e0735e47c9f2eae738c68c5996
RealmSwift: 8a1e6a02b7a08cd17a31e3115143fb69fe5f3fb9
PODFILE CHECKSUM:
c2fa08440be1a2902ec4a3ed351464719891fc3a
PODFILE CHECKSUM:
0589552d0fa556d4bb7ac2395184d9884a95f850
COCOAPODS: 1.6.0.beta.2
WhatsOpen/Pods/Pods.xcodeproj/project.pbxproj
View file @
6a26a4c8
This diff is collapsed.
Click to expand it.
WhatsOpen/Pods/Target Support Files/Crashlytics/Info.plist
View file @
6a26a4c8
...
...
@@ -5,6 +5,7 @@
<key>
UIRequiredDeviceCapabilities
</key>
<array>
<string>
arm64
</string>
<string>
arm64
</string>
</array>
</dict>
</plist>
WhatsOpen/Pods/Target Support Files/DeckTransition/Info.plist
View file @
6a26a4c8
...
...
@@ -26,6 +26,7 @@
<array>
<string>
arm64
</string>
<string>
arm64
</string>
<string>
arm64
</string>
</array>
</dict>
</plist>
WhatsOpen/Pods/Target Support Files/Fabric/Info.plist
View file @
6a26a4c8
...
...
@@ -5,6 +5,7 @@
<key>
UIRequiredDeviceCapabilities
</key>
<array>
<string>
arm64
</string>
<string>
arm64
</string>
</array>
</dict>
</plist>
WhatsOpen/Pods/Target Support Files/ObjectMapper+Realm/Info.plist
View file @
6a26a4c8
...
...
@@ -26,6 +26,7 @@
<array>
<string>
arm64
</string>
<string>
arm64
</string>
<string>
arm64
</string>
</array>
</dict>
</plist>
WhatsOpen/Pods/Target Support Files/ObjectMapper/Info.plist
View file @
6a26a4c8
...
...
@@ -26,6 +26,7 @@
<array>
<string>
arm64
</string>
<string>
arm64
</string>
<string>
arm64
</string>
</array>
</dict>
</plist>
WhatsOpen/Pods/Target Support Files/Pods-AlertNotificationExtention/Info.plist
0 → 100644
View file @
6a26a4c8
<?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>
UIRequiredDeviceCapabilities
</key>
<array>
<string>
arm64
</string>
</array>
</dict>
</plist>
WhatsOpen/Pods/Target Support Files/Pods-AlertNotificationExtention/Pods-AlertNotificationExtention-Info.plist
0 → 100644
View file @
6a26a4c8
<?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>
CFBundleDevelopmentRegion
</key>
<string>
en
</string>
<key>
CFBundleExecutable
</key>
<string>
${EXECUTABLE_NAME}
</string>
<key>
CFBundleIdentifier
</key>
<string>
${PRODUCT_BUNDLE_IDENTIFIER}
</string>
<key>
CFBundleInfoDictionaryVersion
</key>
<string>
6.0
</string>
<key>
CFBundleName
</key>
<string>
${PRODUCT_NAME}
</string>
<key>
CFBundlePackageType
</key>
<string>
FMWK
</string>
<key>
CFBundleShortVersionString
</key>
<string>
1.0.0
</string>
<key>
CFBundleSignature
</key>
<string>
????
</string>
<key>
CFBundleVersion
</key>
<string>
${CURRENT_PROJECT_VERSION}
</string>
<key>
NSPrincipalClass
</key>
<string></string>
</dict>
</plist>
WhatsOpen/Pods/Target Support Files/Pods-AlertNotificationExtention/Pods-AlertNotificationExtention-acknowledgements.markdown
0 → 100644
View file @
6a26a4c8
This diff is collapsed.
Click to expand it.
WhatsOpen/Pods/Target Support Files/Pods-AlertNotificationExtention/Pods-AlertNotificationExtention-acknowledgements.plist
0 → 100644
View file @
6a26a4c8
This diff is collapsed.
Click to expand it.
WhatsOpen/Pods/Target Support Files/Pods-AlertNotificationExtention/Pods-AlertNotificationExtention-dummy.m
0 → 100644
View file @
6a26a4c8
#import <Foundation/Foundation.h>
@interface
PodsDummy_Pods_AlertNotificationExtention
:
NSObject
@end
@implementation
PodsDummy_Pods_AlertNotificationExtention
@end
WhatsOpen/Pods/Target Support Files/Pods-AlertNotificationExtention/Pods-AlertNotificationExtention-umbrella.h
0 → 100644
View file @
6a26a4c8
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#else
#ifndef FOUNDATION_EXPORT
#if defined(__cplusplus)
#define FOUNDATION_EXPORT extern "C"
#else
#define FOUNDATION_EXPORT extern
#endif
#endif
#endif
FOUNDATION_EXPORT
double
Pods_AlertNotificationExtentionVersionNumber
;
FOUNDATION_EXPORT
const
unsigned
char
Pods_AlertNotificationExtentionVersionString
[];
WhatsOpen/Pods/Target Support Files/Pods-AlertNotificationExtention/Pods-AlertNotificationExtention.app store.xcconfig
0 → 100644
View file @
6a26a4c8
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/ObjectMapper" "${PODS_CONFIGURATION_BUILD_DIR}/ObjectMapper+Realm" "${PODS_CONFIGURATION_BUILD_DIR}/Realm" "${PODS_CONFIGURATION_BUILD_DIR}/RealmSwift"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/ObjectMapper+Realm/ObjectMapper_Realm.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/ObjectMapper/ObjectMapper.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/Realm/Realm.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/RealmSwift/RealmSwift.framework/Headers"
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' '@executable_path/../../Frameworks'
LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Realm/core"
OTHER_LDFLAGS = $(inherited) -ObjC -l"c++" -l"realmcore-ios" -l"z" -framework "ObjectMapper" -framework "ObjectMapper_Realm" -framework "Realm" -framework "RealmSwift" -framework "Security"
OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS
PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
PODS_ROOT = ${SRCROOT}/Pods
WhatsOpen/Pods/Target Support Files/Pods-AlertNotificationExtention/Pods-AlertNotificationExtention.debug.xcconfig
0 → 100644
View file @
6a26a4c8
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/ObjectMapper" "${PODS_CONFIGURATION_BUILD_DIR}/ObjectMapper+Realm" "${PODS_CONFIGURATION_BUILD_DIR}/Realm" "${PODS_CONFIGURATION_BUILD_DIR}/RealmSwift"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/ObjectMapper+Realm/ObjectMapper_Realm.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/ObjectMapper/ObjectMapper.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/Realm/Realm.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/RealmSwift/RealmSwift.framework/Headers"
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' '@executable_path/../../Frameworks'
LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Realm/core"
OTHER_LDFLAGS = $(inherited) -ObjC -l"c++" -l"realmcore-ios" -l"z" -framework "ObjectMapper" -framework "ObjectMapper_Realm" -framework "Realm" -framework "RealmSwift" -framework "Security"
OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS
PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
PODS_ROOT = ${SRCROOT}/Pods
Prev
1
2
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment