Documentation
¶
Index ¶
- Constants
- func AllowsCommand(capabilities CapabilitySet, kind CommandKind) bool
- func AllowsRequest(capabilities CapabilitySet, kind RequestKind) bool
- func IsUnsupported(err error) bool
- type Bridge
- type Capability
- type CapabilitySet
- type ClipboardTextResult
- type Command
- func OpenExternalURL(url string) Command
- func RevealFile(path string) Command
- func SetMenu(menu Menu) Command
- func SetWindowDefaultSize(size Size) Command
- func SetWindowMinimumSize(size Size) Command
- func SetWindowTitle(title string) Command
- func ShowNotification(notification Notification) Command
- func WriteClipboardText(text string) Command
- type CommandKind
- type DeepLink
- type Event
- func DeepLinkOpened(windowID, rawURL, path string) Event
- func EventFromRelay(msg RelayMessage) (Event, error)
- func FilesOpened(windowID string, paths []string) Event
- func MenuItemSelected(windowID, itemID string) Event
- func NotificationOpened(windowID string, notification NotificationEvent) Event
- func NotificationReceived(windowID string, notification NotificationEvent) Event
- func PushOpened(windowID string, push PushEvent) Event
- func PushReceived(windowID string, push PushEvent) Event
- type EventKind
- type EventStream
- type FileDialogOptions
- type FileDialogResult
- type FilesEvent
- type IAPEntitlementsResult
- type IAPManageSubscriptionsResult
- type IAPProduct
- type IAPProductQueryOptions
- type IAPProductsQueryResult
- type IAPPurchaseOptions
- type IAPPurchaseResult
- type IAPTransaction
- type Menu
- type MenuEvent
- type MenuItem
- type MenuSection
- type NativeBridgeCapabilityContract
- type NativeBridgeContractArtifact
- type NativeBridgeEventContract
- type NativeBridgeMessageContract
- type Notification
- type NotificationEvent
- type PushEvent
- type RelayError
- type RelayMessage
- func RelayEvent(windowID string, event Event) (RelayMessage, error)
- func RelayFromCommand(id, windowID string, cmd Command) RelayMessage
- func RelayFromRequest(id, windowID string, req Request) RelayMessage
- func RelayResponse(id, windowID, name string, payload json.RawMessage, err *RelayError) RelayMessage
- type RelayMessageKind
- type RelayReceiver
- type RemotePushRegistrationOptions
- type RemotePushRegistrationResult
- type Request
- func CurrentIAPEntitlements() Request
- func ManageIAPSubscriptions() Request
- func OpenFileDialog(options FileDialogOptions) Request
- func PurchaseIAP(options IAPPurchaseOptions) Request
- func QueryIAPProducts(options IAPProductQueryOptions) Request
- func ReadClipboardText() Request
- func RegisterRemotePush(options RemotePushRegistrationOptions) Request
- func RestoreIAP() Request
- func SaveFileDialog(options FileDialogOptions) Request
- func SignInWithApple(options SignInWithAppleOptions) Request
- type RequestKind
- type Response
- func (r Response) DecodeClipboardTextResult() (ClipboardTextResult, error)
- func (r Response) DecodeFileDialogResult() (FileDialogResult, error)
- func (r Response) DecodeIAPEntitlementsResult() (IAPEntitlementsResult, error)
- func (r Response) DecodeIAPManageSubscriptionsResult() (IAPManageSubscriptionsResult, error)
- func (r Response) DecodeIAPProductsQueryResult() (IAPProductsQueryResult, error)
- func (r Response) DecodeIAPPurchaseResult() (IAPPurchaseResult, error)
- func (r Response) DecodeJSON(dst any) error
- func (r Response) DecodeRemotePushRegistrationResult() (RemotePushRegistrationResult, error)
- func (r Response) DecodeSignInWithAppleResult() (SignInWithAppleResult, error)
- type SignInWithAppleOptions
- type SignInWithAppleResult
- type SignInWithAppleScope
- type Size
- type UnsupportedError
Constants ¶
const NativeBridgeContractSchemaVersion = "vango.native_bridge_contract.v1"
Variables ¶
This section is empty.
Functions ¶
func AllowsCommand ¶
func AllowsCommand(capabilities CapabilitySet, kind CommandKind) bool
AllowsCommand reports whether the capability set permits the shell command.
func AllowsRequest ¶
func AllowsRequest(capabilities CapabilitySet, kind RequestKind) bool
AllowsRequest reports whether the capability set permits the shell request.
func IsUnsupported ¶
IsUnsupported reports whether err indicates an unavailable shell operation.
Types ¶
type Bridge ¶
type Bridge interface {
Surface() surface.Info
Capabilities() CapabilitySet
Events() *EventStream
Dispatch(cmd Command) error
Request(ctx context.Context, req Request) (Response, error)
}
Bridge normalizes native shell capabilities across surfaces.
func UnavailableBridge ¶
UnavailableBridge returns a bridge that exposes no capabilities and fails explicitly.
type Capability ¶
type Capability string
Capability identifies a normalized shell feature.
const ( CapabilityWindowTitle Capability = "window.title" CapabilityWindowDefaultSize Capability = "window.default_size" CapabilityWindowMinimumSize Capability = "window.minimum_size" CapabilityMenu Capability = "app.menu" CapabilityOpenFileDialog Capability = "dialog.open_file" CapabilitySaveFileDialog Capability = "dialog.save_file" CapabilityClipboardReadText Capability = "clipboard.read_text" CapabilityClipboardWriteText Capability = "clipboard.write_text" CapabilityNotification Capability = "notification.show" CapabilityOpenExternalURL Capability = "url.open_external" CapabilityRevealFile Capability = "file.reveal" CapabilityDeepLinks Capability = "deep_link.receive" CapabilitySignInWithApple Capability = "auth.sign_in_with_apple" CapabilityRemotePushRegister Capability = "push.register_remote" CapabilityIAPProductsQuery Capability = "iap.products.query" CapabilityIAPPurchase Capability = "iap.purchase" CapabilityIAPRestore Capability = "iap.restore" CapabilityIAPCurrentEnts Capability = "iap.current_entitlements" CapabilityIAPManageSubs Capability = "iap.manage_subscriptions" )
type CapabilitySet ¶
type CapabilitySet struct {
// contains filtered or unexported fields
}
CapabilitySet reports the capabilities offered by a shell bridge.
func NewCapabilitySet ¶
func NewCapabilitySet(capabilities ...Capability) CapabilitySet
NewCapabilitySet constructs a set from the provided capabilities.
func (CapabilitySet) Clone ¶
func (s CapabilitySet) Clone() CapabilitySet
Clone returns a deep copy of the set.
func (CapabilitySet) Has ¶
func (s CapabilitySet) Has(capability Capability) bool
Has reports whether the capability is present.
func (CapabilitySet) Map ¶
func (s CapabilitySet) Map() map[string]bool
Map returns the capability manifest as a bool map suitable for bootstrap payloads.
func (CapabilitySet) Merge ¶
func (s CapabilitySet) Merge(other CapabilitySet) CapabilitySet
Merge returns a new set containing both sets' capabilities.
func (CapabilitySet) Strings ¶
func (s CapabilitySet) Strings() []string
Strings returns the capability names in deterministic order.
type ClipboardTextResult ¶
type ClipboardTextResult struct {
Text string `json:"text,omitempty"`
}
ClipboardTextResult returns text read from the system clipboard.
type Command ¶
type Command struct {
Kind CommandKind `json:"kind"`
Payload json.RawMessage `json:"payload,omitempty"`
}
Command is a serialized shell command envelope.
func OpenExternalURL ¶
OpenExternalURL builds an external URL command.
func SetWindowDefaultSize ¶
SetWindowDefaultSize builds a default window size command.
func SetWindowMinimumSize ¶
SetWindowMinimumSize builds a minimum window size command.
func SetWindowTitle ¶
SetWindowTitle builds a window title command.
func ShowNotification ¶
func ShowNotification(notification Notification) Command
ShowNotification builds a notification command.
func WriteClipboardText ¶
WriteClipboardText builds a clipboard write command.
type CommandKind ¶
type CommandKind string
CommandKind identifies a fire-and-forget shell command.
const ( CommandSetWindowTitle CommandKind = "window.set_title" CommandSetWindowDefaultSize CommandKind = "window.set_default_size" CommandSetWindowMinimumSize CommandKind = "window.set_minimum_size" CommandSetMenu CommandKind = "app.set_menu" CommandShowNotification CommandKind = "notification.show" CommandWriteClipboardText CommandKind = "clipboard.write_text" CommandOpenExternalURL CommandKind = "url.open_external" CommandRevealFile CommandKind = "file.reveal" )
type Event ¶
type Event struct {
Kind EventKind `json:"kind"`
WindowID string `json:"windowID,omitempty"`
Menu *MenuEvent `json:"menu,omitempty"`
DeepLink *DeepLink `json:"deepLink,omitempty"`
Files *FilesEvent `json:"files,omitempty"`
Notification *NotificationEvent `json:"notification,omitempty"`
Push *PushEvent `json:"push,omitempty"`
}
Event is delivered from the native host back into Vango app code.
func DeepLinkOpened ¶
DeepLinkOpened builds a deep-link event.
func EventFromRelay ¶
func EventFromRelay(msg RelayMessage) (Event, error)
EventFromRelay converts an event relay message into a normalized shell event.
func FilesOpened ¶
FilesOpened builds a file-open event.
func MenuItemSelected ¶
MenuItemSelected builds a menu selection event.
func NotificationOpened ¶ added in v0.2.0
func NotificationOpened(windowID string, notification NotificationEvent) Event
NotificationOpened builds a local-notification opened event.
func NotificationReceived ¶ added in v0.2.0
func NotificationReceived(windowID string, notification NotificationEvent) Event
NotificationReceived builds a local-notification received event.
func PushOpened ¶ added in v0.2.0
PushOpened builds a remote-push opened event.
func PushReceived ¶ added in v0.2.0
PushReceived builds a remote-push received event.
type EventKind ¶
type EventKind string
EventKind identifies a host-originated shell event.
const ( EventMenuItemSelected EventKind = "menu.item_selected" EventDeepLinkOpened EventKind = "deep_link.opened" EventFilesOpened EventKind = "files.opened" EventNotificationReceived EventKind = "notification.received" EventNotificationOpened EventKind = "notification.opened" EventPushReceived EventKind = "push.received" EventPushOpened EventKind = "push.opened" )
type EventStream ¶
type EventStream struct {
// contains filtered or unexported fields
}
EventStream delivers host-originated shell events to subscribers in order.
func NewEventStream ¶
func NewEventStream(capacity int) *EventStream
NewEventStream constructs an event stream with a bounded replay buffer.
func (*EventStream) Publish ¶
func (s *EventStream) Publish(event Event)
Publish records and broadcasts an event.
func (*EventStream) Subscribe ¶
func (s *EventStream) Subscribe(handler func(Event)) (unsubscribe func())
Subscribe registers a handler and replays the recent buffered events in order.
type FileDialogOptions ¶
type FileDialogOptions struct {
Title string `json:"title,omitempty"`
Prompt string `json:"prompt,omitempty"`
DefaultPath string `json:"defaultPath,omitempty"`
SuggestedName string `json:"suggestedName,omitempty"`
AllowedFileTypes []string `json:"allowedFileTypes,omitempty"`
AllowsMultiple bool `json:"allowsMultiple,omitempty"`
AllowsDirectories bool `json:"allowsDirectories,omitempty"`
AllowsFiles bool `json:"allowsFiles,omitempty"`
CreateDirectories bool `json:"createDirectories,omitempty"`
}
FileDialogOptions configures open/save panels.
type FileDialogResult ¶
type FileDialogResult struct {
Paths []string `json:"paths,omitempty"`
}
FileDialogResult contains file paths chosen by the user.
type FilesEvent ¶
type FilesEvent struct {
Paths []string `json:"paths,omitempty"`
}
FilesEvent reports that one or more local files were opened via the host shell.
type IAPEntitlementsResult ¶ added in v0.2.0
type IAPEntitlementsResult struct {
Entitlements []IAPTransaction `json:"entitlements,omitempty"`
}
IAPEntitlementsResult returns the active entitlements visible to the native host.
type IAPManageSubscriptionsResult ¶ added in v0.2.0
type IAPManageSubscriptionsResult struct {
Opened bool `json:"opened,omitempty"`
}
IAPManageSubscriptionsResult reports whether the native host opened subscription management UI.
type IAPProduct ¶ added in v0.2.0
type IAPProduct struct {
ProductID string `json:"productId,omitempty"`
DisplayName string `json:"displayName,omitempty"`
Description string `json:"description,omitempty"`
DisplayPrice string `json:"displayPrice,omitempty"`
CurrencyCode string `json:"currencyCode,omitempty"`
ProductType string `json:"productType,omitempty"`
SubscriptionGroupID string `json:"subscriptionGroupId,omitempty"`
}
IAPProduct describes a StoreKit product surfaced through the native shell.
type IAPProductQueryOptions ¶ added in v0.2.0
type IAPProductQueryOptions struct {
ProductIDs []string `json:"productIds,omitempty"`
}
IAPProductQueryOptions configures a StoreKit product query.
type IAPProductsQueryResult ¶ added in v0.2.0
type IAPProductsQueryResult struct {
Products []IAPProduct `json:"products,omitempty"`
MissingProductIDs []string `json:"missingProductIds,omitempty"`
}
IAPProductsQueryResult returns the products resolved by the native StoreKit host.
type IAPPurchaseOptions ¶ added in v0.2.0
type IAPPurchaseOptions struct {
ProductID string `json:"productId,omitempty"`
AppAccountToken string `json:"appAccountToken,omitempty"`
}
IAPPurchaseOptions configures a StoreKit purchase request.
type IAPPurchaseResult ¶ added in v0.2.0
type IAPPurchaseResult struct {
Status string `json:"status,omitempty"`
ProductID string `json:"productId,omitempty"`
Transaction *IAPTransaction `json:"transaction,omitempty"`
}
IAPPurchaseResult returns the outcome of a StoreKit purchase attempt.
type IAPTransaction ¶ added in v0.2.0
type IAPTransaction struct {
ProductID string `json:"productId,omitempty"`
TransactionID string `json:"transactionId,omitempty"`
OriginalTransactionID string `json:"originalTransactionId,omitempty"`
OwnershipType string `json:"ownershipType,omitempty"`
Environment string `json:"environment,omitempty"`
PurchaseDate string `json:"purchaseDate,omitempty"`
ExpirationDate string `json:"expirationDate,omitempty"`
RevocationDate string `json:"revocationDate,omitempty"`
}
IAPTransaction describes a normalized StoreKit transaction or entitlement.
type Menu ¶
type Menu struct {
Sections []MenuSection `json:"sections,omitempty"`
}
Menu describes the native application menu.
type MenuEvent ¶
type MenuEvent struct {
ID string `json:"id"`
}
MenuEvent reports that a native menu item was selected.
type MenuItem ¶
type MenuItem struct {
ID string `json:"id"`
Title string `json:"title"`
Shortcut string `json:"shortcut,omitempty"`
Disabled bool `json:"disabled,omitempty"`
Checked bool `json:"checked,omitempty"`
}
MenuItem describes a single native menu item.
type MenuSection ¶
type MenuSection struct {
Title string `json:"title,omitempty"`
Items []MenuItem `json:"items,omitempty"`
}
MenuSection groups menu items under a visible title.
type NativeBridgeCapabilityContract ¶ added in v0.2.0
type NativeBridgeCapabilityContract struct {
Name Capability `json:"name"`
Platforms []string `json:"platforms"`
Description string `json:"description"`
}
NativeBridgeCapabilityContract describes one semantic native shell capability.
type NativeBridgeContractArtifact ¶ added in v0.2.0
type NativeBridgeContractArtifact struct {
SchemaVersion string `json:"schema_version"`
Capabilities []NativeBridgeCapabilityContract `json:"capabilities"`
Commands []NativeBridgeMessageContract `json:"commands"`
Requests []NativeBridgeMessageContract `json:"requests"`
Events []NativeBridgeEventContract `json:"events"`
}
NativeBridgeContractArtifact is the machine-readable native shell contract.
func NativeBridgeContract ¶ added in v0.2.0
func NativeBridgeContract() NativeBridgeContractArtifact
NativeBridgeContract returns a defensive copy of Vango's native shell contract.
type NativeBridgeEventContract ¶ added in v0.2.0
type NativeBridgeEventContract struct {
Kind EventKind `json:"kind"`
Platforms []string `json:"platforms"`
PayloadKey string `json:"payload_key"`
PayloadType string `json:"payload_type"`
Description string `json:"description"`
}
NativeBridgeEventContract describes a native-to-app event.
type NativeBridgeMessageContract ¶ added in v0.2.0
type NativeBridgeMessageContract struct {
Kind string `json:"kind"`
Capability Capability `json:"capability,omitempty"`
Platforms []string `json:"platforms"`
PayloadType string `json:"payload_type"`
ResponseType string `json:"response_type,omitempty"`
Description string `json:"description"`
}
NativeBridgeMessageContract describes an app-to-native command or request.
type Notification ¶
type Notification struct {
Title string `json:"title"`
Subtitle string `json:"subtitle,omitempty"`
Body string `json:"body,omitempty"`
Identifier string `json:"identifier,omitempty"`
}
Notification describes a user-visible native notification.
type NotificationEvent ¶ added in v0.2.0
type NotificationEvent = PushEvent
NotificationEvent reports a local notification lifecycle event emitted by the native host.
type PushEvent ¶ added in v0.2.0
type PushEvent struct {
NotificationID string `json:"notificationId,omitempty"`
ActionID string `json:"actionId,omitempty"`
Title string `json:"title,omitempty"`
Subtitle string `json:"subtitle,omitempty"`
Body string `json:"body,omitempty"`
Route string `json:"route,omitempty"`
URL string `json:"url,omitempty"`
Payload map[string]any `json:"payload,omitempty"`
}
PushEvent reports a remote notification lifecycle event emitted by the native host.
type RelayError ¶
type RelayError struct {
Code string `json:"code,omitempty"`
Message string `json:"message,omitempty"`
}
RelayError describes a typed relay failure.
func (*RelayError) Error ¶
func (e *RelayError) Error() string
type RelayMessage ¶
type RelayMessage struct {
ID string `json:"id,omitempty"`
Kind RelayMessageKind `json:"kind,omitempty"`
WindowID string `json:"windowID,omitempty"`
Name string `json:"name,omitempty"`
Payload json.RawMessage `json:"payload,omitempty"`
Error *RelayError `json:"error,omitempty"`
}
RelayMessage is the topology-neutral shell RPC envelope used by hosted shells.
func RelayEvent ¶
func RelayEvent(windowID string, event Event) (RelayMessage, error)
RelayEvent builds a host-originated event relay message.
func RelayFromCommand ¶
func RelayFromCommand(id, windowID string, cmd Command) RelayMessage
RelayFromCommand converts a fire-and-forget shell command into a relay message.
func RelayFromRequest ¶
func RelayFromRequest(id, windowID string, req Request) RelayMessage
RelayFromRequest converts a blocking shell request into a relay message.
func RelayResponse ¶
func RelayResponse(id, windowID, name string, payload json.RawMessage, err *RelayError) RelayMessage
RelayResponse builds a response relay message for the given id/name.
func (RelayMessage) Clone ¶
func (m RelayMessage) Clone() RelayMessage
Clone returns a deep copy of the relay message.
func (RelayMessage) DecodePayload ¶
func (m RelayMessage) DecodePayload(dst any) error
DecodePayload decodes the message payload into dst.
type RelayMessageKind ¶
type RelayMessageKind string
RelayMessageKind identifies the direction and semantics of a shell relay message.
const ( RelayMessageCommand RelayMessageKind = "command" RelayMessageRequest RelayMessageKind = "request" RelayMessageResponse RelayMessageKind = "response" RelayMessageEvent RelayMessageKind = "event" )
type RelayReceiver ¶
type RelayReceiver interface {
HandleRelayMessage(RelayMessage) error
}
RelayReceiver consumes relay responses and host-originated shell events.
type RemotePushRegistrationOptions ¶ added in v0.2.0
type RemotePushRegistrationOptions struct {
Alerts bool `json:"alerts,omitempty"`
Badges bool `json:"badges,omitempty"`
Sounds bool `json:"sounds,omitempty"`
Provisional bool `json:"provisional,omitempty"`
}
RemotePushRegistrationOptions configures an APNs registration request.
type RemotePushRegistrationResult ¶ added in v0.2.0
type RemotePushRegistrationResult struct {
Status string `json:"status,omitempty"`
DeviceToken string `json:"deviceToken,omitempty"`
Environment string `json:"environment,omitempty"`
AuthorizationStatus string `json:"authorizationStatus,omitempty"`
AlertsEnabled bool `json:"alertsEnabled,omitempty"`
BadgesEnabled bool `json:"badgesEnabled,omitempty"`
SoundsEnabled bool `json:"soundsEnabled,omitempty"`
}
RemotePushRegistrationResult returns the current APNs registration outcome.
type Request ¶
type Request struct {
Kind RequestKind `json:"kind"`
Payload json.RawMessage `json:"payload,omitempty"`
}
Request is a serialized shell request envelope.
func CurrentIAPEntitlements ¶ added in v0.2.0
func CurrentIAPEntitlements() Request
CurrentIAPEntitlements builds a StoreKit entitlement refresh request.
func ManageIAPSubscriptions ¶ added in v0.2.0
func ManageIAPSubscriptions() Request
ManageIAPSubscriptions builds a StoreKit manage-subscriptions request.
func OpenFileDialog ¶
func OpenFileDialog(options FileDialogOptions) Request
OpenFileDialog builds a file open request.
func PurchaseIAP ¶ added in v0.2.0
func PurchaseIAP(options IAPPurchaseOptions) Request
PurchaseIAP builds a StoreKit purchase request.
func QueryIAPProducts ¶ added in v0.2.0
func QueryIAPProducts(options IAPProductQueryOptions) Request
QueryIAPProducts builds a StoreKit product query request.
func ReadClipboardText ¶
func ReadClipboardText() Request
ReadClipboardText builds a clipboard read request.
func RegisterRemotePush ¶ added in v0.2.0
func RegisterRemotePush(options RemotePushRegistrationOptions) Request
RegisterRemotePush builds an APNs registration request.
func RestoreIAP ¶ added in v0.2.0
func RestoreIAP() Request
RestoreIAP builds a StoreKit restore request.
func SaveFileDialog ¶
func SaveFileDialog(options FileDialogOptions) Request
SaveFileDialog builds a file save request.
func SignInWithApple ¶ added in v0.2.0
func SignInWithApple(options SignInWithAppleOptions) Request
SignInWithApple builds a native Apple sign-in request.
type RequestKind ¶
type RequestKind string
RequestKind identifies a blocking or user-mediated shell request.
const ( RequestOpenFileDialog RequestKind = "dialog.open_file" RequestSaveFileDialog RequestKind = "dialog.save_file" RequestReadClipboard RequestKind = "clipboard.read_text" RequestSignInWithApple RequestKind = "auth.sign_in_with_apple" RequestRegisterRemotePush RequestKind = "push.register_remote" RequestQueryIAPProducts RequestKind = "iap.products.query" RequestPurchaseIAP RequestKind = "iap.purchase" RequestRestoreIAP RequestKind = "iap.restore" RequestCurrentIAPEnts RequestKind = "iap.current_entitlements" RequestManageIAPSubs RequestKind = "iap.manage_subscriptions" )
type Response ¶
type Response struct {
Kind RequestKind `json:"kind"`
Payload json.RawMessage `json:"payload,omitempty"`
}
Response is a serialized shell response envelope.
func (Response) DecodeClipboardTextResult ¶
func (r Response) DecodeClipboardTextResult() (ClipboardTextResult, error)
DecodeClipboardTextResult decodes a clipboard-read response payload.
func (Response) DecodeFileDialogResult ¶
func (r Response) DecodeFileDialogResult() (FileDialogResult, error)
DecodeFileDialogResult decodes a file-dialog response payload.
func (Response) DecodeIAPEntitlementsResult ¶ added in v0.2.0
func (r Response) DecodeIAPEntitlementsResult() (IAPEntitlementsResult, error)
DecodeIAPEntitlementsResult decodes a StoreKit restore/current-entitlements response payload.
func (Response) DecodeIAPManageSubscriptionsResult ¶ added in v0.2.0
func (r Response) DecodeIAPManageSubscriptionsResult() (IAPManageSubscriptionsResult, error)
DecodeIAPManageSubscriptionsResult decodes a StoreKit manage-subscriptions response payload.
func (Response) DecodeIAPProductsQueryResult ¶ added in v0.2.0
func (r Response) DecodeIAPProductsQueryResult() (IAPProductsQueryResult, error)
DecodeIAPProductsQueryResult decodes a StoreKit product query response payload.
func (Response) DecodeIAPPurchaseResult ¶ added in v0.2.0
func (r Response) DecodeIAPPurchaseResult() (IAPPurchaseResult, error)
DecodeIAPPurchaseResult decodes a StoreKit purchase response payload.
func (Response) DecodeJSON ¶
DecodeJSON decodes a shell response into the provided destination.
func (Response) DecodeRemotePushRegistrationResult ¶ added in v0.2.0
func (r Response) DecodeRemotePushRegistrationResult() (RemotePushRegistrationResult, error)
DecodeRemotePushRegistrationResult decodes an APNs registration response payload.
func (Response) DecodeSignInWithAppleResult ¶ added in v0.2.0
func (r Response) DecodeSignInWithAppleResult() (SignInWithAppleResult, error)
DecodeSignInWithAppleResult decodes a native Sign in with Apple response payload.
type SignInWithAppleOptions ¶ added in v0.2.0
type SignInWithAppleOptions struct {
Scopes []SignInWithAppleScope `json:"scopes,omitempty"`
Nonce string `json:"nonce,omitempty"`
State string `json:"state,omitempty"`
}
SignInWithAppleOptions configures a native Sign in with Apple request.
type SignInWithAppleResult ¶ added in v0.2.0
type SignInWithAppleResult struct {
UserID string `json:"userId,omitempty"`
IdentityToken string `json:"identityToken,omitempty"`
IdentityTokenBase64 string `json:"identityTokenBase64,omitempty"`
AuthorizationCode string `json:"authorizationCode,omitempty"`
AuthorizationCodeBase64 string `json:"authorizationCodeBase64,omitempty"`
Email string `json:"email,omitempty"`
GivenName string `json:"givenName,omitempty"`
FamilyName string `json:"familyName,omitempty"`
State string `json:"state,omitempty"`
AuthorizedScopes []SignInWithAppleScope `json:"authorizedScopes,omitempty"`
RealUserStatus string `json:"realUserStatus,omitempty"`
}
SignInWithAppleResult returns the credential payload emitted by the native iOS shell.
type SignInWithAppleScope ¶ added in v0.2.0
type SignInWithAppleScope string
SignInWithAppleScope identifies an Apple ID scope requested from the native shell.
const ( SignInWithAppleScopeEmail SignInWithAppleScope = "email" SignInWithAppleScopeFullName SignInWithAppleScope = "full_name" )
type UnsupportedError ¶
type UnsupportedError struct {
Operation string
}
UnsupportedError reports that a shell bridge or capability is unavailable.
func (*UnsupportedError) Error ¶
func (e *UnsupportedError) Error() string