Skip to content

Commit

Permalink
Merge in branch dev-0.5.x for 0.5.3 Release
Browse files Browse the repository at this point in the history
  • Loading branch information
John Brophy committed Nov 18, 2016
2 parents a126ee7 + 2b99da1 commit ca6262c
Show file tree
Hide file tree
Showing 46 changed files with 475 additions and 367 deletions.
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# Change Log

## [0.5.3]

This will be the final release using Swift 2.2

### Fixed

- [Issue #51](https://github.com/uber/rides-ios-sdk/issues/51) Added Information about Server Token in README
- [Issue #58](https://github.com/uber/rides-ios-sdk/issues/58) Updated README examples to correctly use pickup & dropoff
- [Issue #76](https://github.com/uber/rides-ios-sdk/issues/76) Update Ride Request Button Delegate to always fire. The RideRequestButtonDelegate will now always fire `didLoadRideInformation` once information has been loaded. Including if it encounters an error. Any errors that are encountered will still fire `didReceiveError`. `didReceiveError` will always be called before `didLoadRideInformation`
- [Issue #86](https://github.com/uber/rides-ios-sdk/issues/86) via [Pull #114](https://github.com/uber/rides-ios-sdk/pull/114) Fix RideScope not mapping for all cases
- [Issue #94](https://github.com/uber/rides-ios-sdk/issues/94) Make ride status available in Objective-C
- [Issue #127](https://github.com/uber/rides-ios-sdk/issues/127) Shared Credentials across iOS app and extension

- [Pull #105](https://github.com/uber/rides-ios-sdk/pull/105) Fixing typos
- [Pull #72](https://github.com/uber/rides-ios-sdk/pull/72) Updates to make README more clear
- [Pull #73](https://github.com/uber/rides-ios-sdk/pull/73) Updates to README about info.plist
- [Pull #65](https://github.com/uber/rides-ios-sdk/pull/65) Example of how to run samples without Carthage

## [0.5.2] 2016-08-2
### Added
The Ride Request Widget now attempts to refresh expired access tokens automatically. If you are using the RideRequestViewController, the SDK will attempt to hit the Refresh endpoint with your current Access Token's Refresh Token. If that fails, the user will be redirected to the appropriate login
Expand Down
4 changes: 2 additions & 2 deletions Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
github "AliSoftware/OHHTTPStubs" "5.1.0"
github "Hearst-DD/ObjectMapper" "1.3.0"
github "AliSoftware/OHHTTPStubs" "5.2.2"
github "Hearst-DD/ObjectMapper" "1.5.0"
2 changes: 1 addition & 1 deletion Carthage/Checkouts/OHHTTPStubs
Submodule OHHTTPStubs updated 40 files
+26 −8 .travis.yml
+98 −35 CHANGELOG.md
+6 −1 Examples/ObjC/OHHTTPStubsDemo.xcodeproj/project.pbxproj
+9 −9 Examples/ObjC/Podfile.lock
+0 −1 Examples/ObjC/Pods/Headers/Private/OHHTTPStubs/NSMutableURLRequest+HTTPBodyTesting.h
+1 −0 Examples/ObjC/Pods/Headers/Private/OHHTTPStubs/NSURLRequest+HTTPBodyTesting.h
+0 −1 Examples/ObjC/Pods/Headers/Public/OHHTTPStubs/NSMutableURLRequest+HTTPBodyTesting.h
+1 −0 Examples/ObjC/Pods/Headers/Public/OHHTTPStubs/NSURLRequest+HTTPBodyTesting.h
+2 −2 Examples/ObjC/Pods/Local Podspecs/OHHTTPStubs.podspec.json
+9 −9 Examples/ObjC/Pods/Manifest.lock
+186 −174 Examples/ObjC/Pods/Pods.xcodeproj/project.pbxproj
+2 −0 Examples/ObjC/Pods/Target Support Files/Pods-OHHTTPStubsDemo/Pods-OHHTTPStubsDemo-acknowledgements.plist
+2 −8 Examples/ObjC/Pods/Target Support Files/Pods-OHHTTPStubsDemo/Pods-OHHTTPStubsDemo-resources.sh
+1 −0 Examples/ObjC/Pods/Target Support Files/Pods-OHHTTPStubsDemo/Pods-OHHTTPStubsDemo.debug.xcconfig
+1 −0 Examples/ObjC/Pods/Target Support Files/Pods-OHHTTPStubsDemo/Pods-OHHTTPStubsDemo.release.xcconfig
+4 −1 Examples/Swift/OHHTTPStubsDemo.xcodeproj/project.pbxproj
+10 −10 Examples/Swift/Podfile.lock
+2 −2 Examples/Swift/Pods/Local Podspecs/OHHTTPStubs.podspec.json
+10 −10 Examples/Swift/Pods/Manifest.lock
+151 −137 Examples/Swift/Pods/Pods.xcodeproj/project.pbxproj
+1 −1 Examples/Swift/Pods/Target Support Files/OHHTTPStubs/Info.plist
+3 −1 Examples/Swift/Pods/Target Support Files/OHHTTPStubs/OHHTTPStubs-umbrella.h
+2 −0 Examples/Swift/Pods/Target Support Files/Pods-OHHTTPStubsDemo/Pods-OHHTTPStubsDemo-acknowledgements.plist
+2 −8 Examples/Swift/Pods/Target Support Files/Pods-OHHTTPStubsDemo/Pods-OHHTTPStubsDemo-resources.sh
+2 −0 Examples/Swift/Pods/Target Support Files/Pods-OHHTTPStubsDemo/Pods-OHHTTPStubsDemo-umbrella.h
+1 −0 Examples/Swift/Pods/Target Support Files/Pods-OHHTTPStubsDemo/Pods-OHHTTPStubsDemo.debug.xcconfig
+1 −0 Examples/Swift/Pods/Target Support Files/Pods-OHHTTPStubsDemo/Pods-OHHTTPStubsDemo.release.xcconfig
+1 −1 OHHTTPStubs.podspec
+36 −41 OHHTTPStubs/OHHTTPStubs.xcodeproj/project.pbxproj
+1 −1 OHHTTPStubs/OHHTTPStubs.xcodeproj/xcshareddata/xcschemes/OHHTTPStubs Mac Framework.xcscheme
+1 −1 OHHTTPStubs/OHHTTPStubs.xcodeproj/xcshareddata/xcschemes/OHHTTPStubs iOS Framework.xcscheme
+1 −1 OHHTTPStubs/OHHTTPStubs.xcodeproj/xcshareddata/xcschemes/OHHTTPStubs iOS StaticLib.xcscheme
+1 −1 OHHTTPStubs/OHHTTPStubs.xcodeproj/xcshareddata/xcschemes/OHHTTPStubs tvOS Framework.xcscheme
+2 −2 OHHTTPStubs/Sources/HTTPMessage/OHHTTPStubsResponse+HTTPMessage.h
+2 −0 OHHTTPStubs/Sources/NSURLSession/NSURLRequest+HTTPBodyTesting.m
+2 −2 OHHTTPStubs/Sources/OHHTTPStubsResponse.h
+91 −25 OHHTTPStubs/Sources/Swift/OHHTTPStubsSwift.swift
+107 −13 OHHTTPStubs/UnitTests/Test Suites/SwiftHelpersTests.swift
+104 −26 README.md
+9 −7 Rakefile
2 changes: 1 addition & 1 deletion Carthage/Checkouts/ObjectMapper
61 changes: 51 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ Now build your project and everything should be good to go!

### Configuring iOS 9.0

If you are compiling on iOS SDK 9.0, you will need to modify your application’s `plist` to handle Apple’s [new security changes](https://developer.apple.com/videos/wwdc/2015/?id=703) to the `canOpenURL` function.
If you are compiling on iOS SDK 9.0, you will need to modify your application’s `plist` to handle Apple’s [new security changes](https://developer.apple.com/videos/wwdc/2015/?id=703) to the `canOpenURL` function. Locate the **Info.plist** file for your application. Usually found in the **Supporting Files** folder. Right-click this file and select **Open As > Source Code**

```
<key>LSApplicationQueriesSchemes</key>
Expand All @@ -121,11 +121,13 @@ This will allow the Uber iOS integration to properly identify and switch to the
## SDK Configuration
In order for the SDK to function correctly, you need to add some information about your app. Locate the **Info.plist** file for your application. Usually found in the **Supporting Files** folder. Right-click this file and select **Open As > Source Code**

Add the following code snippet, replacing the placeholders with your app’s information from the developer dashboard.
Add the following code snippet, replacing the placeholders within the square brackets (`[]`) with your app’s information from the developer dashboard. (Note: Do not include the square brackets)

```
<key>UberClientID</key>
<string>[ClientID]</string>
<key>UberServerToken<key>
<string>[Server Token]</string>
<key>UberDisplayName</key>
<string>[App Name]</string>
<key>UberCallbackURIs</key>
Expand All @@ -134,13 +136,15 @@ Add the following code snippet, replacing the placeholders with your app’s inf
<key>UberCallbackURIType</key>
<string>General</string>
<key>URIString</key>
<string>callback://your_callback_uri</string>
<string>[callback://your_callback_uri]</string>
</dict>
</array>
```

Make sure the value for UberCallbackURI exactly matches one of the Redirect URLs you have set on your developer dashboard. (You can use `localhost` for testing.)

**Note:** Your `Server Token` is used to make [Price](https://developer.uber.com/docs/rides/api/v1-estimates-price) & [Time](https://developer.uber.com/docs/rides/api/v1-estimates-time) estimates when your user hasn't authenticated with Uber yet. We suggest adding it in your `Info.plist` only if you need to get estimates before your user logs in.

You can also define specific callback URIs for different login types. For example, if you want to use Native login, but also support a fallback to Authorization Code Grant, you can define a callback to your app AND a callback for your server:

```
Expand All @@ -150,19 +154,19 @@ You can also define specific callback URIs for different login types. For exampl
<key>UberCallbackURIType</key>
<string>General</string>
<key>URIString</key>
<string>callback://your_callback_uri</string>
<string>[callback://your_callback_uri]</string>
</dict>
<dict>
<key>UberCallbackURIType</key>
<string>AuthorizationCode</string>
<key>URIString</key>
<string>callback://authorization_code_uri</string>
<string>[callback://authorization_code_uri]</string>
</dict>
<dict>
<key>UberCallbackURIType</key>
<string>Native</string>
<key>URIString</key>
<string>myApp://native_deeplink_callback</string>
<string>[myApp://native_deeplink_callback]</string>
</dict>
</array>
```
Expand All @@ -172,6 +176,9 @@ Additionally, the SDK provides a static Configuration class to further customize

```swift
// Don’t forget to import UberRides
import UberRides
// ...

// Swift
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// China based apps should specify the region
Expand All @@ -186,6 +193,10 @@ func application(application: UIApplication, didFinishLaunchingWithOptions launc
```

```objective-c
// Don’t forget to import UberRides
#import <UberRides/UberRides-Swift.h>
// ...

// Objective-C
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// China based apps should specify the region
Expand Down Expand Up @@ -298,7 +309,7 @@ You can optionally set a `LoginButtonDelegate` to handle logging in / logging ou

```swift
// Swift
let scopes = [.Profile, .Places, .Request]
let scopes: [RidesScope] = [.Profile, .Places, .Request]
let loginManager = LoginManager(loginType: .Native)
let loginButton = LoginButton(frame: CGRectZero, scopes: scopes, loginManager: loginManager)
loginButton.presentingViewController = self
Expand Down Expand Up @@ -365,7 +376,8 @@ let button = RideRequestButton()
let ridesClient = RidesClient()
let pickupLocation = CLLocation(latitude: 37.787654, longitude: -122.402760)
let dropoffLocation = CLLocation(latitude: 37.775200, longitude: -122.417587)
let builder = RideParametersBuilder().setPickupLocation(pickupLocation).setDropoffLocation(dropoffLocation)
let dropoffNickname = "Work"
let builder = RideParametersBuilder().setPickupLocation(pickupLocation).setDropoffLocation(dropoffLocation, nickname: dropoffNickname)
ridesClient.fetchCheapestProduct(pickupLocation: pickupLocation, completion: {
product, response in
if let productID = product?.productID {
Expand All @@ -382,9 +394,10 @@ UBSDKRideRequestButton *button = [[UBSDKRideRequestButton alloc] init];
UBSDKRidesClient *ridesClient = [[UBSDKRidesClient alloc] init];
CLLocation *pickupLocation = [[CLLocation alloc] initWithLatitude: 37.787654 longitude: -122.402760];
CLLocation *dropoffLocation = [[CLLocation alloc] initWithLatitude: 37.775200 longitude: -122.417587];
NSString *dropoffNickname = @"Work";
__block UBSDKRideParametersBuilder *builder = [[UBSDKRideParametersBuilder alloc] init];
builder = [builder setPickupLocation: pickupLocation];
builder = [builder setDropoffLocation: dropoffLocation];
builder = [builder setDropoffLocation: dropoffLocation nickname: dropoffNickname];
[ridesClient fetchCheapestProductWithPickupLocation: pickupLocation completion:^(UBSDKUberProduct* _Nullable product, UBSDKResponse* _Nullable response) {
if (product) {
builder = [builder setProductID: product.productID];
Expand Down Expand Up @@ -919,13 +932,41 @@ extension your_class : RideRequestViewControllerDelegate {

## Example Apps

Example apps can be found in the `examples` folder. To run build them, you need to use Carthage. (A quick overview of installing Carthage can be found in the **Getting Started** section.) From inside the `examples/Swift SDK` or `examples/Obj-C SDK` folder, run:
Example apps can be found in the `examples` folder. To run build them, you can use Carthage or Cocoapods.

### Carthage
(A quick overview of installing Carthage can be found in the **Getting Started** section.) From inside the `examples/Swift SDK` or `examples/Obj-C SDK` folder, run:

```
carthage update --platform iOS
```
This will build the required dependencies. Once you do that, open `Swift SDK.xcodeproj` or `Obj-C SDK.xcodeproj` in Xcode and run it.

### CocoaPods
First, you will have to remove Carthage dependencies. Navigate to `examples/Swift SDK` or `examples/Obj-C SDK` and remove `Cartfile` and `Cartfile.resolved`. If you see a `Carthage` folder, remove that as well. Open .xcworkspace and navigate to **General** tab, scroll to **Embedded Binaries** select `ObjectMapper.framework` and click the `-` button, do the same for `UberRides.framework`. Now go to **Build Settings** tab and scroll to **Search Paths**, click on **Framework Search Paths** and remove the line $(PROJECT_DIR)/Carthage/Build/iOS.
Now go to **Build Phases** find the **Copy Carthage Frameworks** and remove it.

Now, still inside either `examples/Swift SDK` or `examples/Obj-C SDK`, create a new **Podfile** by running `pod init`, then add `pod 'UberRides'` to your main target. If you are using the Swift SDK, make sure to add the line `use_frameworks!`. Your **Podfile** should look something like this:


```ruby
use_frameworks!

target 'Your Project Name' do
pod 'UberRides'
end
```

Then, run the following command to install the dependency:

```bash
$ pod install
```

For Objective-C projects, set the **Embedded Content Contains Swift Code** flag in your project to **Yes** (found under **Build Options** in the **Build Settings** tab).

Now you can build the project.

Don’t forget to set `UberClientID`, `UberDisplayName`, and `UberCallbackURIs` in your `Info.plist` file.

<p align="center">
Expand Down
2 changes: 1 addition & 1 deletion UberRides.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = "UberRides"
s.version = "0.5.2"
s.version = "0.5.3"
s.summary = "The Official Uber Rides iOS SDK."
s.description = <<-DESC
This Swift library allows you to integrate Uber into your iOS app. It is designed to make it quick and easy to add a 'Request a Ride' button in your application, seamlessly connecting your users with Uber.
Expand Down
2 changes: 0 additions & 2 deletions examples/Obj-C SDK/Cartfile.resolved

This file was deleted.

2 changes: 0 additions & 2 deletions examples/Swift SDK/Cartfile.resolved

This file was deleted.

Loading

0 comments on commit ca6262c

Please sign in to comment.