Skip to content

Commit 6006fb6

Browse files
committed
add ios, macos
1 parent 088a796 commit 6006fb6

39 files changed

+1623
-14
lines changed

android/src/main/kotlin/com/example/native_linkify/NativeLinkifyBridge.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ import android.text.style.URLSpan
55
import android.text.util.Linkify
66

77
interface NativeLinkifyBridge {
8-
fun findLinks(text: String): List<LinkifyDTO>
8+
fun findLinks(text: String): List<LinkifyDto>
99
}
1010

11-
data class LinkifyDTO(val startIndex: Int, val endIndex: Int, val url: String) {
11+
data class LinkifyDto(val startIndex: Int, val endIndex: Int, val url: String) {
1212
fun toMap(): Map<String, Any> {
1313
return mapOf(
1414
"startIndex" to startIndex,
@@ -19,18 +19,18 @@ data class LinkifyDTO(val startIndex: Int, val endIndex: Int, val url: String) {
1919
}
2020

2121
class AndroidLinkifyBridge : NativeLinkifyBridge {
22-
override fun findLinks(text: String): List<LinkifyDTO> {
22+
override fun findLinks(text: String): List<LinkifyDto> {
2323
val spannableStringBuilder = SpannableStringBuilder(text)
2424
Linkify.addLinks(
2525
spannableStringBuilder,
2626
Linkify.EMAIL_ADDRESSES + Linkify.PHONE_NUMBERS + Linkify.WEB_URLS
2727
)
2828

2929
val spans = spannableStringBuilder.getSpans(0, text.length, URLSpan::class.java)
30-
val res = mutableListOf<LinkifyDTO>()
30+
val res = mutableListOf<LinkifyDto>()
3131
for (span in spans) {
3232
res.add(
33-
LinkifyDTO(
33+
LinkifyDto(
3434
spannableStringBuilder.getSpanStart(span),
3535
spannableStringBuilder.getSpanEnd(span),
3636
span.url

example/ios/Podfile.lock

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
PODS:
2+
- Flutter (1.0.0)
3+
- native_linkify (0.0.1):
4+
- Flutter
5+
6+
DEPENDENCIES:
7+
- Flutter (from `Flutter`)
8+
- native_linkify (from `.symlinks/plugins/native_linkify/ios`)
9+
10+
EXTERNAL SOURCES:
11+
Flutter:
12+
:path: Flutter
13+
native_linkify:
14+
:path: ".symlinks/plugins/native_linkify/ios"
15+
16+
SPEC CHECKSUMS:
17+
Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a
18+
native_linkify: 3bac7a7f29fadcc53b585c0862cb85d42caa2d85
19+
20+
PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c
21+
22+
COCOAPODS: 1.11.2

example/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
1111
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
1212
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
13+
79532E92AB1EFF592D47530A /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2F7CC09AEB80E177DF91A0D7 /* Pods_Runner.framework */; };
1314
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
1415
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
1516
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
@@ -31,7 +32,9 @@
3132
/* Begin PBXFileReference section */
3233
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
3334
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
35+
2F7CC09AEB80E177DF91A0D7 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
3436
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
37+
47E727B635A3DD7BEF27F3AD /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
3538
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
3639
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
3740
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
@@ -42,19 +45,41 @@
4245
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
4346
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
4447
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
48+
BE48DF5EA6930218FA6395E8 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
49+
D4CFB733CFC3F7D0AB010DF4 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
4550
/* End PBXFileReference section */
4651

4752
/* Begin PBXFrameworksBuildPhase section */
4853
97C146EB1CF9000F007C117D /* Frameworks */ = {
4954
isa = PBXFrameworksBuildPhase;
5055
buildActionMask = 2147483647;
5156
files = (
57+
79532E92AB1EFF592D47530A /* Pods_Runner.framework in Frameworks */,
5258
);
5359
runOnlyForDeploymentPostprocessing = 0;
5460
};
5561
/* End PBXFrameworksBuildPhase section */
5662

5763
/* Begin PBXGroup section */
64+
3615FCA960DFEFA4615FFC87 /* Frameworks */ = {
65+
isa = PBXGroup;
66+
children = (
67+
2F7CC09AEB80E177DF91A0D7 /* Pods_Runner.framework */,
68+
);
69+
name = Frameworks;
70+
sourceTree = "<group>";
71+
};
72+
7D8EE4055982E5AF3F5D3652 /* Pods */ = {
73+
isa = PBXGroup;
74+
children = (
75+
D4CFB733CFC3F7D0AB010DF4 /* Pods-Runner.debug.xcconfig */,
76+
BE48DF5EA6930218FA6395E8 /* Pods-Runner.release.xcconfig */,
77+
47E727B635A3DD7BEF27F3AD /* Pods-Runner.profile.xcconfig */,
78+
);
79+
name = Pods;
80+
path = Pods;
81+
sourceTree = "<group>";
82+
};
5883
9740EEB11CF90186004384FC /* Flutter */ = {
5984
isa = PBXGroup;
6085
children = (
@@ -72,6 +97,8 @@
7297
9740EEB11CF90186004384FC /* Flutter */,
7398
97C146F01CF9000F007C117D /* Runner */,
7499
97C146EF1CF9000F007C117D /* Products */,
100+
7D8EE4055982E5AF3F5D3652 /* Pods */,
101+
3615FCA960DFEFA4615FFC87 /* Frameworks */,
75102
);
76103
sourceTree = "<group>";
77104
};
@@ -105,12 +132,14 @@
105132
isa = PBXNativeTarget;
106133
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
107134
buildPhases = (
135+
08DAD21728C6F259C200F7B1 /* [CP] Check Pods Manifest.lock */,
108136
9740EEB61CF901F6004384FC /* Run Script */,
109137
97C146EA1CF9000F007C117D /* Sources */,
110138
97C146EB1CF9000F007C117D /* Frameworks */,
111139
97C146EC1CF9000F007C117D /* Resources */,
112140
9705A1C41CF9048500538489 /* Embed Frameworks */,
113141
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
142+
4D2213E2D89FC40B153E757C /* [CP] Embed Pods Frameworks */,
114143
);
115144
buildRules = (
116145
);
@@ -169,6 +198,28 @@
169198
/* End PBXResourcesBuildPhase section */
170199

171200
/* Begin PBXShellScriptBuildPhase section */
201+
08DAD21728C6F259C200F7B1 /* [CP] Check Pods Manifest.lock */ = {
202+
isa = PBXShellScriptBuildPhase;
203+
buildActionMask = 2147483647;
204+
files = (
205+
);
206+
inputFileListPaths = (
207+
);
208+
inputPaths = (
209+
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
210+
"${PODS_ROOT}/Manifest.lock",
211+
);
212+
name = "[CP] Check Pods Manifest.lock";
213+
outputFileListPaths = (
214+
);
215+
outputPaths = (
216+
"$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
217+
);
218+
runOnlyForDeploymentPostprocessing = 0;
219+
shellPath = /bin/sh;
220+
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
221+
showEnvVarsInLog = 0;
222+
};
172223
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
173224
isa = PBXShellScriptBuildPhase;
174225
buildActionMask = 2147483647;
@@ -183,6 +234,23 @@
183234
shellPath = /bin/sh;
184235
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
185236
};
237+
4D2213E2D89FC40B153E757C /* [CP] Embed Pods Frameworks */ = {
238+
isa = PBXShellScriptBuildPhase;
239+
buildActionMask = 2147483647;
240+
files = (
241+
);
242+
inputFileListPaths = (
243+
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
244+
);
245+
name = "[CP] Embed Pods Frameworks";
246+
outputFileListPaths = (
247+
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
248+
);
249+
runOnlyForDeploymentPostprocessing = 0;
250+
shellPath = /bin/sh;
251+
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
252+
showEnvVarsInLog = 0;
253+
};
186254
9740EEB61CF901F6004384FC /* Run Script */ = {
187255
isa = PBXShellScriptBuildPhase;
188256
buildActionMask = 2147483647;

example/ios/Runner.xcworkspace/contents.xcworkspacedata

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/macos/.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Flutter-related
2+
**/Flutter/ephemeral/
3+
**/Pods/
4+
5+
# Xcode-related
6+
**/dgph
7+
**/xcuserdata/
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
2+
#include "ephemeral/Flutter-Generated.xcconfig"
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
2+
#include "ephemeral/Flutter-Generated.xcconfig"
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
//
2+
// Generated file. Do not edit.
3+
//
4+
5+
import FlutterMacOS
6+
import Foundation
7+
8+
import native_linkify
9+
10+
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
11+
NativeLinkifyPlugin.register(with: registry.registrar(forPlugin: "NativeLinkifyPlugin"))
12+
}

example/macos/Podfile

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
platform :osx, '10.11'
2+
3+
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
4+
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
5+
6+
project 'Runner', {
7+
'Debug' => :debug,
8+
'Profile' => :release,
9+
'Release' => :release,
10+
}
11+
12+
def flutter_root
13+
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__)
14+
unless File.exist?(generated_xcode_build_settings_path)
15+
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first"
16+
end
17+
18+
File.foreach(generated_xcode_build_settings_path) do |line|
19+
matches = line.match(/FLUTTER_ROOT\=(.*)/)
20+
return matches[1].strip if matches
21+
end
22+
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\""
23+
end
24+
25+
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
26+
27+
flutter_macos_podfile_setup
28+
29+
target 'Runner' do
30+
use_frameworks!
31+
use_modular_headers!
32+
33+
flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__))
34+
end
35+
36+
post_install do |installer|
37+
installer.pods_project.targets.each do |target|
38+
flutter_additional_macos_build_settings(target)
39+
end
40+
end

example/macos/Podfile.lock

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
PODS:
2+
- FlutterMacOS (1.0.0)
3+
- native_linkify (0.0.1):
4+
- FlutterMacOS
5+
6+
DEPENDENCIES:
7+
- FlutterMacOS (from `Flutter/ephemeral`)
8+
- native_linkify (from `Flutter/ephemeral/.symlinks/plugins/native_linkify/macos`)
9+
10+
EXTERNAL SOURCES:
11+
FlutterMacOS:
12+
:path: Flutter/ephemeral
13+
native_linkify:
14+
:path: Flutter/ephemeral/.symlinks/plugins/native_linkify/macos
15+
16+
SPEC CHECKSUMS:
17+
FlutterMacOS: 57701585bf7de1b3fc2bb61f6378d73bbdea8424
18+
native_linkify: da23a9f934a3aac218acd598b7cc9f0eb244531c
19+
20+
PODFILE CHECKSUM: 6eac6b3292e5142cfc23bdeb71848a40ec51c14c
21+
22+
COCOAPODS: 1.11.2

0 commit comments

Comments
 (0)