Skip to content

Commit cc087da

Browse files
authored
Merge pull request #433 from jalopezcar/release_v2.1.6
Spotify iOS SDK v2.1.6
2 parents 8aec623 + eb59857 commit cc087da

File tree

170 files changed

+2286
-3616
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

170 files changed

+2286
-3616
lines changed

CHANGELOG.md

+24-1
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,45 @@
11
# Changelog
22

3+
## Spotify iOS SDK v2.1.6
4+
5+
What's New:
6+
7+
- Strip binary symbols
8+
9+
## Spotify iOS SDK v2.1.5
10+
11+
What's New:
12+
13+
- Migrate build system to Bazel
14+
315
## Spotify iOS SDK v2.1.4
16+
417
What's New:
18+
519
- Add support for raw scope string
620

721
## Spotify iOS SDK v2.1.3
22+
823
What's New:
24+
925
- Fix bug in the web authentication when using Universal Links in the redirect URI
1026

1127
## Spotify iOS SDK v2.1.2
28+
1229
What's New:
30+
1331
- Dismiss authentication screen when Spotify app is installed.
1432

1533
## Spotify iOS SDK v2.1.1
34+
1635
What's New:
36+
1737
- Added the new campaign parameter in the sample apps.
1838

1939
## Spotify iOS SDK v2.1.0
40+
2041
What's New:
42+
2143
- Expanded existing API with campaign parameter to allow consumers to specify details about where the auth flow was initiated
2244

2345
## Spotify iOS SDK v2.0.1
@@ -28,6 +50,7 @@ What's New:
2850
## Spotify iOS SDK v2.0.0
2951

3052
What's New:
53+
3154
- Added a completionHandler to authorizeAndPlayURI API
3255
- Support for pinned items in Your Library
3356
- Fix crash NSRangeException -[NSConcreteMutableData replaceBytesInRange:withBytes:length:]:
@@ -96,4 +119,4 @@ What's New
96119
What's New
97120

98121
- Initial iOS SDK release
99-
- Includes authentication and playback control capabilities
122+
- Includes authentication and playback control capabilities

DemoProjects/NowPlayingView/NowPlayingView.xcodeproj/project.pbxproj

+158-169
Large diffs are not rendered by default.

DemoProjects/NowPlayingView/NowPlayingView.xcodeproj/project.xcworkspace/contents.xcworkspacedata

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

DemoProjects/NowPlayingView/NowPlayingView.xcodeproj/xcshareddata/xcschemes/Demo Projects - NowPlayingView.xcscheme

-87
This file was deleted.

DemoProjects/NowPlayingView/NowPlayingView/Base.lproj/LaunchScreen.storyboard

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15E65" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
3+
<device id="retina6_12" orientation="portrait" appearance="light"/>
34
<dependencies>
45
<deployment identifier="iOS"/>
5-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
6+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22685"/>
7+
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
68
</dependencies>
79
<scenes>
810
<!--View Controller-->
@@ -14,9 +16,9 @@
1416
<viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
1517
</layoutGuides>
1618
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
17-
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
19+
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
1820
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
19-
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
21+
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
2022
</view>
2123
</viewController>
2224
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>

DemoProjects/NowPlayingView/NowPlayingView/ContentCollectionViewController.swift

+24-23
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import UIKit
2+
import SpotifyiOS
23

