Skip to content

Commit

Permalink
Spotify iOS SDK 2.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
jalopezcar committed Jul 15, 2024
1 parent f0c0239 commit 567a7d0
Show file tree
Hide file tree
Showing 54 changed files with 180 additions and 70 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## Spotify iOS SDK v2.1.3
What's New:
- Fix bug in the web authentication when using Universal Links in the redirect URI

## Spotify iOS SDK v2.1.2
What's New:
- Dismiss authentication screen when Spotify app is installed.
Expand Down
12 changes: 9 additions & 3 deletions DemoProjects/SPTLoginSampleApp/SPTLoginSampleApp/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,15 @@ - (BOOL)application:(UIApplication *)application
openURL:(NSURL *)URL
options:(NSDictionary<UIApplicationOpenURLOptionsKey, id> *)options
{
[self.rootViewController.sessionManager application:application openURL:URL options:options];
NSLog(@"%@ %@", URL, options);
return YES;
// Use this method if your SpotifyRedirectURL is a native deeplink
return [self.rootViewController.sessionManager application:application openURL:URL options:options];
}

- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray<id<UIUserActivityRestoring>> * _Nullable))restorationHandler {
// Use this method if your SpotifyRedirectURL is an universal link (https/http)
return [self.rootViewController.sessionManager application:application
continueUserActivity:userActivity
restorationHandler:restorationHandler];
}

@end
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@

/* Begin PBXFileReference section */
12EE828B2BCD4536003F62A0 /* SpotifyiOS.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = SpotifyiOS.xcframework; path = ../../SpotifyiOS.xcframework; sourceTree = "<group>"; };
5413459E20D1049200FD05F7 /* SPTLoginSampleAppSwift-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SPTLoginSampleAppSwift-Bridging-Header.h"; sourceTree = "<group>"; };
54AC7EDC20081243008CD692 /* SPTLoginSampleAppSwift.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SPTLoginSampleAppSwift.app; sourceTree = BUILT_PRODUCTS_DIR; };
54AC7EDF20081243008CD692 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
54AC7EE120081243008CD692 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -88,7 +87,6 @@
54AC7EE620081243008CD692 /* Assets.xcassets */,
54AC7EE820081243008CD692 /* LaunchScreen.storyboard */,
54AC7EEB20081243008CD692 /* Info.plist */,
5413459E20D1049200FD05F7 /* SPTLoginSampleAppSwift-Bridging-Header.h */,
);
path = SPTLoginSampleAppSwift;
sourceTree = "<group>";
Expand Down Expand Up @@ -247,7 +245,6 @@
OTHER_LDFLAGS = "-ObjC";
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OBJC_BRIDGING_HEADER = "SPTLoginSampleAppSwift/SPTLoginSampleAppSwift-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
};
name = Debug;
Expand Down Expand Up @@ -305,7 +302,6 @@
OTHER_LDFLAGS = "-ObjC";
SDKROOT = iphoneos;
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OBJC_BRIDGING_HEADER = "SPTLoginSampleAppSwift/SPTLoginSampleAppSwift-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-O";
VALIDATE_PRODUCT = YES;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,15 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
}

func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
rootViewController.sessionManager.application(app, open: url, options: options)
return true
// Use this method if your SpotifyRedirectURL is a native deeplink
return rootViewController.sessionManager.application(app, open: url, options: options)
}

func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([any UIUserActivityRestoring]?) -> Void) -> Bool {
// Use this method if your SpotifyRedirectURL is an universal link (https/http)
return rootViewController.sessionManager.application(application, continue: userActivity, restorationHandler: restorationHandler)
}

