first commit

This commit is contained in:
2026-03-10 16:18:05 +00:00
commit 11f9c069b5
31635 changed files with 3187747 additions and 0 deletions

30
node_modules/expo-linking/ios/ExpoLinking.podspec generated vendored Normal file
View File

@@ -0,0 +1,30 @@
require 'json'
package = JSON.parse(File.read(File.join(__dir__, '..', 'package.json')))
Pod::Spec.new do |s|
s.name = 'ExpoLinking'
s.version = package['version']
s.summary = package['description']
s.description = package['description']
s.license = package['license']
s.author = package['author']
s.homepage = package['homepage']
s.platforms = {
:ios => '15.1',
:tvos => '15.1',
:osx => '11.0'
}
s.source = { git: 'https://github.com/expo/expo.git' }
s.static_framework = true
s.dependency 'ExpoModulesCore'
# Swift/Objective-C compatibility
s.pod_target_xcconfig = {
'DEFINES_MODULE' => 'YES',
'SWIFT_COMPILATION_MODE' => 'wholemodule'
}
s.source_files = "**/*.{h,m,mm,swift,hpp,cpp}"
end

32
node_modules/expo-linking/ios/ExpoLinkingModule.swift generated vendored Normal file
View File

@@ -0,0 +1,32 @@
import ExpoModulesCore
let onURLReceived = "onURLReceived"
public let onURLReceivedNotification = Notification.Name(onURLReceived)
public class ExpoLinkingModule: Module {
public func definition() -> ModuleDefinition {
Name("ExpoLinking")
Events(onURLReceived)
OnStartObserving(onURLReceived) {
NotificationCenter.default.addObserver(self, selector: #selector(handleURLReceivedNotification), name: onURLReceivedNotification, object: nil)
}
OnStopObserving(onURLReceived) {
// swiftlint:disable:next notification_center_detachment
NotificationCenter.default.removeObserver(self)
}
Function("getLinkingURL") {
return ExpoLinkingRegistry.shared.initialURL?.absoluteString
}
}
@objc func handleURLReceivedNotification(_ notification: Notification) {
guard let url = notification.userInfo?["url"] as? URL else {
return
}
self.sendEvent(onURLReceived, ["url": url.absoluteString])
}
}

View File

@@ -0,0 +1,8 @@
typealias OnURLReceivedCallback = (URL) -> Void
class ExpoLinkingRegistry {
static let shared = ExpoLinkingRegistry()
var initialURL: URL?
private init() { }
}

View File

@@ -0,0 +1,38 @@
import ExpoModulesCore
public class LinkingAppDelegateSubscriber: ExpoAppDelegateSubscriber {
#if os(iOS) || os(tvOS)
public func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey: Any] = [:]) -> Bool {
ExpoLinkingRegistry.shared.initialURL = url
NotificationCenter.default.post(name: onURLReceivedNotification, object: self, userInfo: ["url": url])
return false
}
#elseif os(macOS)
public func application(_ application: NSApplication, open urls: [URL]) {
guard let url = urls.first else {
return
}
ExpoLinkingRegistry.shared.initialURL = url
NotificationCenter.default.post(name: onURLReceivedNotification, object: self, userInfo: ["url": url])
}
#endif
public func application(
_ application: UIApplication,
continue userActivity: NSUserActivity,
restorationHandler: @escaping ([any UIUserActivityRestoring]?) -> Void
) -> Bool {
// The URL can be nullish when launching App Clips from Test Flight without custom invocations set.
if userActivity.activityType == NSUserActivityTypeBrowsingWeb, let url = userActivity.webpageURL {
// App Clips and cold universal link launches don't appear to invoke application:open:options:
// so we'll use this first request to assume the initial URL.
if ExpoLinkingRegistry.shared.initialURL == nil {
ExpoLinkingRegistry.shared.initialURL = url
}
NotificationCenter.default.post(name: onURLReceivedNotification, object: self, userInfo: ["url": url])
return true
}
return false
}
}