iOS - Open certain view controller with URL scheme

ios url scheme list
ios open app from url
ios launch app from url with parameters
ios url scheme not working
url scheme ios objective-c
ios custom url scheme deprecated
callback url scheme
mac app url scheme

I'm playing around with URL schemes in my app. I easily made one to open my app, just adding the necessary items to info.plist. This current URL "myappname://" takes the user to the initial view controller, FirstTableViewController, but I was wondering if it would be possible to modify that URL scheme so it I can have one that takes the user to a certain view controller, such as ThirdTableViewController. I would use this as a handy feature in something like Launch Center.

In ...AppDelegate.m

- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url {
MyViewController *controller = [[MyViewController alloc] initWithNibName:@"MyViewController" bundle:[NSBundle mainBundle]];
[self.viewController presentModalViewController:controller animated:YES];
[controller release];

return YES;        
}

Working with URL Schemes in iOS Apps, You can use a specific URL scheme to launch the built-in phone app and dial In iOS, when you present a view controller modally using the  Implement your custom URL Scheme in your Info.plist, then override the HandleOpenUrl method of your AppDelegate, and use the "url" parameter of the method to test and see what exactly it is. If it is the URL scheme you are looking for, then launch a specific view controller (using typical Xamarin.iOS controller stuff).

Try look at this: Custom Url Schemes

Hope this will be a useful

Implement custom URL scheme in iOS, Custom URL schemes is a great way to enable automation in your Open the "​ViewController.swift" file in the assistant editor by holding down option key while​  These URLs are known as custom URL schemes created by third-party apps. For iOS 9 and later, the app is not able to open these custom URLs. Apple has made a small change to the handling of URL scheme, specifically for the canOpenURL() method.

This post is a little old but maybe useful for iOS 5 + because the checked answer is not correct.

AppDelegate doesn't have any navigationController property.

Instead you can do in AppDelegate.m :

enter code here

- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url {
    MyViewController *controller = [[MyViewController alloc] initWithNibName:@"MyViewController" bundle:[NSBundle mainBundle]];
    UINavigationController *navController = (UINavigationController *)self.window.rootViewController;
    [navController presentModalViewController:controller animated:YES];

    return YES;        
}

Open Certain View Controller with Custom URL Scheme, Open Certain View Controller with Custom URL Scheme iOS. I'm trying to redirect users to a specific view after they are authenticated  Defining your app's custom URL scheme is all done in the Info.plist file. Click on the last line in the file and then click the "+" sign off to the right to add a new line. Select URL Types for the new item. Once that's added, click the grey arrow next to "URL Types" to show "Item 0".

Hi here is my solution.

If you can call your navigation function that called in "application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool" event (with a delay) you can navigate a specific page in the app even is not running before called.

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
        // Actived keyboard avoider
        changeAppereance()
        delay(1) {
            deeplink = Deeplink()
            self.manageNavigation(launchOptions: launchOptions)
            self.navigate()
        }

        return true

    }


    private func manageNavigation(launchOptions: [UIApplicationLaunchOptionsKey: Any]?) {
        if let url = launchOptions?[UIApplicationLaunchOptionsKey.url] as? URL { //Deeplink
            print(url.absoluteString)
            deeplink = Deeplink()
            deeplink?.url = url
        }
        else if let activityDictionary = launchOptions?[UIApplicationLaunchOptionsKey.userActivityDictionary] as? [AnyHashable: Any] { //Universal link
            for key in activityDictionary.keys {
                if let userActivity = activityDictionary[key] as? NSUserActivity {
                    if let url = userActivity.webpageURL {
                        deeplink = Deeplink()
                        deeplink?.url = url
                    }
                }
            }
        }

    }

open func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool {
        print(url.absoluteString)
        deeplink = Deeplink()
        deeplink?.url = url
        navigate()
        return true
    }

iOS: How to open Deep Links, Notifications and Shortcuts, Deep Links act the similar way, but it handles the custom URL schemes. First, create a simple project with a ViewController, Navigation title and s Switch To straighten the purpose of this article, when we open a specific app page, I will call​  Finding the URL scheme name, also known as a URI scheme, for a particular app is not easy. First, you have to download the IPA file for the app — a difficult task since the iTunes 12.7 update removed iOS apps from it. When you finally find the IPA, you have to turn it into a ZIP file,

Yes it is possible to modify URL scheme so that you can jump user to any viewcontroller.I used and implement normal as well as https://hokolinks.com/ deep link.By hoko link deep linking you can modify your URL Scheme ,also you can send data with that URL.

Integrate iOS SDK Using Hoko Link - Add a URL Scheme to your App - SDK Setup To integrate HOKO open source SDK in your app (only iOS 5 and higher) you just have to follow 3 simple steps (either using cocoapods or doing it manually).

Using CocoaPods

1- Install CocoaPods in your system

2- Open your Xcode project folder and create a file called Podfile with the following content:

pod 'Hoko', '~> 2.3.0' 3- Run pod install and wait for CocoaPods to install HOKO SDK. From this moment on, instead of using .xcodeproj file, you should start using .xcworkspace.

Manual integration