func applicationWillResignActive(_ application: UIApplication) {
if (rootViewController.appRemote.isConnected) {
rootViewController.appRemote.disconnect()
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import UIKit
import SpotifyiOS

class ViewController: UIViewController, SPTSessionManagerDelegate, SPTAppRemoteDelegate, SPTAppRemotePlayerStateDelegate {

Expand Down
14 changes: 11 additions & 3 deletions SpotifyiOS.framework/Versions/A/Headers/SPTSessionManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,17 @@ typedef NSString * const SPTAuthorizationCode;
@param options The options passed in to the matching `AppDelegate` method
@return Returns `YES` if `SPTSessionManager` recognizes the URL and will attempt to parse an access token, otherwise returns `NO`.
*/
- (BOOL)application:(UIApplication *)application
openURL:(NSURL *)URL
options:(NSDictionary<UIApplicationOpenURLOptionsKey, id> *)options;
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)URL options:(NSDictionary<UIApplicationOpenURLOptionsKey, id> *)options;

/**
Handle continueUserActivity callbacks from the `AppDelegate`
@param application The `UIApplication` passed into the matching `AppDelegate` method
@param userActivity An object encapsulating a user activity supported by this responder.
@param restorationHandler A block to execute if your app creates objects to perform the task the user was performing
@return Returns `YES` if `SPTSessionManager` recognizes the URL and will attempt to parse an access token, otherwise returns `NO`.
*/
- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void(^)(NSArray<id<UIUserActivityRestoring>> * __nullable restorableObjects))restorationHandler;

@end

Expand Down
Binary file modified SpotifyiOS.framework/Versions/A/SpotifyiOS
Binary file not shown.
10 changes: 5 additions & 5 deletions SpotifyiOS.xcframework/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,32 @@
<key>BinaryPath</key>
<string>SpotifyiOS.framework/SpotifyiOS</string>
<key>LibraryIdentifier</key>
<string>ios-arm64_x86_64-simulator</string>
<string>ios-arm64</string>
<key>LibraryPath</key>
<string>SpotifyiOS.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
<dict>
<key>BinaryPath</key>
<string>SpotifyiOS.framework/SpotifyiOS</string>
<key>LibraryIdentifier</key>
<string>ios-arm64</string>
<string>ios-arm64_x86_64-simulator</string>
<key>LibraryPath</key>
<string>SpotifyiOS.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
</array>
<key>CFBundlePackageType</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,17 @@ typedef NSString * const SPTAuthorizationCode;
@param options The options passed in to the matching `AppDelegate` method
@return Returns `YES` if `SPTSessionManager` recognizes the URL and will attempt to parse an access token, otherwise returns `NO`.
*/
- (BOOL)application:(UIApplication *)application
openURL:(NSURL *)URL
options:(NSDictionary<UIApplicationOpenURLOptionsKey, id> *)options;
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)URL options:(NSDictionary<UIApplicationOpenURLOptionsKey, id> *)options;

/**
Handle continueUserActivity callbacks from the `AppDelegate`
@param application The `UIApplication` passed into the matching `AppDelegate` method
@param userActivity An object encapsulating a user activity supported by this responder.
@param restorationHandler A block to execute if your app creates objects to perform the task the user was performing
@return Returns `YES` if `SPTSessionManager` recognizes the URL and will attempt to parse an access token, otherwise returns `NO`.
*/
- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void(^)(NSArray<id<UIUserActivityRestoring>> * __nullable restorableObjects))restorationHandler;

@end

Expand Down
Binary file modified SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/SpotifyiOS
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,17 @@ typedef NSString * const SPTAuthorizationCode;
@param options The options passed in to the matching `AppDelegate` method
@return Returns `YES` if `SPTSessionManager` recognizes the URL and will attempt to parse an access token, otherwise returns `NO`.
*/
- (BOOL)application:(UIApplication *)application
openURL:(NSURL *)URL
options:(NSDictionary<UIApplicationOpenURLOptionsKey, id> *)options;
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)URL options:(NSDictionary<UIApplicationOpenURLOptionsKey, id> *)options;

/**
Handle continueUserActivity callbacks from the `AppDelegate`
@param application The `UIApplication` passed into the matching `AppDelegate` method
@param userActivity An object encapsulating a user activity supported by this responder.
@param restorationHandler A block to execute if your app creates objects to perform the task the user was performing
@return Returns `YES` if `SPTSessionManager` recognizes the URL and will attempt to parse an access token, otherwise returns `NO`.
*/
- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void(^)(NSArray<id<UIUserActivityRestoring>> * __nullable restorableObjects))restorationHandler;

@end

Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
</data>
<key>Headers/SPTSessionManager.h</key>
<data>
SBxEZidPSxu0kqTbIjqSsm5a77Y=
rai/PC+ZQFztLKBArW5cdy62CmY=
</data>
<key>Headers/SpotifyAppRemote.h</key>
<data>
Expand Down Expand Up @@ -332,7 +332,7 @@
<dict>
<key>hash2</key>
<data>
Wldpc0wHvSO51aH3GNEzkjoNiJ6dahRIY18k3tOBxbY=
+NUHlxSqOqjmXLYO7IpjGmFXc8zaq9pI7L/82/PJCcc=
</data>
</dict>
<key>Headers/SpotifyAppRemote.h</key>
Expand Down
11 changes: 10 additions & 1 deletion docs/auth.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,19 @@ The main entry point for authentication if you need to authorize without startin
```objective-c
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)URL options:(NSDictionary<UIApplicationOpenURLOptionsKey, id> *)options
{
[self.sessionManager application:application openURL:URL options:options];
return [self.sessionManager application:application openURL:URL options:options];
}
```

