Skip to content

Commit

Permalink
final changes on iOS side
Browse files Browse the repository at this point in the history
  • Loading branch information
quetool committed Jan 23, 2024
1 parent 5a9ab54 commit 99612aa
Show file tree
Hide file tree
Showing 13 changed files with 382 additions and 296 deletions.
27 changes: 20 additions & 7 deletions example/wallet/ios/Runner/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,35 @@ import Flutter
methodsChannel = FlutterMethodChannel(name: AppDelegate.METHODS_CHANNEL, binaryMessenger: controller.binaryMessenger)
methodsChannel?.setMethodCallHandler({ [weak self] (call: FlutterMethodCall, result: FlutterResult) -> Void in
if (call.method == "initialLink") {
print("\(String(describing: launchOptions))")
if let link = self?.initialLink {
self?.initialLink = nil
let _ = self?.linkStreamHandler.handleLink(link)
return
}
}
})

// Add your deep link handling logic here
if let url = launchOptions?[.url] as? URL {
self.initialLink = url.absoluteString
}

return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}

override func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
print("open url \(url)")
return linkStreamHandler.handleLink(url.absoluteString)
}
//
// override func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool {
// print("\(userActivity)")
// return true
// }

override func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool {
// Handle universal links
if userActivity.activityType == NSUserActivityTypeBrowsingWeb {
if let url = userActivity.webpageURL {
return linkStreamHandler.handleLink(url.absoluteString)
}
}
return false
}
}

class LinkStreamHandler: NSObject, FlutterStreamHandler {
Expand Down
8 changes: 6 additions & 2 deletions example/wallet/ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,11 @@
</array>
</dict>
</array>
<key>FlutterDeepLinkingEnabled</key>
<true/>
<key>FlutterDeepLinkingEnabled</key>
<true/>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>web3modalflutter</string>
</array>
</dict>
</plist>
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,19 @@ class BottomSheetListenerState extends State<BottomSheetListener> {
builder: (context) {
return Container(
decoration: const BoxDecoration(
color: StyleConstants.lightGray,
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(
StyleConstants.linear16,
),
),
),
padding: const EdgeInsets.all(
StyleConstants.linear16,
padding: EdgeInsets.only(
top: StyleConstants.linear16,
left: StyleConstants.linear16,
right: StyleConstants.linear16,
bottom: MediaQuery.of(context).viewInsets.bottom +
StyleConstants.linear16,
),
margin: const EdgeInsets.all(
StyleConstants.linear16,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ class BottomSheetQueueItem {
abstract class IBottomSheetService {
abstract final ValueNotifier<BottomSheetQueueItem?> currentSheet;

Future<dynamic> queueBottomSheet({
required Widget widget,
});
Future<dynamic> queueBottomSheet({required Widget widget});

void showNext();
}
Loading

0 comments on commit 99612aa

Please sign in to comment.