1- Download the Hoko SDK.

2- Drag the Hoko folder to your project.

3- Be sure to also add SystemConfiguration.framework and zlib.dylib in case your project does not include it already.

Integrating the SDK with your Swift project

Because the HOKO SDK is written in Objective-C, you’ll have to manually add a Bridging Header file into your project in order to use it with your Swift code:

1- File > New > File... > iOS > Source > Header File

2- Name that header file YourAppName-Bridging-Header.h

3- Inside that header file, import #import

4- Go to your project > Build Settings > Search for Objective-C Bridging Header > Add the path to your bridging header file, from your root folder (e.g. MyApp/MyApp-Bridging-Header.h)

Add a URL Scheme to your App

Next, we need to define your app’s custom URL type, if you don’t have one already. Open your Xcode project settings and under the "Info" tab expand the "URL Types" section. You can skip this step if you already configured a URL type.

If this section is empty, click in the "+" icon to add a new URL type. Let’s say that we want to open the app via "hoko://". Hence we need to enter "hoko" in URL Schemes.

We also should assign a unique Identifier to this URL type. Apple recommends that you use reverse DNS notation to ensure that there are no name collisions between types. In this example we are going to use "com.hoko.app".

Take note of your URL Scheme because we will ask you for it, when you are creating an app through the dashboard, e.g. "hoko".

URL Scheme

Setup Associated Domains (Universal Links) - iOS 9.0+

For your app to fully support the newly introduced Universal Links by Apple you’ll have to enable and add a new entry in the Associated Domains section, inside your application target’s Capabilities tab. Click on the ‘+’ button and add a new entry with the following value: applinks:myapp.hoko.link, being myapp the Hoko subdomain you chose for your app’s Hoko links. You can also have your own link domain (learn more about this on the subdomains section).

URL Scheme

SDK Setup

Add the following line to your applicationDidFinishLaunching method in your AppDelegate class (don’t forget to import the HOKO class by using #import if you’re working with Objective-C).

Objective-C Swift #import

- (BOOL)application:(UIApplication *)application
  didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
  [Hoko setupWithToken:@"YOUR-APP-TOKEN"];
 // The rest of your code goes here...

  return YES;
}

If you are using a custom domain in your smart links, you must setup the iOS SDK using setupWithToken:customDomain: as following:

Objective-C Swift #import

- (BOOL)application:(UIApplication *)application
  didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
  [Hoko setupWithToken:@"YOUR-APP-TOKEN"
     customDomain:@"your.custom.domain.com"];
  // The rest of your code goes here...

 return YES;

} NOTE: make sure to return YES in the application:didFinishLaunchingWithOptions: delegate method to allow incoming deep links that open your app to be processed. Returning NO will block the requests.

Setup your mobile deep linking by using Hoko Link SDK

How to make your app open with a custom URL scheme, Custom URL schemes allow your app to be launched from anywhere else in iOS will call a particular method on your app delegate whenever a URL is probably want to send that on to a view controller of your choosing. Creating URL Schemes: At the simplest level, a custom URL scheme allows users to open your app from other apps. But the true power of URL schemes is in the ability to perform specific actions as your app opens. Here are some examples, progressing from simple to complex: Open Flixster: flixster:// Open Simplenote and start a new note: simplenote

Handling deeplinks in your app – Donny Wals, Apps cannot check whether iOS can handle URL schemes that they haven't If you only want to open very specific URLs in your app, consider using a In step four, the target view controller is created and the navigation  In this article, I’ll show you how to launch native iOS apps from a URL on a web page and pass data to the app, as well as how to use the Smart App Banner feature (available in iOS 6 and later devices) to launch a specific app on the device (if it’s installed on the device) or redirect the user to the Apple Store to install the app (if it

Deep Linking at Scale on iOS – Just Eat Tech Hub, A naïve explanation would say that given some sort of input, mobile apps Deep linking to the mobile apps using the same URL should give a similar logic on mobile to show a UIViewController (iOS) or Activity (Android) to the any app that explicitly tries to open the app using custom URL schemes  If you want the user to exit your app and show a website in Safari, it's just one line of code in Swift. I'll make it three here because I'll create the URL in the code too, then safely unwrap it: if let url = URL(string: "https://www.hackingwithswift.com") { UIApplication.shared.open(url) }

How to use "deeplink" from custom payload to land user to a , Contribute to infobip/mobile-messaging-sdk-ios development by creating an account on Let's say we want to open viewControllers RedViewController com.infobip.mobilemessaging - custom URL scheme, usually can be opened through deeplink, to find viewController with specific deeplinkIdentifier. On iOS, the use cases are very similar: applications also make use of custom URL schemes to launch an application and then display a certain screen inside the app. To make a long story short: custom URLs are a great way to deep-link into your application !

Comments
  • Just what I needed I think. Thank you a ton for your help!
  • I'm getting the error that self.viewcontroller is not a property in AppDelegate. Is that a custom property you created? What are you doing with it?
  • Yeah I am getting this too, and it doesn't seem anyone answered this question.
  • As above AppDelegate doesn't have a viewContoller property
  • how will be this in swift?