If you using a Universal Link in the redirect URI, you should use this delegate method instead:

```objective-c
- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray<id<UIUserActivityRestoring>> * _Nullable))restorationHandler {
return [self.rootViewController.sessionManager application:application continueUserActivity:userActivity restorationHandler:restorationHandler]
}
```


5. If using `SPTAppRemote` to control playback be sure to set the returned token on its connection parameters in the `SPTSessionManager` delegate callback.

```objective-c
Expand Down
2 changes: 1 addition & 1 deletion docs/html/Blocks/SPTAppRemoteCallback.html
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ <h4 class="method-subtitle">Declared In</h4>
<footer>
<div class="footer-copyright">

<p class="copyright">Copyright &copy; 2024 Spotify. All rights reserved. Updated: 2024-07-12</p>
<p class="copyright">Copyright &copy; 2024 Spotify. All rights reserved. Updated: 2024-07-15</p>


<p class="generator">Generated by <a href="http://appledoc.gentlebytes.com">appledoc 2.2.1 (build 1334)</a>.</p>
Expand Down
2 changes: 1 addition & 1 deletion docs/html/Classes/SPTAppRemote.html
Original file line number Diff line number Diff line change
Expand Up @@ -1300,7 +1300,7 @@ <h4 class="method-subtitle">Declared In</h4>
<footer>
<div class="footer-copyright">

<p class="copyright">Copyright &copy; 2024 Spotify. All rights reserved. Updated: 2024-07-12</p>
<p class="copyright">Copyright &copy; 2024 Spotify. All rights reserved. Updated: 2024-07-15</p>


<p class="generator">Generated by <a href="http://appledoc.gentlebytes.com">appledoc 2.2.1 (build 1334)</a>.</p>
Expand Down
2 changes: 1 addition & 1 deletion docs/html/Classes/SPTAppRemoteConnectionParams.html
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ <h4 class="method-subtitle">Declared In</h4>
<footer>
<div class="footer-copyright">

<p class="copyright">Copyright &copy; 2024 Spotify. All rights reserved. Updated: 2024-07-12</p>
<p class="copyright">Copyright &copy; 2024 Spotify. All rights reserved. Updated: 2024-07-15</p>


<p class="generator">Generated by <a href="http://appledoc.gentlebytes.com">appledoc 2.2.1 (build 1334)</a>.</p>
Expand Down
2 changes: 1 addition & 1 deletion docs/html/Classes/SPTConfiguration.html
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ <h4 class="method-subtitle">Declared In</h4>
<footer>
<div class="footer-copyright">

<p class="copyright">Copyright &copy; 2024 Spotify. All rights reserved. Updated: 2024-07-12</p>
<p class="copyright">Copyright &copy; 2024 Spotify. All rights reserved. Updated: 2024-07-15</p>


<p class="generator">Generated by <a href="http://appledoc.gentlebytes.com">appledoc 2.2.1 (build 1334)</a>.</p>
Expand Down
2 changes: 1 addition & 1 deletion docs/html/Classes/SPTError.html
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ <h2 class="subtitle subtitle-overview">Overview</h2>
<footer>
<div class="footer-copyright">

<p class="copyright">Copyright &copy; 2024 Spotify. All rights reserved. Updated: 2024-07-12</p>
<p class="copyright">Copyright &copy; 2024 Spotify. All rights reserved. Updated: 2024-07-15</p>


<p class="generator">Generated by <a href="http://appledoc.gentlebytes.com">appledoc 2.2.1 (build 1334)</a>.</p>
Expand Down
2 changes: 1 addition & 1 deletion docs/html/Classes/SPTSession.html
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ <h4 class="method-subtitle">Declared In</h4>
<footer>
<div class="footer-copyright">

<p class="copyright">Copyright &copy; 2024 Spotify. All rights reserved. Updated: 2024-07-12</p>
<p class="copyright">Copyright &copy; 2024 Spotify. All rights reserved. Updated: 2024-07-15</p>


<p class="generator">Generated by <a href="http://appledoc.gentlebytes.com">appledoc 2.2.1 (build 1334)</a>.</p>
Expand Down
72 changes: 71 additions & 1 deletion docs/html/Classes/SPTSessionManager.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ <h1 id="library-title">

<optgroup label="Instance Methods">

<option value="//api/name/application:continueUserActivity:restorationHandler:">- application:continueUserActivity:restorationHandler:</option>

<option value="//api/name/application:openURL:options:">- application:openURL:options:</option>

<option value="//api/name/initWithConfiguration:delegate:">- initWithConfiguration:delegate:</option>
Expand Down Expand Up @@ -528,6 +530,74 @@ <h4 class="method-subtitle parameter-title">Return Value</h4>



<div class="method-subsection declared-in-section">
<h4 class="method-subtitle">Declared In</h4>
<p><code class="declared-in-ref">SPTSessionManager.h</code></p>
</div>


</div>
</div>
</div><div class="section-method">
<a name="//api/name/application:continueUserActivity:restorationHandler:" title="application:continueUserActivity:restorationHandler:"></a>
<h3 class="method-title"><code><a href="#//api/name/application:continueUserActivity:restorationHandler:">&ndash;&nbsp;application:continueUserActivity:restorationHandler:</a></code>
</h3>

<div class="method-info">
<div class="pointy-thing"></div>

<div class="method-info-container">


<div class="method-subsection brief-description">
<p>Handle continueUserActivity callbacks from the <code>AppDelegate</code></p>
</div>



<div class="method-subsection method-declaration"><code>- (BOOL)application:(UIApplication *)<em>application</em> continueUserActivity:(NSUserActivity *)<em>userActivity</em> restorationHandler:(void ( ^ ) ( NSArray&lt;id&lt;UIUserActivityRestoring&gt; &gt; *__nullable restorableObjects ))<em>restorationHandler</em></code></div>



<div class="method-subsection arguments-section parameters">
<h4 class="method-subtitle parameter-title">Parameters</h4>
<table class="argument-def parameter-def">

<tr>
<th scope="row" class="argument-name"><code>application</code></th>
<td><p>The <code>UIApplication</code> passed into the matching <code>AppDelegate</code> method</p></td>
</tr>

<tr>
<th scope="row" class="argument-name"><code>userActivity</code></th>
<td><p>An object encapsulating a user activity supported by this responder.</p></td>
</tr>

<tr>
<th scope="row" class="argument-name"><code>restorationHandler</code></th>
<td><p>A block to execute if your app creates objects to perform the task the user was performing</p></td>
</tr>

</table>
</div>



<div class="method-subsection return">
<h4 class="method-subtitle parameter-title">Return Value</h4>
<p>Returns <code>YES</code> if <code>SPTSessionManager</code> recognizes the URL and will attempt to parse an access token, otherwise returns <code>NO</code>.</p>
</div>











<div class="method-subsection declared-in-section">
<h4 class="method-subtitle">Declared In</h4>
<p><code class="declared-in-ref">SPTSessionManager.h</code></p>
Expand All @@ -551,7 +621,7 @@ <h4 class="method-subtitle">Declared In</h4>
<footer>
<div class="footer-copyright">

<p class="copyright">Copyright &copy; 2024 Spotify. All rights reserved. Updated: 2024-07-12</p>
<p class="copyright">Copyright &copy; 2024 Spotify. All rights reserved. Updated: 2024-07-15</p>


<p class="generator">Generated by <a href="http://appledoc.gentlebytes.com">appledoc 2.2.1 (build 1334)</a>.</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ <h4 class="method-subtitle">Declared In</h4>
<footer>
<div class="footer-copyright">

<p class="copyright">Copyright &copy; 2024 Spotify. All rights reserved. Updated: 2024-07-12</p>
<p class="copyright">Copyright &copy; 2024 Spotify. All rights reserved. Updated: 2024-07-15</p>


<p class="generator">Generated by <a href="http://appledoc.gentlebytes.com">appledoc 2.2.1 (build 1334)</a>.</p>
Expand Down
2 changes: 1 addition & 1 deletion docs/html/Constants/SPTAppRemoteErrorCode.html
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ <h4 class="method-subtitle">Declared In</h4>
<footer>
<div class="footer-copyright">

<p class="copyright">Copyright &copy; 2024 Spotify. All rights reserved. Updated: 2024-07-12</p>
<p class="copyright">Copyright &copy; 2024 Spotify. All rights reserved. Updated: 2024-07-15</p>


<p class="generator">Generated by <a href="http://appledoc.gentlebytes.com">appledoc 2.2.1 (build 1334)</a>.</p>
Expand Down
Loading

0 comments on commit 567a7d0

Please sign in to comment.