Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
1
1weather
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dmitriy Stepanets
1weather
Commits
1155d35a
Commit
1155d35a
authored
Apr 28, 2021
by
Demid Merzlyakov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NotificationExtension code and entitlements.
parent
bac388fa
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
6 deletions
+22
-6
1Weather.xcodeproj/project.pbxproj
+4
-0
OneWeatherNotificationServiceExtension/NotificationService.swift
+5
-6
OneWeatherNotificationServiceExtension/OneWeatherNotificationServiceExtension.entitlements
+13
-0
No files found.
1Weather.xcodeproj/project.pbxproj
View file @
1155d35a
...
...
@@ -526,6 +526,7 @@
CE849DB52638C33600DEFFBD
/* OneWeatherNotificationServiceExtension.appex */
=
{
isa
=
PBXFileReference
;
explicitFileType
=
"wrapper.app-extension"
;
includeInIndex
=
0
;
path
=
OneWeatherNotificationServiceExtension.appex
;
sourceTree
=
BUILT_PRODUCTS_DIR
;
};
CE849DB72638C33600DEFFBD
/* NotificationService.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
NotificationService.swift
;
sourceTree
=
"<group>"
;
};
CE849DB92638C33600DEFFBD
/* Info.plist */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
text.plist.xml
;
path
=
Info.plist
;
sourceTree
=
"<group>"
;
};
CE849DE82638C59800DEFFBD
/* OneWeatherNotificationServiceExtension.entitlements */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
text.plist.entitlements
;
path
=
OneWeatherNotificationServiceExtension.entitlements
;
sourceTree
=
"<group>"
;
};
CE89628B26175D8D00CA274A
/* regenerate_objects.sh */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
text.script.sh
;
path
=
regenerate_objects.sh
;
sourceTree
=
"<group>"
;
};
CE89629126175DF400CA274A
/* _CoreAirQuality.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
_CoreAirQuality.swift
;
sourceTree
=
"<group>"
;
};
CE89629326175DF400CA274A
/* _CorePollutant.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
_CorePollutant.swift
;
sourceTree
=
"<group>"
;
};
...
...
@@ -1369,6 +1370,7 @@
CE849DB62638C33600DEFFBD
/* OneWeatherNotificationServiceExtension */
=
{
isa
=
PBXGroup
;
children
=
(
CE849DE82638C59800DEFFBD
/* OneWeatherNotificationServiceExtension.entitlements */
,
CE849DB72638C33600DEFFBD
/* NotificationService.swift */
,
CE849DB92638C33600DEFFBD
/* Info.plist */
,
);
...
...
@@ -2279,6 +2281,7 @@
isa
=
XCBuildConfiguration
;
baseConfigurationReference
=
7082B26061BEBA910124DD8A
/* Pods-OneWeatherNotificationServiceExtension.debug.xcconfig */
;
buildSettings
=
{
CODE_SIGN_ENTITLEMENTS
=
OneWeatherNotificationServiceExtension/OneWeatherNotificationServiceExtension.entitlements
;
CODE_SIGN_STYLE
=
Automatic
;
DEVELOPMENT_TEAM
=
24W4XMQ38L
;
INFOPLIST_FILE
=
OneWeatherNotificationServiceExtension/Info.plist
;
...
...
@@ -2300,6 +2303,7 @@
isa
=
XCBuildConfiguration
;
baseConfigurationReference
=
FD761FE0D947B3A79121A941
/* Pods-OneWeatherNotificationServiceExtension.release.xcconfig */
;
buildSettings
=
{
CODE_SIGN_ENTITLEMENTS
=
OneWeatherNotificationServiceExtension/OneWeatherNotificationServiceExtension.entitlements
;
CODE_SIGN_STYLE
=
Automatic
;
DEVELOPMENT_TEAM
=
24W4XMQ38L
;
INFOPLIST_FILE
=
OneWeatherNotificationServiceExtension/Info.plist
;
...
...
OneWeatherNotificationServiceExtension/NotificationService.swift
View file @
1155d35a
...
...
@@ -6,6 +6,7 @@
//
import
UserNotifications
import
MORichNotification
class
NotificationService
:
UNNotificationServiceExtension
{
...
...
@@ -13,15 +14,13 @@ class NotificationService: UNNotificationServiceExtension {
var
bestAttemptContent
:
UNMutableNotificationContent
?
override
func
didReceive
(
_
request
:
UNNotificationRequest
,
withContentHandler
contentHandler
:
@escaping
(
UNNotificationContent
)
->
Void
)
{
MORichNotification
.
setAppGroupID
(
"group.com.onelouder.oneweather.MoEngage"
)
self
.
contentHandler
=
contentHandler
bestAttemptContent
=
(
request
.
content
.
mutableCopy
()
as?
UNMutableNotificationContent
)
if
let
bestAttemptContent
=
bestAttemptContent
{
// Modify the notification content here...
bestAttemptContent
.
title
=
"
\(
bestAttemptContent
.
title
)
[modified]"
contentHandler
(
bestAttemptContent
)
}
MORichNotification
.
handle
(
request
,
withContentHandler
:
contentHandler
)
}
override
func
serviceExtensionTimeWillExpire
()
{
...
...
OneWeatherNotificationServiceExtension/OneWeatherNotificationServiceExtension.entitlements
0 → 100644
View file @
1155d35a
<?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>
<key>
com.apple.security.application-groups
</key>
<array>
<string>
group.com.onelouder.oneweather.MoEngage
</string>
<string>
group.com.onelouder.oneweather
</string>
</array>
</dict>
</plist>
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