Updated `setPusher` function (#684)
* updated set_pusher function from the SDK * this fixes a crash and allows for the navigation to work by using the threadIdentifier of the notification * adding NCE target * project setup completed with xcodegen * no need for those ugly storyboards * code improvement * removing unused outlet * mocks generated with the comment instead of the marker protocol * updated stencil * fixed unit tests * updated swiftformat * pr commentspull/706/head
parent
701581f4a1
commit
7544619a55
@ -0,0 +1,30 @@
|
||||
//
|
||||
// Copyright 2023 New Vector Ltd
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
import UserNotifications
|
||||
import UserNotificationsUI
|
||||
|
||||
class NotificationViewController: UIViewController, UNNotificationContentExtension {
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
// Do any required interface initialization here.
|
||||
}
|
||||
|
||||
func didReceive(_ notification: UNNotification) {
|
||||
// Handle the received push notification
|
||||
}
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
<?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>$(DEVELOPMENT_LANGUAGE)</string>
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string>$(PRODUCT_NAME)</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>XPC!</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>$(MARKETING_VERSION)</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>$(CURRENT_PROJECT_VERSION)</string>
|
||||
<key>NSExtension</key>
|
||||
<dict>
|
||||
<key>NSExtensionAttributes</key>
|
||||
<dict>
|
||||
<key>UNNotificationExtensionCategory</key>
|
||||
<string>myNotificationCategory</string>
|
||||
<key>UNNotificationExtensionInitialContentSizeRatio</key>
|
||||
<integer>1</integer>
|
||||
</dict>
|
||||
<key>NSExtensionPointIdentifier</key>
|
||||
<string>com.apple.usernotifications.content-extension</string>
|
||||
<key>NSExtensionPrincipalClass</key>
|
||||
<string>NCE.NotificationViewController</string>
|
||||
</dict>
|
||||
<key>appGroupIdentifier</key>
|
||||
<string>$(APP_GROUP_IDENTIFIER)</string>
|
||||
<key>baseBundleIdentifier</key>
|
||||
<string>$(BASE_BUNDLE_IDENTIFIER)</string>
|
||||
<key>keychainAccessGroupIdentifier</key>
|
||||
<string>$(KEYCHAIN_ACCESS_GROUP_IDENTIFIER)</string>
|
||||
</dict>
|
||||
</plist>
|
@ -0,0 +1,66 @@
|
||||
name: NCE
|
||||
|
||||
schemes:
|
||||
NCE:
|
||||
analyze:
|
||||
config: Debug
|
||||
archive:
|
||||
config: Release
|
||||
build:
|
||||
targets:
|
||||
NCE:
|
||||
- running
|
||||
- testing
|
||||
- profiling
|
||||
- analyzing
|
||||
- archiving
|
||||
profile:
|
||||
config: Release
|
||||
run:
|
||||
askForAppToLaunch: true
|
||||
config: Debug
|
||||
debugEnabled: false
|
||||
disableMainThreadChecker: false
|
||||
launchAutomaticallySubstyle: 2
|
||||
test:
|
||||
config: Debug
|
||||
disableMainThreadChecker: false
|
||||
|
||||
targets:
|
||||
NCE:
|
||||
type: app-extension
|
||||
platform: iOS
|
||||
|
||||
dependencies:
|
||||
- package: MatrixRustSDK
|
||||
|
||||
info:
|
||||
path: ../SupportingFiles/Info.plist
|
||||
properties:
|
||||
CFBundleDisplayName: $(PRODUCT_NAME)
|
||||
CFBundleShortVersionString: $(MARKETING_VERSION)
|
||||
CFBundleVersion: $(CURRENT_PROJECT_VERSION)
|
||||
appGroupIdentifier: $(APP_GROUP_IDENTIFIER)
|
||||
baseBundleIdentifier: $(BASE_BUNDLE_IDENTIFIER)
|
||||
keychainAccessGroupIdentifier: $(KEYCHAIN_ACCESS_GROUP_IDENTIFIER)
|
||||
NSExtension:
|
||||
NSExtensionPointIdentifier: com.apple.usernotifications.content-extension
|
||||
NSExtensionPrincipalClass: NCE.NotificationViewController
|
||||
NSExtensionAttributes:
|
||||
UNNotificationExtensionCategory: myNotificationCategory
|
||||
UNNotificationExtensionInitialContentSizeRatio: 1
|
||||
|
||||
settings:
|
||||
base:
|
||||
PRODUCT_NAME: NCE
|
||||
PRODUCT_BUNDLE_IDENTIFIER: ${BASE_BUNDLE_IDENTIFIER}.nce
|
||||
MARKETING_VERSION: $(MARKETING_VERSION)
|
||||
CURRENT_PROJECT_VERSION: $(CURRENT_PROJECT_VERSION)
|
||||
DEVELOPMENT_TEAM: $(DEVELOPMENT_TEAM)
|
||||
SWIFT_OBJC_INTERFACE_HEADER_NAME: GeneratedInterface-Swift.h
|
||||
debug:
|
||||
release:
|
||||
|
||||
sources:
|
||||
- path: ../Sources
|
||||
- path: ../SupportingFiles
|
Loading…
Reference in New Issue