Skip to content

Commit f8693fb

Browse files
committed
add sample for widgets, widgets control and live activities
1 parent d68023b commit f8693fb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+1624
-33
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ xcode-ci:
190190
xcodegen --spec Samples/iOS-Swift/iOS-Swift.yml
191191
xcodegen --spec Samples/iOS-Swift6/iOS-Swift6.yml
192192
xcodegen --spec Samples/iOS-SwiftUI/iOS-SwiftUI.yml
193+
xcodegen --spec Samples/iOS-SwiftUI-Widgets/iOS-SwiftUI-Widgets.yml
193194
xcodegen --spec Samples/iOS15-SwiftUI/iOS15-SwiftUI.yml
194195
xcodegen --spec Samples/macOS-SwiftUI/macOS-SwiftUI.yml
195196
xcodegen --spec Samples/macOS-Swift/macOS-Swift.yml

Samples/iOS-Swift/iOS-Swift.yml

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ targets:
3434
- target: iOS-SwiftClip
3535
- target: SentrySampleShared/SentrySampleShared
3636
- target: iOS-Swift-ShareExtension
37-
- target: iOS-Swift-WidgetExtension
3837
- target: Sentry/SentrySwiftLog
3938
configFiles:
4039
Debug: iOS-Swift.xcconfig
@@ -110,19 +109,6 @@ targets:
110109
Release: iOS-Swift-ShareExtension.xcconfig
111110
Test: iOS-Swift-ShareExtension.xcconfig
112111
TestCI: iOS-Swift-ShareExtension.xcconfig
113-
iOS-Swift-WidgetExtension:
114-
type: app-extension
115-
platform: auto
116-
sources:
117-
- iOS-Swift-Widget
118-
dependencies:
119-
- target: Sentry/Sentry
120-
- target: SentrySampleShared/SentrySampleShared
121-
configFiles:
122-
Debug: iOS-Swift-WidgetExtension.xcconfig
123-
Release: iOS-Swift-WidgetExtension.xcconfig
124-
Test: iOS-Swift-WidgetExtension.xcconfig
125-
TestCI: iOS-Swift-WidgetExtension.xcconfig
126112
schemes:
127113
iOS-Swift:
128114
templates:
@@ -143,22 +129,3 @@ schemes:
143129
config: Debug
144130
testPlans:
145131
- path: ../../Plans/iOS-Benchmarking_Base.xctestplan
146-
iOS-Swift-WidgetExtension:
147-
build:
148-
targets:
149-
iOS-Swift: all
150-
iOS-Swift-WidgetExtension: all
151-
run:
152-
config: Debug
153-
askForAppToLaunch: true
154-
launchAutomaticallySubstyle: 2
155-
executable: iOS-Swift
156-
debugEnabled: false
157-
environmentVariables:
158-
_XCWidgetKind: io.sentry.sample.iOS-Swift.iOS-Swift-Widget
159-
_XCWidgetDefaultView: timeline
160-
_XCWidgetFamily: systemMedium
161-
profile:
162-
config: Release
163-
askForAppToLaunch: true
164-
executable: iOS-Swift
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import Foundation
2+
3+
#if canImport(ActivityKit)
4+
5+
import ActivityKit
6+
7+
struct LiveActivityAttributes: ActivityAttributes {
8+
struct ContentState: Codable & Hashable {
9+
let anrTrackingStatus: String // "Enabled" or "Disabled"
10+
let timestamp: Date
11+
}
12+
13+
let id: String
14+
}
15+
16+
#endif
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#import <Foundation/Foundation.h>
2+
#import <UIKit/UIKit.h>
3+
4+
NS_ASSUME_NONNULL_BEGIN
5+
6+
@interface SentryHubInternal : NSObject
7+
8+
- (NSArray<NSString *> *)trimmedInstalledIntegrationNames;
9+
10+
@end
11+
12+
@interface SentrySDKInternal : NSObject
13+
14+
//+ (SentryHubInternal *)currentHub;
15+
16+
+ (NSArray<NSString *> *)trimmedInstalledIntegrationNames;
17+
18+
@end
19+
20+
NS_ASSUME_NONNULL_END
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#import "SentryExposure.h"
2+
#import <Sentry/PrivateSentrySDKOnly.h>
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#include "../Shared/Config/_Common.xcconfig"
2+
3+
PRODUCT_BUNDLE_IDENTIFIER = io.sentry.sentry-cocoa.samples.iOS-SwiftUI-Widgets.Widget
4+
INFOPLIST_FILE = iOS-SwiftUI-Widgets-WidgetExtension/Resources/Info.plist
5+
6+
GENERATE_INFOPLIST_FILE = NO
7+
8+
IPHONEOS_DEPLOYMENT_TARGET = 18.0
9+
TARGETED_DEVICE_FAMILY = 1,2
10+
11+
SKIP_INSTALL = YES
12+
SWIFT_EMIT_LOC_STRINGS = YES
13+
14+
CODE_SIGN_STYLE = Manual
15+
16+
SWIFT_OBJC_BRIDGING_HEADER = Shared/Headers/iOS-Swift-Widget-Bridging-Header.h
17+
18+
SUPPORTED_PLATFORMS = iphoneos iphonesimulator
19+
SUPPORTS_MACCATALYST = NO
20+
21+
ENABLE_USER_SCRIPT_SANDBOXING = YES
22+
23+
// Asset Catalog
24+
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES
25+
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor
26+
ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME = WidgetBackground
27+
28+
// Swift Settings
29+
SWIFT_VERSION = 5.0
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"colors": [
3+
{
4+
"idiom": "universal"
5+
}
6+
],
7+
"info": {
8+
"author": "xcode",
9+
"version": 1
10+
}
11+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"images": [
3+
{
4+
"idiom": "universal",
5+
"platform": "ios",
6+
"size": "1024x1024"
7+
},
8+
{
9+
"appearances": [
10+
{
11+
"appearance": "luminosity",
12+
"value": "dark"
13+
}
14+
],
15+
"idiom": "universal",
16+
"platform": "ios",
17+
"size": "1024x1024"
18+
},
19+
{
20+
"appearances": [
21+
{
22+
"appearance": "luminosity",
23+
"value": "tinted"
24+
}
25+
],
26+
"idiom": "universal",
27+
"platform": "ios",
28+
"size": "1024x1024"
29+
}
30+
],
31+
"info": {
32+
"author": "xcode",
33+
"version": 1
34+
}
35+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"info": {
3+
"author": "xcode",
4+
"version": 1
5+
}
6+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"colors": [
3+
{
4+
"idiom": "universal"
5+
}
6+
],
7+
"info": {
8+
"author": "xcode",
9+
"version": 1
10+
}
11+
}

0 commit comments

Comments
 (0)