34
class ContentCollectionViewController : UICollectionViewController, UICollectionViewDelegateFlowLayout {
4-
5+
56
var containerItem: SPTAppRemoteContentItem? = nil {
67
didSet {
78
needsReload = true
@@ -15,12 +16,12 @@ class ContentCollectionViewController : UICollectionViewController, UICollection
1516
return (UIApplication.shared.connectedScenes.first?.delegate as? SceneDelegate)?.appRemote
1617
}
1718
}
18-
19+
1920
func loadContent() {
2021
guard needsReload == true else {
2122
return
2223
}
23-
24+
2425
if let container = containerItem {
2526
appRemote?.contentAPI?.fetchChildren(of: container) { (items, error) in
2627
if let contentItems = items as? [SPTAppRemoteContentItem] {
@@ -36,39 +37,39 @@ class ContentCollectionViewController : UICollectionViewController, UICollection
3637
self.collectionView?.reloadData()
3738
}
3839
}
39-
40+
4041
needsReload = false
4142
}
42-
43+
4344
override func viewWillAppear(_ animated: Bool) {
4445
super.viewWillAppear(animated)
45-
46+
4647
containerItem = nil
4748
}
48-
49+
4950
override func viewDidAppear(_ animated: Bool) {
5051
super.viewDidAppear(animated)
51-
52+
5253
self.navigationItem.title = containerItem?.title ?? "Spotify"
5354
loadContent()
5455
}
55-
56+
5657
// MARK: UICollectionViewDataSource
5758
override func numberOfSections(in collectionView: UICollectionView) -> Int {
5859
return 1
5960
}
60-
61+
6162
override func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
6263
return contentItems.count
6364
}
64-
65+
6566
override func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
6667
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "ContentItemCell", for: indexPath) as! ContentItemCell
6768
let item = contentItems[indexPath.item]
68-
69+
6970
cell.titleLabel?.text = item.title
7071
cell.subtitleLabel?.text = item.subtitle
71-
72+
7273
cell.imageView.image = nil
7374
appRemote?.imageAPI?.fetchImage(forItem: item, with: scaledSizeForCell(cell)) { (image, error) in
7475
guard let image = image as? UIImage, error == nil,
@@ -77,41 +78,41 @@ class ContentCollectionViewController : UICollectionViewController, UICollection
7778
}
7879
cell.imageView?.image = image
7980
}
80-
81+
8182
return cell
8283
}
83-
84+
8485
private func scaledSizeForCell(_ cell: UICollectionViewCell) -> CGSize {
8586
let scale = UIScreen.main.scale
8687
let size = cell.frame.size
8788
return CGSize(width: size.width * scale, height: size.height * scale)
8889
}
89-
90+
9091
// MARK: UICollectionViewDelegateFlowLayout
9192
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
9293
let width = collectionView.frame.width / 2.0
9394
return CGSize(width: width, height: width)
9495
}
95-
96+
9697
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumInteritemSpacingForSectionAt section: Int) -> CGFloat {
9798
return 0.0
9899
}
99-
100+
100101
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumLineSpacingForSectionAt section: Int) -> CGFloat {
101102
return 0.0
102103
}
103-
104+
104105
override func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
105106
guard let id = restorationIdentifier,
106-
let newVc = storyboard?.instantiateViewController(withIdentifier: id) as? ContentCollectionViewController else {
107+
let newVc = storyboard?.instantiateViewController(withIdentifier: id) as? ContentCollectionViewController else {
107108
return
108109
}
109-
110+
110111
let selectedItem = contentItems[indexPath.item]
111-
112+
112113
if selectedItem.isContainer {
113114
newVc.containerItem = selectedItem
114-
115+
115116
navigationController?.pushViewController(newVc, animated: true)
116117
} else {
117118
appRemote?.playerAPI?.play(selectedItem, callback: { [weak self = self] result, error in

DemoProjects/NowPlayingView/NowPlayingView/Info.plist

+4-2
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,13 @@
2323
<key>CFBundleURLTypes</key>
2424
<array>
2525
<dict>
26+
<key>CFBundleTypeRole</key>
27+
<string>Editor</string>
2628
<key>CFBundleURLName</key>
27-
<string>com.testappremote</string>
29+
<string></string>
2830
<key>CFBundleURLSchemes</key>
2931
<array>
30-
<string>comspotifytestsdk</string>
32+
<string>&lt;#URL_Scheme#&gt;</string>
3133
</array>
3234
</dict>
3335
</array>

DemoProjects/NowPlayingView/NowPlayingView/NowPlayingView-Bridging-Header.h

-5
This file was deleted.

DemoProjects/NowPlayingView/NowPlayingView/PlaybackButtonGraphics.swift

+10-10
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ import UIKit
33
class PlaybackButtonGraphics {
44
class func imageWithFilledPolygons(_ lines: [[CGPoint]]) -> UIImage {
55
let context = CGContext(data: nil,
6-
width: 64, height: 64,
7-
bitsPerComponent: 8, bytesPerRow: 8*64*4,
8-
space: CGColorSpaceCreateDeviceRGB(),
9-
bitmapInfo: CGImageAlphaInfo.premultipliedLast.rawValue);
6+
width: 64, height: 64,
7+
bitsPerComponent: 8, bytesPerRow: 8*64*4,
8+
space: CGColorSpaceCreateDeviceRGB(),
9+
bitmapInfo: CGImageAlphaInfo.premultipliedLast.rawValue);
1010

1111
let path = CGMutablePath()
1212
for linePoints in lines {
@@ -15,7 +15,7 @@ class PlaybackButtonGraphics {
1515

1616
context?.addPath(path)
1717
context?.fillPath()
18-
18+
1919
if let image = context?.makeImage() {
2020
return UIImage(cgImage: image, scale: UIScreen.main.scale, orientation: .up)
2121
}
@@ -28,7 +28,7 @@ class PlaybackButtonGraphics {
2828
CGPoint(x: 64, y: 32),
2929
CGPoint(x: 0, y: 64),
3030
CGPoint(x: 0, y: 0),
31-
]])
31+
]])
3232
}
3333

3434
class func nextButtonImage() -> UIImage {
@@ -59,10 +59,10 @@ class PlaybackButtonGraphics {
5959

6060
class func pauseButtonImage() -> UIImage {
6161
let context = CGContext(data: nil,
62-
width: 64, height: 64,
63-
bitsPerComponent: 8, bytesPerRow: 8*64*4,
64-
space: CGColorSpaceCreateDeviceRGB(),
65-
bitmapInfo: CGImageAlphaInfo.premultipliedLast.rawValue);
62+
width: 64, height: 64,
63+
bitsPerComponent: 8, bytesPerRow: 8*64*4,
64+
space: CGColorSpaceCreateDeviceRGB(),
65+
bitmapInfo: CGImageAlphaInfo.premultipliedLast.rawValue);
6666

6767
context?.fill(CGRect(x: 0, y: 0, width: 20, height: 64));
6868
context?.fill(CGRect(x: 44, y: 0, width: 20, height: 64));

DemoProjects/NowPlayingView/NowPlayingView/SceneDelegate.swift

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
import UIKit
2+
import SpotifyiOS
23

34
class SceneDelegate: UIResponder, UIWindowSceneDelegate,
4-
SPTAppRemoteDelegate {
5+
SPTAppRemoteDelegate {
56

6-
static private let kAccessTokenKey = "access-token-key"
7-
private let redirectUri = URL(string:"comspotifytestsdk://")!
87
private let clientIdentifier = "<#ClientID#>"
8+
private let redirectUri = URL(string:"<#RedirectURI#>")!
9+
10+
static private let kAccessTokenKey = "access-token-key"
911

1012
var window: UIWindow?
1113

0 commit comments

Comments
 (0)