-
-
Notifications
You must be signed in to change notification settings - Fork 213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add MacCatalyst target and sample app #1848
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
#pragma warning disable CS0618 | ||
|
||
namespace Sentry.Samples.Ios; | ||
|
||
[Register("AppDelegate")] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#pragma warning disable CS0618 | ||
|
||
namespace Sentry.Samples.MacCatalyst; | ||
|
||
[Register ("AppDelegate")] | ||
public class AppDelegate : UIApplicationDelegate { | ||
public override UIWindow? Window { | ||
get; | ||
set; | ||
} | ||
|
||
public override bool FinishedLaunching (UIApplication application, NSDictionary launchOptions) | ||
{ | ||
// Init the Sentry SDK | ||
SentrySdk.Init(o => | ||
{ | ||
o.Debug = true; | ||
o.Dsn = "https://eb18e953812b41c3aeb042e666fd3b5c@o447951.ingest.sentry.io/5428537"; | ||
}); | ||
|
||
// create a new window instance based on the screen size | ||
Window = new UIWindow (UIScreen.MainScreen.Bounds); | ||
|
||
// create a UIViewController with a single UILabel | ||
var vc = new UIViewController (); | ||
vc.View!.AddSubview (new UILabel (Window!.Frame) { | ||
BackgroundColor = UIColor.SystemBackground, | ||
TextAlignment = UITextAlignment.Center, | ||
Text = "Hello, Catalyst!", | ||
AutoresizingMask = UIViewAutoresizing.All, | ||
}); | ||
Window.RootViewController = vc; | ||
|
||
// make the window visible | ||
Window.MakeKeyAndVisible (); | ||
|
||
// Try out the Sentry SDK | ||
SentrySdk.CaptureMessage("From Mac Catalyst"); | ||
|
||
// Uncomment to try these | ||
// throw new Exception("Test Unhandled Managed Exception"); | ||
// SentrySdk.CauseCrash(CrashType.Native); | ||
|
||
return true; | ||
} | ||
} |
68 changes: 68 additions & 0 deletions
68
samples/Sentry.Samples.MacCatalyst/Assets.xcassets/AppIcon.appiconset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
{ | ||
"images": [ | ||
{ | ||
"idiom" : "mac", | ||
"scale" : "1x", | ||
"size" : "16x16", | ||
"filename": "Icon16.png" | ||
}, | ||
{ | ||
"idiom" : "mac", | ||
"scale" : "2x", | ||
"size" : "16x16", | ||
"filename": "Icon32.png" | ||
}, | ||
{ | ||
"idiom" : "mac", | ||
"scale" : "1x", | ||
"size" : "32x32", | ||
"filename": "Icon32.png" | ||
}, | ||
{ | ||
"idiom" : "mac", | ||
"scale" : "2x", | ||
"size" : "32x32", | ||
"filename": "Icon64.png" | ||
}, | ||
{ | ||
"idiom" : "mac", | ||
"scale" : "1x", | ||
"size" : "128x128", | ||
"filename": "Icon128.png" | ||
}, | ||
{ | ||
"idiom" : "mac", | ||
"scale" : "2x", | ||
"size" : "128x128", | ||
"filename": "Icon256.png" | ||
}, | ||
{ | ||
"idiom" : "mac", | ||
"scale" : "1x", | ||
"size" : "256x256", | ||
"filename": "Icon256.png" | ||
}, | ||
{ | ||
"idiom" : "mac", | ||
"scale" : "2x", | ||
"size" : "256x256", | ||
"filename": "Icon512.png" | ||
}, | ||
{ | ||
"idiom" : "mac", | ||
"scale" : "1x", | ||
"size" : "512x512", | ||
"filename": "Icon512.png" | ||
}, | ||
{ | ||
"idiom" : "mac", | ||
"scale" : "2x", | ||
"size" : "512x512", | ||
"filename": "Icon1024.png" | ||
} | ||
], | ||
"info": { | ||
"version": 1, | ||
"author": "xcode" | ||
}, | ||
} |
Binary file added
BIN
+68.8 KB
samples/Sentry.Samples.MacCatalyst/Assets.xcassets/AppIcon.appiconset/Icon1024.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+6.2 KB
samples/Sentry.Samples.MacCatalyst/Assets.xcassets/AppIcon.appiconset/Icon128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.23 KB
samples/Sentry.Samples.MacCatalyst/Assets.xcassets/AppIcon.appiconset/Icon16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+15.2 KB
samples/Sentry.Samples.MacCatalyst/Assets.xcassets/AppIcon.appiconset/Icon256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.52 KB
samples/Sentry.Samples.MacCatalyst/Assets.xcassets/AppIcon.appiconset/Icon32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+33.9 KB
samples/Sentry.Samples.MacCatalyst/Assets.xcassets/AppIcon.appiconset/Icon512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+3.03 KB
samples/Sentry.Samples.MacCatalyst/Assets.xcassets/AppIcon.appiconset/Icon64.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?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> | ||
</dict> | ||
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?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>CFBundleDisplayName</key> | ||
<string>Sentry.Samples.MacCatalyst</string> | ||
<key>CFBundleIdentifier</key> | ||
<string>com.companyname.Sentry.Samples.MacCatalyst</string> | ||
<key>CFBundleShortVersionString</key> | ||
<string>1.0</string> | ||
<key>CFBundleVersion</key> | ||
<string>1.0</string> | ||
<key>UIDeviceFamily</key> | ||
<array> | ||
<integer>2</integer> | ||
</array> | ||
<key>UISupportedInterfaceOrientations</key> | ||
<array> | ||
<string>UIInterfaceOrientationPortrait</string> | ||
<string>UIInterfaceOrientationLandscapeLeft</string> | ||
<string>UIInterfaceOrientationLandscapeRight</string> | ||
</array> | ||
<key>XSAppIconAssets</key> | ||
<string>Assets.xcassets/AppIcon.appiconset</string> | ||
</dict> | ||
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
using Sentry.Samples.MacCatalyst; | ||
|
||
// This is the main entry point of the application. | ||
// If you want to use a different Application Delegate class from "AppDelegate" | ||
// you can specify it here. | ||
UIApplication.Main (args, null, typeof (AppDelegate)); |
43 changes: 43 additions & 0 deletions
43
samples/Sentry.Samples.MacCatalyst/Resources/LaunchScreen.xib
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="6214" systemVersion="14A314h" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES"> | ||
<dependencies> | ||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6207" /> | ||
<capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1" /> | ||
</dependencies> | ||
<objects> | ||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" /> | ||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder" /> | ||
<view contentMode="scaleToFill" id="iN0-l3-epB"> | ||
<rect key="frame" x="0.0" y="0.0" width="480" height="480" /> | ||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES" /> | ||
<subviews> | ||
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" Copyright (c) 2017 " textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" | ||
minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="8ie-xW-0ye"> | ||
<rect key="frame" x="20" y="439" width="441" height="21" /> | ||
<fontDescription key="fontDescription" type="system" pointSize="17" /> | ||
<color key="textColor" cocoaTouchSystemColor="darkTextColor" /> | ||
<nil key="highlightedColor" /> | ||
</label> | ||
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="NewApp" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" | ||
minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="kId-c2-rCX"> | ||
<rect key="frame" x="20" y="140" width="441" height="43" /> | ||
<fontDescription key="fontDescription" type="boldSystem" pointSize="36" /> | ||
<color key="textColor" cocoaTouchSystemColor="darkTextColor" /> | ||
<nil key="highlightedColor" /> | ||
</label> | ||
</subviews> | ||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite" /> | ||
<constraints> | ||
<constraint firstItem="kId-c2-rCX" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="bottom" multiplier="1/3" constant="1" id="5cJ-9S-tgC" /> | ||
<constraint firstAttribute="centerX" secondItem="kId-c2-rCX" secondAttribute="centerX" id="Koa-jz-hwk" /> | ||
<constraint firstAttribute="bottom" secondItem="8ie-xW-0ye" secondAttribute="bottom" constant="20" id="Kzo-t9-V3l" /> | ||
<constraint firstItem="8ie-xW-0ye" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="MfP-vx-nX0" /> | ||
<constraint firstAttribute="centerX" secondItem="8ie-xW-0ye" secondAttribute="centerX" id="ZEH-qu-HZ9" /> | ||
<constraint firstItem="kId-c2-rCX" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="fvb-Df-36g" /> | ||
</constraints> | ||
<nil key="simulatedStatusBarMetrics" /> | ||
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics" /> | ||
<point key="canvasLocation" x="548" y="455" /> | ||
</view> | ||
</objects> | ||
</document> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
namespace Sentry.Samples.MacCatalyst; | ||
|
||
[Register ("SceneDelegate")] | ||
public class SceneDelegate : UIResponder, IUIWindowSceneDelegate { | ||
|
||
[Export ("window")] | ||
public UIWindow? Window { get; set; } | ||
|
||
[Export ("scene:willConnectToSession:options:")] | ||
public void WillConnect (UIScene scene, UISceneSession session, UISceneConnectionOptions connectionOptions) | ||
{ | ||
// Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. | ||
// If using a storyboard, the `window` property will automatically be initialized and attached to the scene. | ||
// This delegate does not imply the connecting scene or session are new (see UIApplicationDelegate `GetConfiguration` instead). | ||
} | ||
|
||
[Export ("sceneDidDisconnect:")] | ||
public void DidDisconnect (UIScene scene) | ||
{ | ||
// Called as the scene is being released by the system. | ||
// This occurs shortly after the scene enters the background, or when its session is discarded. | ||
// Release any resources associated with this scene that can be re-created the next time the scene connects. | ||
// The scene may re-connect later, as its session was not neccessarily discarded (see UIApplicationDelegate `DidDiscardSceneSessions` instead). | ||
} | ||
|
||
[Export ("sceneDidBecomeActive:")] | ||
public void DidBecomeActive (UIScene scene) | ||
{ | ||
// Called when the scene has moved from an inactive state to an active state. | ||
// Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. | ||
} | ||
|
||
[Export ("sceneWillResignActive:")] | ||
public void WillResignActive (UIScene scene) | ||
{ | ||
// Called when the scene will move from an active state to an inactive state. | ||
// This may occur due to temporary interruptions (ex. an incoming phone call). | ||
} | ||
|
||
[Export ("sceneWillEnterForeground:")] | ||
public void WillEnterForeground (UIScene scene) | ||
{ | ||
// Called as the scene transitions from the background to the foreground. | ||
// Use this method to undo the changes made on entering the background. | ||
} | ||
|
||
[Export ("sceneDidEnterBackground:")] | ||
public void DidEnterBackground (UIScene scene) | ||
{ | ||
// Called as the scene transitions from the foreground to the background. | ||
// Use this method to save data, release shared resources, and store enough scene-specific state information | ||
// to restore the scene back to its current state. | ||
} | ||
} |
45 changes: 45 additions & 0 deletions
45
samples/Sentry.Samples.MacCatalyst/Sentry.Samples.MacCatalyst.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<TargetFramework>net6.0-maccatalyst</TargetFramework> | ||
<RuntimeIdentifier>maccatalyst-x64</RuntimeIdentifier> | ||
<OutputType>Exe</OutputType> | ||
<Nullable>enable</Nullable> | ||
<ImplicitUsings>true</ImplicitUsings> | ||
<SupportedOSPlatformVersion>14.2</SupportedOSPlatformVersion> | ||
</PropertyGroup> | ||
|
||
<!-- | ||
In a real project, use the PackageReference and set the version to the latest release. | ||
Use that instead of the ProjectReference. | ||
--> | ||
|
||
<ItemGroup> | ||
<!-- <PackageReference Include="Sentry" Version="..." /> --> | ||
<ProjectReference Include="..\..\src\Sentry\Sentry.csproj" /> | ||
</ItemGroup> | ||
|
||
<!-- | ||
This next section is to build an empty assembly instead of the actual sample app when not building on a Mac. | ||
We do this here so we don't have to worry about solution configurations or filters in CI. | ||
It is not needed in a real application. | ||
--> | ||
<PropertyGroup Condition="!$([MSBuild]::IsOSPlatform('OSX'))"> | ||
<TargetFramework>net6.0</TargetFramework> | ||
<OutputType>Library</OutputType> | ||
<DefaultItemExcludes>**\*</DefaultItemExcludes> | ||
</PropertyGroup> | ||
|
||
<!-- | ||
Workaround for https://github.com/dotnet/maui/issues/7272 (also happens for iOS without MAUI) | ||
This should not be needed in a real application. | ||
--> | ||
<Target Name="_SetPublishFolderTypeNoneOnDocFileItems" BeforeTargets="_ComputePublishLocation"> | ||
<ItemGroup> | ||
<ResolvedFileToPublish | ||
Update="@(ResolvedFileToPublish)" | ||
Condition="'%(ResolvedFileToPublish.Extension)' == '.xml' And '%(ResolvedFileToPublish.PublishFolderType)' == ''" | ||
PublishFolderType="None" /> | ||
</ItemGroup> | ||
</Target> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.