-
Notifications
You must be signed in to change notification settings - Fork 516
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PushToTalk] Add new framework for Xcode 14 bet4. (#15645)
Co-authored-by: Alex Soto <[email protected]>
- Loading branch information
1 parent
d80759c
commit d02dd49
Showing
10 changed files
with
257 additions
and
66 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,249 @@ | ||
// | ||
// PushToTalk C# bindings | ||
// | ||
// Authors: | ||
// Manuel de la Pena Saenz <[email protected]> | ||
// | ||
// Copyright 2022 Microsoft Corporation All rights reserved. | ||
// | ||
|
||
using System; | ||
|
||
using AVFoundation; | ||
using CoreFoundation; | ||
using Foundation; | ||
using ObjCRuntime; | ||
using UIKit; | ||
|
||
#if !NET | ||
using NativeHandle = System.IntPtr; | ||
#endif | ||
|
||
namespace PushToTalk { | ||
|
||
[NoWatch, NoTV, NoMac, iOS (16,0), MacCatalyst (16,0)] | ||
[Native] | ||
public enum PTChannelJoinReason : long { | ||
DeveloperRequest = 0, | ||
ChannelRestoration = 1, | ||
} | ||
|
||
[NoWatch, NoTV, NoMac, iOS (16,0), MacCatalyst (16,0)] | ||
[Native] | ||
public enum PTChannelLeaveReason : long { | ||
Unknown = 0, | ||
UserRequest = 1, | ||
DeveloperRequest = 2, | ||
SystemPolicy = 3, | ||
} | ||
|
||
[NoWatch, NoTV, NoMac, iOS (16,0), MacCatalyst (16,0)] | ||
[Native] | ||
public enum PTChannelTransmitRequestSource : long { | ||
Unknown = 0, | ||
UserRequest = 1, | ||
DeveloperRequest = 2, | ||
HandsfreeButton = 3, | ||
} | ||
|
||
[NoWatch, NoTV, NoMac, iOS (16,0), MacCatalyst (16,0)] | ||
[Native] | ||
public enum PTServiceStatus : long { | ||
Ready, | ||
Connecting, | ||
Unavailable, | ||
} | ||
|
||
[NoWatch, NoTV, NoMac, iOS (16,0), MacCatalyst (16,0)] | ||
[Native] | ||
public enum PTTransmissionMode : long { | ||
FullDuplex, | ||
HalfDuplex, | ||
ListenOnly, | ||
} | ||
|
||
[NoWatch, NoTV, NoMac, iOS (16,0), MacCatalyst (16,0)] | ||
[Native] | ||
[ErrorDomain ("PTInstantiationErrorDomain")] | ||
public enum PTInstantiationError : long | ||
{ | ||
Unknown = 0, | ||
InvalidPlatform = 1, | ||
MissingBackgroundMode = 2, | ||
MissingPushServerEnvironment = 3, | ||
MissingEntitlement = 4, | ||
InstantiationAlreadyInProgress = 5, | ||
} | ||
|
||
[NoWatch, NoTV, NoMac, iOS (16,0), MacCatalyst (16,0)] | ||
[Native] | ||
[ErrorDomain ("PTChannelErrorDomain")] | ||
public enum PTChannelError : long | ||
{ | ||
Unknown = 0, | ||
ChannelNotFound = 1, | ||
ChannelLimitReached = 2, | ||
CallActive = 3, | ||
TransmissionInProgress = 4, | ||
TransmissionNotFound = 5, | ||
AppNotForeground = 6, | ||
DeviceManagementRestriction = 7, | ||
ScreenTimeRestriction = 8, | ||
TransmissionNotAllowed = 9, | ||
} | ||
|
||
[NoWatch, NoTV, NoMac, iOS (16,0), MacCatalyst (16,0)] | ||
[BaseType (typeof (NSObject))] | ||
[DisableDefaultCtor] | ||
interface PTParticipant | ||
{ | ||
[Export ("name")] | ||
string Name { get; } | ||
|
||
[NullAllowed, Export ("image", ArgumentSemantic.Copy)] | ||
UIImage Image { get; } | ||
|
||
[Export ("initWithName:image:")] | ||
[DesignatedInitializer] | ||
NativeHandle Constructor (string name, [NullAllowed] UIImage image); | ||
} | ||
|
||
[NoWatch, NoTV, NoMac, iOS (16,0), MacCatalyst (16,0)] | ||
[BaseType (typeof (NSObject))] | ||
[DisableDefaultCtor] | ||
interface PTPushResult | ||
{ | ||
[Static] | ||
[Export ("leaveChannelPushResult")] | ||
PTPushResult LeaveChannelPushResult { get; } | ||
|
||
[Static] | ||
[Export ("pushResultForActiveRemoteParticipant:")] | ||
PTPushResult Create (PTParticipant participant); | ||
} | ||
|
||
[NoWatch, NoTV, NoMac, iOS (16,0), MacCatalyst (16,0)] | ||
[BaseType (typeof (NSObject))] | ||
[DisableDefaultCtor] | ||
interface PTChannelDescriptor | ||
{ | ||
[Export ("initWithName:image:")] | ||
[DesignatedInitializer] | ||
NativeHandle Constructor (string name, [NullAllowed] UIImage image); | ||
|
||
[Export ("name")] | ||
string Name { get; } | ||
|
||
[NullAllowed, Export ("image", ArgumentSemantic.Copy)] | ||
UIImage Image { get; } | ||
} | ||
|
||
interface IPTChannelManagerDelegate {} | ||
|
||
[NoWatch, NoTV, NoMac, iOS (16,0), MacCatalyst (16,0)] | ||
[Protocol] | ||
[BaseType (typeof (NSObject))] | ||
interface PTChannelManagerDelegate | ||
{ | ||
[Abstract] | ||
[Export ("channelManager:didJoinChannelWithUUID:reason:")] | ||
void DidJoinChannel (PTChannelManager channelManager, NSUuid channelUuid, PTChannelJoinReason reason); | ||
|
||
[Abstract] | ||
[Export ("channelManager:didLeaveChannelWithUUID:reason:")] | ||
void DidLeaveChannel (PTChannelManager channelManager, NSUuid channelUuid, PTChannelLeaveReason reason); | ||
|
||
[Abstract] | ||
[Export ("channelManager:channelUUID:didBeginTransmittingFromSource:")] | ||
void DidBeginTransmitting (PTChannelManager channelManager, NSUuid channelUuid, PTChannelTransmitRequestSource source); | ||
|
||
[Abstract] | ||
[Export ("channelManager:channelUUID:didEndTransmittingFromSource:")] | ||
void DidEndTransmitting (PTChannelManager channelManager, NSUuid channelUuid, PTChannelTransmitRequestSource source); | ||
|
||
[Abstract] | ||
[Export ("channelManager:receivedEphemeralPushToken:")] | ||
void ReceivedEphemeralPushToken (PTChannelManager channelManager, NSData pushToken); | ||
|
||
[Abstract] | ||
[Export ("incomingPushResultForChannelManager:channelUUID:pushPayload:")] | ||
PTPushResult IncomingPushResult (PTChannelManager channelManager, NSUuid channelUuid, NSDictionary<NSString, NSObject> pushPayload); | ||
|
||
[NoMac] | ||
[Abstract] | ||
[Export ("channelManager:didActivateAudioSession:")] | ||
void DidActivateAudioSession (PTChannelManager channelManager, AVAudioSession audioSession); | ||
|
||
[NoMac] | ||
[Abstract] | ||
[Export ("channelManager:didDeactivateAudioSession:")] | ||
void DidDeactivateAudioSession (PTChannelManager channelManager, AVAudioSession audioSession); | ||
|
||
[Export ("channelManager:failedToJoinChannelWithUUID:error:")] | ||
void FailedToJoinChannel (PTChannelManager channelManager, NSUuid channelUuid, NSError error); | ||
|
||
[Export ("channelManager:failedToLeaveChannelWithUUID:error:")] | ||
void FailedToLeaveChannel (PTChannelManager channelManager, NSUuid channelUuid, NSError error); | ||
|
||
[Export ("channelManager:failedToBeginTransmittingInChannelWithUUID:error:")] | ||
void FailedToBeginTransmittingInChannel (PTChannelManager channelManager, NSUuid channelUuid, NSError error); | ||
|
||
[Export ("channelManager:failedToStopTransmittingInChannelWithUUID:error:")] | ||
void failedToStopTransmittingInChannel (PTChannelManager channelManager, NSUuid channelUuid, NSError error); | ||
} | ||
|
||
interface IPTChannelRestorationDelegate {} | ||
|
||
[NoWatch, NoTV, NoMac, iOS (16,0), MacCatalyst (16,0)] | ||
[Protocol] | ||
[BaseType (typeof (NSObject))] | ||
interface PTChannelRestorationDelegate | ||
{ | ||
[Abstract] | ||
[Export ("channelDescriptorForRestoredChannelUUID:")] | ||
PTChannelDescriptor Create (NSUuid channelUuid); | ||
} | ||
|
||
[NoWatch, NoTV, NoMac, iOS (16,0), MacCatalyst (16,0)] | ||
[BaseType (typeof (NSObject))] | ||
[DisableDefaultCtor] | ||
interface PTChannelManager | ||
{ | ||
[Async] | ||
[Static] | ||
[Export ("channelManagerWithDelegate:restorationDelegate:completionHandler:")] | ||
void Create (IPTChannelManagerDelegate @delegate, IPTChannelRestorationDelegate restorationDelegate, Action<PTChannelManager, NSError> completionHandler); | ||
|
||
[NullAllowed, Export ("activeChannelUUID", ArgumentSemantic.Strong)] | ||
NSUuid ActiveChannelUuid { get; } | ||
|
||
[Export ("requestJoinChannelWithUUID:descriptor:")] | ||
void RequestJoinChannel (NSUuid channelUuid, PTChannelDescriptor descriptor); | ||
|
||
[Export ("requestBeginTransmittingWithChannelUUID:")] | ||
void RequestBeginTransmitting (NSUuid channelUuid); | ||
|
||
[Export ("stopTransmittingWithChannelUUID:")] | ||
void StopTransmitting (NSUuid channelUuid); | ||
|
||
[Export ("leaveChannelWithUUID:")] | ||
void LeaveChannel (NSUuid channelUuid); | ||
|
||
[Async] | ||
[Export ("setChannelDescriptor:forChannelUUID:completionHandler:")] | ||
void SetChannelDescriptor (PTChannelDescriptor channelDescriptor, NSUuid channelUuid, [NullAllowed] Action<NSError> completionHandler); | ||
|
||
[Async] | ||
[Export ("setActiveRemoteParticipant:forChannelUUID:completionHandler:")] | ||
void SetActiveRemoteParticipant ([NullAllowed] PTParticipant participant, NSUuid channelUuid, [NullAllowed] Action<NSError> completionHandler); | ||
|
||
[Async] | ||
[Export ("setServiceStatus:forChannelUUID:completionHandler:")] | ||
void SetServiceStatus (PTServiceStatus status, NSUuid channelUuid, [NullAllowed] Action<NSError> completionHandler); | ||
|
||
[Async] | ||
[Export ("setTransmissionMode:forChannelUUID:completionHandler:")] | ||
void SetTransmissionMode (PTTransmissionMode transmissionMode, NSUuid channelUuid, [NullAllowed] Action<NSError> completionHandler); | ||
} | ||
|
||
} |
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
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
33 changes: 0 additions & 33 deletions
33
tests/xtro-sharpie/api-annotations-dotnet/iOS-PushToTalk.todo
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
d02dd49
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.
✅ API diff for current PR / commit
Legacy Xamarin (No breaking changes)
tvOS(no change detected)watchOS(no change detected)macOS(no change detected).NET (No breaking changes)
tvOS: (empty diff detected)macOS: (empty diff detected)❗ API diff vs stable (Breaking changes)
Legacy Xamarin (:heavy_exclamation_mark: Breaking changes :heavy_exclamation_mark:)
.NET (:heavy_exclamation_mark: Breaking changes :heavy_exclamation_mark:)
Legacy Xamarin (stable) vs .NET
ℹ️ Generator diff
Generator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes)
Pipeline on Agent
Hash: d02dd49235459b2799372add8f21ad3b16aa3982 [CI build]
d02dd49
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.
💻 [CI Build] Tests on macOS Mac Catalina (10.15) passed 💻
✅ All tests on macOS Mac Catalina (10.15) passed.
Pipeline on Agent
Hash: d02dd49235459b2799372add8f21ad3b16aa3982 [CI build]
d02dd49
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.
❌ [CI Build] Tests on macOS M1 - Mac Big Sur (11.5) failed ❌
Failed tests are:
Pipeline on Agent
Hash: d02dd49235459b2799372add8f21ad3b16aa3982 [CI build]
d02dd49
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.
📚 [CI Build] Artifacts 📚
Packages generated
View packages
Pipeline on Agent XAMMINI-070.Monterey'
Hash: d02dd49235459b2799372add8f21ad3b16aa3982 [CI build]
d02dd49
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.
🔥 [CI Build] Test results 🔥
Test results
❌ Tests failed on VSTS: simulator tests
0 tests crashed, 9 tests failed, 219 tests passed.
Failures
❌ introspection tests
Html Report (VSDrops) Download
❌ monotouch tests
Html Report (VSDrops) Download
Successes
✅ bcl: All 69 tests passed. Html Report (VSDrops) Download
✅ cecil: All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests: All 1 tests passed. Html Report (VSDrops) Download
✅ fsharp: All 7 tests passed. Html Report (VSDrops) Download
✅ framework: All 8 tests passed. Html Report (VSDrops) Download
✅ generator: All 2 tests passed. Html Report (VSDrops) Download
✅ interdependent_binding_projects: All 7 tests passed. Html Report (VSDrops) Download
✅ install_source: All 1 tests passed. Html Report (VSDrops) Download
✅ linker: All 65 tests passed. Html Report (VSDrops) Download
✅ mac_binding_project: All 1 tests passed. Html Report (VSDrops) Download
✅ mmp: All 2 tests passed. Html Report (VSDrops) Download
✅ mononative: All 12 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ mtouch: All 1 tests passed. Html Report (VSDrops) Download
✅ xammac: All 3 tests passed. Html Report (VSDrops) Download
✅ xcframework: All 8 tests passed. Html Report (VSDrops) Download
✅ xtro: All 2 tests passed. Html Report (VSDrops) Download
Pipeline on Agent
Hash: [CI build]