Add a Lyft Button to Your iOS App in 4 Simple Steps

URX
3 min readMay 8, 2015

--

Here’s how to add a Lyft button to your iOS app in 4 simple steps.

  1. Download the URXSearch.framework file from the URX iOS SDK Github repo and drag it into your app in Xcode:

2. Add an ‘Obj-c’ Link Flagger in your Build Settings and add your URX API Key to your Info.plist file in Supporting Files. (Generate a URX API Key here.)

3. Add an IBAction method to your ViewController.m file to query the URX API

Copy and paste this 10-line code block into your ViewController.m file. The code creates a query against the URX API with a domain filter on Lyft.com. The query returns results from only Lyft and, when fired, the action resolves a user to the first Lyft result.

4. Create a UIButton in your Main.storyboard file in Xcode and hook it up to the buttonTapped: method in your ViewController class

Drag a UIButton onto your Main.storyboard, click the button and show the Connections Inspector:

Now select the “Touch Up Inside” event in the “Sent Events” section of your Connections Inspector, point it to your ViewController and select the buttonTapped action:

Now just re-build the app on your mobile device. Tapping the button you’ve created will resolve users into the Lyft native app if it is installed, or to Lyft.com on the mobile web if the Lyft app is not yet installed.

Please contact me at n@urx.com if you have any questions or if you’d like to chat about getting paid for this integration. Lyft is just one of over 100 apps in the URX index.

And let us know when your Lyft button goes live. We’re all about showing off URX integrations on our site and on our blog.

Other Helpful Links:

--

--