@superfan-app/spotify-auth 0.1.59 → 0.1.61
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/SpotifyAuth.types.d.ts.map +1 -1
- package/build/SpotifyAuth.types.js +1 -0
- package/build/SpotifyAuth.types.js.map +1 -1
- package/build/SpotifyAuthModule.d.ts.map +1 -1
- package/build/SpotifyAuthModule.js +1 -0
- package/build/SpotifyAuthModule.js.map +1 -1
- package/build/SpotifyAuthView.d.ts.map +1 -1
- package/build/SpotifyAuthView.js +1 -0
- package/build/SpotifyAuthView.js.map +1 -1
- package/build/index.d.ts.map +1 -1
- package/build/index.js +1 -0
- package/build/index.js.map +1 -1
- package/ios/Frameworks/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Headers/SPTConfiguration.h +1 -1
- package/ios/Frameworks/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Headers/SPTError.h +6 -7
- package/ios/Frameworks/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Headers/SPTScope.h +43 -39
- package/ios/Frameworks/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Headers/SPTSessionManager.h +8 -4
- package/ios/Frameworks/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Headers/SpotifyiOS.h +1 -1
- package/ios/Frameworks/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Info.plist +0 -0
- package/ios/Frameworks/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/SpotifyiOS +0 -0
- package/ios/Frameworks/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Headers/SPTConfiguration.h +1 -1
- package/ios/Frameworks/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Headers/SPTError.h +6 -7
- package/ios/Frameworks/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Headers/SPTScope.h +43 -39
- package/ios/Frameworks/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Headers/SPTSessionManager.h +8 -4
- package/ios/Frameworks/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Headers/SpotifyiOS.h +1 -1
- package/ios/Frameworks/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Info.plist +0 -0
- package/ios/Frameworks/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/SpotifyiOS +0 -0
- package/ios/SpotifyASWebAuthSession.swift +2 -0
- package/ios/SpotifyAuth.podspec +2 -0
- package/ios/SpotifyAuthAuth.swift +2 -0
- package/ios/SpotifyAuthDelegate.swift +2 -0
- package/ios/SpotifyAuthHeaders.h +2 -0
- package/ios/SpotifyAuthModule.swift +2 -0
- package/package.json +1 -1
- package/plugin/build/index.js +1 -0
- package/plugin/build/types.js +1 -0
- package/plugin/src/index.ts +2 -0
- package/plugin/src/types.ts +2 -0
- package/src/SpotifyAuth.types.ts +2 -0
- package/src/SpotifyAuthModule.ts +2 -0
- package/src/SpotifyAuthView.tsx +2 -0
- package/src/index.tsx +2 -0
- package/ios/Frameworks/SpotifyiOS.xcframework/_CodeSignature/CodeDirectory +0 -0
- package/ios/Frameworks/SpotifyiOS.xcframework/_CodeSignature/CodeRequirements +0 -0
- package/ios/Frameworks/SpotifyiOS.xcframework/_CodeSignature/CodeRequirements-1 +0 -0
- package/ios/Frameworks/SpotifyiOS.xcframework/_CodeSignature/CodeResources +0 -1118
- package/ios/Frameworks/SpotifyiOS.xcframework/_CodeSignature/CodeSignature +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpotifyAuth.types.d.ts","sourceRoot":"","sources":["../src/SpotifyAuth.types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SpotifyAuth.types.d.ts","sourceRoot":"","sources":["../src/SpotifyAuth.types.ts"],"names":[],"mappings":"AAIA;;;GA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2CAA2C;IAC3C,gBAAgB,EAAE,OAAO,CAAC;IAC1B,qDAAqD;IACrD,KAAK,EAAE,gBAAgB,GAAG,IAAI,CAAC;CAChC;AAED,eAAO,MAAM,0BAA0B,6CAWrC,CAAC;AAEH,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,oBAAoB,CAAC,EAAE,CAAC,IAAI,EAAE,oBAAoB,KAAK,IAAI,CAAC;CAC7D;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;CACf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpotifyAuth.types.js","sourceRoot":"","sources":["../src/SpotifyAuth.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAiJtC,MAAM,CAAC,MAAM,0BAA0B,GAAG,aAAa,CAAqB;IAC1E,SAAS,EAAE;QACT,WAAW,EAAE,IAAI;QACjB,YAAY,EAAE,IAAI;QAClB,SAAS,EAAE,IAAI;QACf,SAAS,EAAE,IAAI;QACf,KAAK,EAAE,IAAI;KACZ;IACD,SAAS,EAAE,KAAK,IAAI,EAAE,GAAE,CAAC;IACzB,gBAAgB,EAAE,KAAK;IACvB,KAAK,EAAE,IAAI;CACZ,CAAC,CAAC","sourcesContent":["
|
|
1
|
+
{"version":3,"file":"SpotifyAuth.types.js","sourceRoot":"","sources":["../src/SpotifyAuth.types.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAE3B,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAiJtC,MAAM,CAAC,MAAM,0BAA0B,GAAG,aAAa,CAAqB;IAC1E,SAAS,EAAE;QACT,WAAW,EAAE,IAAI;QACjB,YAAY,EAAE,IAAI;QAClB,SAAS,EAAE,IAAI;QACf,SAAS,EAAE,IAAI;QACf,KAAK,EAAE,IAAI;KACZ;IACD,SAAS,EAAE,KAAK,IAAI,EAAE,GAAE,CAAC;IACzB,gBAAgB,EAAE,KAAK;IACvB,KAAK,EAAE,IAAI;CACZ,CAAC,CAAC","sourcesContent":["// src/SpotifyAuth.types.ts\n\nimport { createContext } from \"react\";\n\n/**\n * Available Spotify authorization scopes.\n * @see https://developer.spotify.com/documentation/general/guides/authorization/scopes/\n */\nexport type SpotifyScopes =\n | 'app-remote-control'\n | 'playlist-modify-private'\n | 'playlist-modify-public'\n | 'playlist-read-collaborative'\n | 'playlist-read-private'\n | 'streaming'\n | 'user-follow-modify'\n | 'user-follow-read'\n | 'user-library-modify'\n | 'user-library-read'\n | 'user-modify-playback-state'\n | 'user-read-currently-playing'\n | 'user-read-email'\n | 'user-read-playback-position'\n | 'user-read-playback-state'\n | 'user-read-private'\n | 'user-read-recently-played'\n | 'user-top-read'\n | 'openid';\n\n/**\n * Event data structure for Spotify authorization events\n */\nexport interface SpotifyAuthEvent {\n success: boolean;\n token: string | null;\n refreshToken: string | null;\n expiresIn: number | null;\n tokenType: string | null;\n scope: string | null;\n error?: SpotifyAuthError;\n}\n\n/**\n * Data returned from the Spotify authorization process\n */\nexport interface SpotifyAuthorizationData {\n /** Whether the authorization was successful */\n success: boolean;\n /** The access token if authorization was successful, null otherwise */\n token: string | null;\n /** The refresh token if authorization was successful, null otherwise */\n refreshToken: string | null;\n /** The token expiration time in seconds if authorization was successful, null otherwise */\n expiresIn: number | null;\n /** The token type (e.g. \"Bearer\") if authorization was successful, null otherwise */\n tokenType: string | null;\n /** The granted scopes if authorization was successful, null otherwise */\n scope: string | null;\n /** Error information if authorization failed */\n error?: SpotifyAuthError;\n}\n\n/**\n * Possible error types that can occur during Spotify authentication\n */\nexport type SpotifyAuthError = {\n /** The type of error that occurred */\n type: \n | \"configuration_error\" // Missing or invalid configuration\n | \"network_error\" // Network-related issues\n | \"token_error\" // Issues with token exchange/refresh\n | \"authorization_error\" // User-facing authorization issues\n | \"server_error\" // Backend server issues\n | \"unknown_error\"; // Unexpected errors\n /** Human-readable error message */\n message: string;\n /** Additional error details */\n details: {\n /** Specific error code for more granular error handling */\n error_code: string;\n /** Whether the error can be recovered from */\n recoverable: boolean;\n /** Retry strategy information if applicable */\n retry?: {\n /** Type of retry strategy */\n type: \"fixed\" | \"exponential\";\n /** For fixed retry: number of attempts */\n attempts?: number;\n /** For fixed retry: delay between attempts in seconds */\n delay?: number;\n /** For exponential backoff: maximum number of attempts */\n max_attempts?: number;\n /** For exponential backoff: initial delay in seconds */\n initial_delay?: number;\n };\n };\n}\n\n/**\n * Configuration for the authorization request.\n * These are runtime options that can be changed between auth attempts.\n */\nexport interface AuthorizeConfig {\n /** Whether to show the auth dialog */\n showDialog?: boolean;\n /** Campaign identifier for attribution */\n campaign?: string;\n}\n\n/**\n * Props for the SpotifyAuthView component\n */\nexport interface SpotifyAuthViewProps {\n /** The name identifier for the auth view */\n name: string;\n}\n\n/**\n * Spotify authentication state containing all token-related information\n */\nexport interface SpotifyAuthState {\n /** The current Spotify access token, null if not authenticated */\n accessToken: string | null;\n /** The current refresh token, null if not authenticated */\n refreshToken: string | null;\n /** The token expiration time in seconds, null if not authenticated */\n expiresIn: number | null;\n /** The token type, null if not authenticated */\n tokenType: string | null;\n /** The token scope, null if not authenticated */\n scope: string | null;\n}\n\n/**\n * Context for Spotify authentication state and actions\n */\nexport interface SpotifyAuthContext {\n /** The complete Spotify authentication state */\n authState: SpotifyAuthState;\n /** Function to initiate Spotify authorization */\n authorize: (config: AuthorizeConfig) => Promise<void>;\n /** Whether authorization is in progress */\n isAuthenticating: boolean;\n /** Last error that occurred during authentication */\n error: SpotifyAuthError | null;\n}\n\nexport const SpotifyAuthContextInstance = createContext<SpotifyAuthContext>({\n authState: {\n accessToken: null,\n refreshToken: null,\n expiresIn: null,\n tokenType: null,\n scope: null,\n },\n authorize: async () => {},\n isAuthenticating: false,\n error: null,\n});\n\nexport interface SpotifyAuthOptions {\n clientId: string;\n redirectUrl: string;\n showDialog?: boolean;\n tokenRefreshFunction?: (data: SpotifyTokenResponse) => void;\n}\n\n/**\n * Response data from Spotify token endpoint\n */\nexport interface SpotifyTokenResponse {\n access_token: string;\n token_type: string;\n expires_in: number;\n refresh_token?: string;\n scope: string;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpotifyAuthModule.d.ts","sourceRoot":"","sources":["../src/SpotifyAuthModule.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SpotifyAuthModule.d.ts","sourceRoot":"","sources":["../src/SpotifyAuthModule.ts"],"names":[],"mappings":"AAEA,OAAO,EAAuB,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE7E,KAAK,iBAAiB,GAAG;IACvB,aAAa,CAAC,KAAK,EAAE,gBAAgB,GAAG,IAAI,CAAC;CAC9C,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,YAAY,CAAC,iBAAiB,CAAC;IAC5E,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,SAAS,EAAE,CAAC,MAAM,EAAE,eAAe,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAChE;wBAGoD,iBAAiB;AAAtE,wBAAuE;AAEvE,eAAO,MAAM,aAAa,EAAG,eAAwB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpotifyAuthModule.js","sourceRoot":"","sources":["../src/SpotifyAuthModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAgB,MAAM,mBAAmB,CAAC;AAYtE,yDAAyD;AACzD,eAAe,mBAAmB,CAAC,aAAa,CAAsB,CAAC;AAEvE,MAAM,CAAC,MAAM,aAAa,GAAG,eAAwB,CAAC","sourcesContent":["
|
|
1
|
+
{"version":3,"file":"SpotifyAuthModule.js","sourceRoot":"","sources":["../src/SpotifyAuthModule.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAE3B,OAAO,EAAE,mBAAmB,EAAgB,MAAM,mBAAmB,CAAC;AAYtE,yDAAyD;AACzD,eAAe,mBAAmB,CAAC,aAAa,CAAsB,CAAC;AAEvE,MAAM,CAAC,MAAM,aAAa,GAAG,eAAwB,CAAC","sourcesContent":["// src/SpotifyAuthModule.ts\n\nimport { requireNativeModule, NativeModule } from \"expo-modules-core\";\nimport type { AuthorizeConfig, SpotifyAuthEvent } from \"./SpotifyAuth.types\";\n\ntype SpotifyAuthEvents = {\n onSpotifyAuth(event: SpotifyAuthEvent): void;\n};\n\nexport declare class SpotifyAuthModule extends NativeModule<SpotifyAuthEvents> {\n readonly AuthEventName: string;\n readonly authorize: (config: AuthorizeConfig) => Promise<void>;\n}\n\n// This call loads the native module object from the JSI.\nexport default requireNativeModule(\"SpotifyAuth\") as SpotifyAuthModule;\n\nexport const AuthEventName = \"onSpotifyAuth\" as const;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpotifyAuthView.d.ts","sourceRoot":"","sources":["../src/SpotifyAuthView.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SpotifyAuthView.d.ts","sourceRoot":"","sources":["../src/SpotifyAuthView.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAK3D,MAAM,CAAC,OAAO,UAAU,eAAe,CACrC,KAAK,EAAE,oBAAoB,GAC1B,GAAG,CAAC,OAAO,CAGb"}
|
package/build/SpotifyAuthView.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpotifyAuthView.js","sourceRoot":"","sources":["../src/SpotifyAuthView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,MAAM,UAAU,GACd,wBAAwB,CAAC,aAAa,CAAC,CAAC;AAE1C,MAAM,CAAC,OAAO,UAAU,eAAe,CACrC,KAA2B;IAE3B,OAAO,CAAC,GAAG,CAAC,yCAAyC,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;IAC9E,OAAO,CAAC,UAAU,CAAC,IAAI,KAAK,CAAC,EAAG,CAAC;AACnC,CAAC","sourcesContent":["
|
|
1
|
+
{"version":3,"file":"SpotifyAuthView.js","sourceRoot":"","sources":["../src/SpotifyAuthView.tsx"],"names":[],"mappings":"AAAA,0BAA0B;AAE1B,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,MAAM,UAAU,GACd,wBAAwB,CAAC,aAAa,CAAC,CAAC;AAE1C,MAAM,CAAC,OAAO,UAAU,eAAe,CACrC,KAA2B;IAE3B,OAAO,CAAC,GAAG,CAAC,yCAAyC,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;IAC9E,OAAO,CAAC,UAAU,CAAC,IAAI,KAAK,CAAC,EAAG,CAAC;AACnC,CAAC","sourcesContent":["// src/SpotifyAuthView.tsx\n\nimport { requireNativeViewManager } from \"expo-modules-core\";\nimport * as React from \"react\";\nimport { ViewProps } from \"react-native\";\n\nimport { SpotifyAuthViewProps } from \"./SpotifyAuth.types\";\n\nconst NativeView: React.ComponentType<SpotifyAuthViewProps & ViewProps> =\n requireNativeViewManager(\"SpotifyAuth\");\n\nexport default function SpotifyAuthView(\n props: SpotifyAuthViewProps,\n): JSX.Element {\n console.log('Registering SpotifyAuthView with props:', JSON.stringify(props));\n return <NativeView {...props} />;\n}\n"]}
|
package/build/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAuD,MAAM,OAAO,CAAC;AAE5E,OAAO,EAEL,kBAAkB,EAGlB,KAAK,eAAe,EAErB,MAAM,qBAAqB,CAAC;AAe7B;;GAEG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,eAAe,GAAG,IAAI,CAGvD;AAED,UAAU,wBAAwB;IAChC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,wBAAgB,mBAAmB,CAAC,EAClC,QAAQ,GACT,EAAE,wBAAwB,GAAG,GAAG,CAAC,OAAO,CAwFxC;AAED,wBAAgB,cAAc,IAAI,kBAAkB,CAMnD"}
|
package/build/index.js
CHANGED
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAE5E,OAAO,EAGL,0BAA0B,GAI3B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AAKpD,kCAAkC;AAClC,MAAM,OAAO,GAAG,IAAI,YAAY,CAAC,iBAAiB,CAAC,CAAC;AAEpD,SAAS,eAAe,CAAC,QAAkD;IACzE,+CAA+C;IAC/C,MAAM,SAAS,GAAG,iBAAiB,CAAC,aAAqC,CAAC;IAC1E,OAAO,OAAO,CAAC,WAAW,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;AAClD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,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BACZ,CAAC,CAAC;gBACH,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;gBACrB,mBAAmB,CAAC,KAAK,CAAC,CAAC;YAC7B,CAAC;QACH,CAAC,CAAC,CAAC;QACH,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,MAAM,EAAE,CAAC;IACrC,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CACL,CAAC,0BAA0B,CAAC,QAAQ,CAClC,KAAK,CAAC,CAAC;YACL,SAAS;YACT,SAAS;YACT,gBAAgB;YAChB,KAAK;SACN,CAAC,CAEF;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,0BAA0B,CAAC,QAAQ,CAAC,CACvC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,cAAc;IAC5B,MAAM,OAAO,GAAG,UAAU,CAAC,0BAA0B,CAAC,CAAC;IACvD,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,0DAA0D,CAAC,CAAC;IAC9E,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC","sourcesContent":["// src/index.tsx\n\nimport { EventEmitter } from \"expo-modules-core\";\nimport React, { useContext, useEffect, useState, useCallback } from \"react\";\n\nimport {\n SpotifyAuthorizationData,\n SpotifyAuthContext,\n SpotifyAuthContextInstance,\n SpotifyAuthState,\n type AuthorizeConfig,\n type SpotifyAuthError,\n} from \"./SpotifyAuth.types\";\nimport SpotifyAuthModule from \"./SpotifyAuthModule\";\n\n// First define the event name as a string literal type\ntype SpotifyAuthEventName = \"onSpotifyAuth\"; // This should match SpotifyAuthModule.AuthEventName\n\n// Create a properly typed emitter\nconst emitter = new EventEmitter(SpotifyAuthModule);\n\nfunction addAuthListener(listener: (data: SpotifyAuthorizationData) => void) {\n // Assert the event name is of the correct type\n const eventName = SpotifyAuthModule.AuthEventName as SpotifyAuthEventName;\n return emitter.addListener(eventName, listener);\n}\n\n/**\n * Prompts the user to log in to Spotify and authorize your application.\n */\nexport function authorize(config: AuthorizeConfig): void {\n console.log('[SpotifyAuth] Initiating authorization request');\n SpotifyAuthModule.authorize(config);\n}\n\ninterface SpotifyAuthProviderProps {\n children: React.ReactNode;\n}\n\nexport function SpotifyAuthProvider({\n children,\n}: SpotifyAuthProviderProps): JSX.Element {\n const [authState, setAuthState] = useState<SpotifyAuthState>({\n accessToken: null,\n refreshToken: null,\n expiresIn: null,\n tokenType: null,\n scope: null,\n });\n const [isAuthenticating, setIsAuthenticating] = useState(false);\n const [error, setError] = useState<SpotifyAuthError | null>(null);\n\n const authorize = useCallback(\n async (config: AuthorizeConfig): Promise<void> => {\n try {\n console.log('[SpotifyAuth] Starting authorization process in provider');\n console.log('[SpotifyAuth] Authorization config:', JSON.stringify(config));\n setIsAuthenticating(true);\n setError(null);\n await SpotifyAuthModule.authorize(config);\n } catch (err) {\n console.error('[SpotifyAuth] Authorization error:', err);\n // Handle structured errors from the native layer\n if (err && typeof err === 'object' && 'type' in err) {\n setError(err as SpotifyAuthError);\n } else {\n // Create a generic error structure for unknown errors\n setError({\n type: 'unknown_error',\n message: err instanceof Error ? err.message : 'Authorization failed',\n details: {\n error_code: 'unknown',\n recoverable: false\n }\n });\n }\n throw err;\n }\n },\n [],\n );\n\n useEffect(() => {\n console.log('[SpotifyAuth] Setting up auth listener');\n const subscription = addAuthListener((data) => {\n console.log('[SpotifyAuth] Received auth event:', JSON.stringify(data));\n\n // Only update state if we receive a token\n if (data.token) {\n setAuthState({\n accessToken: data.token,\n refreshToken: data.refreshToken,\n expiresIn: data.expiresIn,\n tokenType: data.tokenType,\n scope: data.scope,\n });\n setIsAuthenticating(false);\n setError(null);\n }\n\n // Only set error if we have no token and there's an error\n if (!data.token && data.error) {\n console.error('[SpotifyAuth] Auth event error:', data.error);\n setAuthState({\n accessToken: null,\n refreshToken: null,\n expiresIn: null,\n tokenType: null,\n scope: null,\n });\n setError(data.error);\n setIsAuthenticating(false);\n }\n });\n return () => subscription.remove();\n }, []);\n\n return (\n <SpotifyAuthContextInstance.Provider\n value={{\n authState,\n authorize,\n isAuthenticating,\n error\n }}\n >\n {children}\n </SpotifyAuthContextInstance.Provider>\n );\n}\n\nexport function useSpotifyAuth(): SpotifyAuthContext {\n const context = useContext(SpotifyAuthContextInstance);\n if (!context) {\n throw new Error(\"useSpotifyAuth must be used within a SpotifyAuthProvider\");\n }\n return context;\n}\n"]}
|
|
@@ -51,7 +51,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
51
51
|
- (instancetype)initWithClientID:(NSString *)clientID redirectURL:(NSURL *)redirectURL NS_DESIGNATED_INITIALIZER;
|
|
52
52
|
|
|
53
53
|
/**
|
|
54
|
-
Convenience
|
|
54
|
+
Convenience initializer for `SPTConfiguration`
|
|
55
55
|
|
|
56
56
|
@param clientID Your client ID obtained from developer.spotify.com
|
|
57
57
|
@param redirectURL Your redirect URL for Spotify to open your app again after authorization
|
package/ios/Frameworks/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Headers/SPTError.h
CHANGED
|
@@ -10,13 +10,12 @@ SPT_EXPORT NSErrorDomain const SPTLoginErrorDomain;
|
|
|
10
10
|
typedef NS_ENUM(NSUInteger, SPTErrorCode) {
|
|
11
11
|
/// Unknown error code
|
|
12
12
|
SPTUnknownErrorCode NS_SWIFT_NAME(unknown) = 0,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
};
|
|
13
|
+
/// Authorization failed
|
|
14
|
+
SPTAuthorizationFailedErrorCode NS_SWIFT_NAME(authorizationFailed),
|
|
15
|
+
/// Renew session failed
|
|
16
|
+
SPTRenewSessionFailedErrorCode NS_SWIFT_NAME(renewSessionFailed),
|
|
17
|
+
/// Failed to parse the returned JSON
|
|
18
|
+
SPTJSONFailedErrorCode NS_SWIFT_NAME(jsonFailed) };
|
|
20
19
|
|
|
21
20
|
/// Spotify-specific errors. Use NSUnderlyingErrorKey to see the underlying error
|
|
22
21
|
@interface SPTError : NSError
|
package/ios/Frameworks/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Headers/SPTScope.h
CHANGED
|
@@ -30,42 +30,46 @@
|
|
|
30
30
|
typedef NS_OPTIONS(NSUInteger, SPTScope) {
|
|
31
31
|
/// Read access to user's private playlists.
|
|
32
32
|
SPTPlaylistReadPrivateScope NS_SWIFT_NAME(playlistReadPrivate) = (1 << 0),
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
33
|
+
/// Include collaborative playlists when requesting a user's playlists.
|
|
34
|
+
SPTPlaylistReadCollaborativeScope NS_SWIFT_NAME(playlistReadCollaborative) = (1 << 1),
|
|
35
|
+
/// Write access to a user's public playlists.
|
|
36
|
+
SPTPlaylistModifyPublicScope NS_SWIFT_NAME(playlistModifyPublic) = (1 << 2),
|
|
37
|
+
/// Write access to a user's private playlists.
|
|
38
|
+
SPTPlaylistModifyPrivateScope NS_SWIFT_NAME(playlistModifyPrivate) = (1 << 3),
|
|
39
|
+
/// Read access to the list of artists and other users that the user follows.
|
|
40
|
+
SPTUserFollowReadScope NS_SWIFT_NAME(userFollowRead) = (1 << 4),
|
|
41
|
+
/// Write/delete access to the list of artists and other users that the user follows.
|
|
42
|
+
SPTUserFollowModifyScope NS_SWIFT_NAME(userFollowModify) = (1 << 5),
|
|
43
|
+
/// Read access to a user's "Your Music" library.
|
|
44
|
+
SPTUserLibraryReadScope NS_SWIFT_NAME(userLibraryRead) = (1 << 6),
|
|
45
|
+
/// Write/delete access to a user's "Your Music" library.
|
|
46
|
+
SPTUserLibraryModifyScope NS_SWIFT_NAME(userLibraryModify) = (1 << 7),
|
|
47
|
+
/// Read access to the user's birthdate.
|
|
48
|
+
SPTUserReadBirthDateScope NS_SWIFT_NAME(userReadBirthDate) = (1 << 8),
|
|
49
|
+
/// Read access to user’s email address.
|
|
50
|
+
SPTUserReadEmailScope NS_SWIFT_NAME(userReadEmail) = (1 << 9),
|
|
51
|
+
/// Read access to user’s subscription details (type of user account).
|
|
52
|
+
SPTUserReadPrivateScope NS_SWIFT_NAME(userReadPrivate) = (1 << 10),
|
|
53
|
+
/// Read access to a user's top artists and tracks.
|
|
54
|
+
SPTUserTopReadScope NS_SWIFT_NAME(userTopRead) = (1 << 11),
|
|
55
|
+
/// Upload user generated content images
|
|
56
|
+
SPTUGCImageUploadScope NS_SWIFT_NAME(ugcImageUpload) = (1 << 12),
|
|
57
|
+
/// Control playback of a Spotify track.
|
|
58
|
+
SPTStreamingScope NS_SWIFT_NAME(streaming) = (1 << 13),
|
|
59
|
+
/// Use App Remote to control playback in the Spotify app
|
|
60
|
+
SPTAppRemoteControlScope NS_SWIFT_NAME(appRemoteControl) = (1 << 14),
|
|
61
|
+
/// Read access to a user’s player state.
|
|
62
|
+
SPTUserReadPlaybackStateScope NS_SWIFT_NAME(userReadPlaybackState) = (1 << 15),
|
|
63
|
+
/// Write access to a user’s playback state
|
|
64
|
+
SPTUserModifyPlaybackStateScope NS_SWIFT_NAME(userModifyPlaybackState) = (1 << 16),
|
|
65
|
+
/// Read access to a user’s currently playing
|
|
66
|
+
/// track
|
|
67
|
+
SPTUserReadCurrentlyPlayingScope NS_SWIFT_NAME(userReadCurrentlyPlaying) = (1 << 17),
|
|
68
|
+
/// Read access to a user’s currently
|
|
69
|
+
/// playing track
|
|
70
|
+
SPTUserReadRecentlyPlayedScope NS_SWIFT_NAME(userReadRecentlyPlayed) = (1 << 18),
|
|
71
|
+
/// Indicate that the application
|
|
72
|
+
/// intends to use OIDC to verify the
|
|
73
|
+
/// user's identity
|
|
74
|
+
SPTOpenIdScope NS_SWIFT_NAME(openid) = (1 << 19),
|
|
75
|
+
};
|
|
@@ -8,11 +8,15 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
8
8
|
|
|
9
9
|
/// Options for determining the most suitable method for authorization
|
|
10
10
|
typedef NS_OPTIONS(NSUInteger, SPTAuthorizationOptions) {
|
|
11
|
-
/// Authorize using a suitable method. If Spotify is installed the app will be used instead of
|
|
11
|
+
/// Authorize using a suitable method. If Spotify is installed the app will be used instead of ASWebAuthentication.
|
|
12
12
|
SPTDefaultAuthorizationOption NS_SWIFT_NAME(default) = (0),
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
/// Authorize using only the Spotify client. If Spotify is not installed authorization will fail.
|
|
14
|
+
SPTClientAuthorizationOption NS_SWIFT_NAME(clientOnly) = (1 << 0),
|
|
15
|
+
/// Use this option if you have reached the limit of `LSApplicationQueriesSchemes` in your Info.plist
|
|
16
|
+
/// Attempt to open Spotify app directly without using `canOpenURL`. Falls back to ASWebAuthentication if
|
|
17
|
+
/// opening fails.
|
|
18
|
+
SPTSpotifySchemeNotRegisteredAuthorizationOption NS_SWIFT_NAME(spotifySchemeNotRegistered) = (1 << 1),
|
|
19
|
+
} NS_SWIFT_NAME(AuthorizationOptions);
|
|
16
20
|
|
|
17
21
|
typedef NSString *const SPTAuthorizationCode;
|
|
18
22
|
|
|
Binary file
|
|
Binary file
|
|
@@ -51,7 +51,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
51
51
|
- (instancetype)initWithClientID:(NSString *)clientID redirectURL:(NSURL *)redirectURL NS_DESIGNATED_INITIALIZER;
|
|
52
52
|
|
|
53
53
|
/**
|
|
54
|
-
Convenience
|
|
54
|
+
Convenience initializer for `SPTConfiguration`
|
|
55
55
|
|
|
56
56
|
@param clientID Your client ID obtained from developer.spotify.com
|
|
57
57
|
@param redirectURL Your redirect URL for Spotify to open your app again after authorization
|
|
@@ -10,13 +10,12 @@ SPT_EXPORT NSErrorDomain const SPTLoginErrorDomain;
|
|
|
10
10
|
typedef NS_ENUM(NSUInteger, SPTErrorCode) {
|
|
11
11
|
/// Unknown error code
|
|
12
12
|
SPTUnknownErrorCode NS_SWIFT_NAME(unknown) = 0,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
};
|
|
13
|
+
/// Authorization failed
|
|
14
|
+
SPTAuthorizationFailedErrorCode NS_SWIFT_NAME(authorizationFailed),
|
|
15
|
+
/// Renew session failed
|
|
16
|
+
SPTRenewSessionFailedErrorCode NS_SWIFT_NAME(renewSessionFailed),
|
|
17
|
+
/// Failed to parse the returned JSON
|
|
18
|
+
SPTJSONFailedErrorCode NS_SWIFT_NAME(jsonFailed) };
|
|
20
19
|
|
|
21
20
|
/// Spotify-specific errors. Use NSUnderlyingErrorKey to see the underlying error
|
|
22
21
|
@interface SPTError : NSError
|
|
@@ -30,42 +30,46 @@
|
|
|
30
30
|
typedef NS_OPTIONS(NSUInteger, SPTScope) {
|
|
31
31
|
/// Read access to user's private playlists.
|
|
32
32
|
SPTPlaylistReadPrivateScope NS_SWIFT_NAME(playlistReadPrivate) = (1 << 0),
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
33
|
+
/// Include collaborative playlists when requesting a user's playlists.
|
|
34
|
+
SPTPlaylistReadCollaborativeScope NS_SWIFT_NAME(playlistReadCollaborative) = (1 << 1),
|
|
35
|
+
/// Write access to a user's public playlists.
|
|
36
|
+
SPTPlaylistModifyPublicScope NS_SWIFT_NAME(playlistModifyPublic) = (1 << 2),
|
|
37
|
+
/// Write access to a user's private playlists.
|
|
38
|
+
SPTPlaylistModifyPrivateScope NS_SWIFT_NAME(playlistModifyPrivate) = (1 << 3),
|
|
39
|
+
/// Read access to the list of artists and other users that the user follows.
|
|
40
|
+
SPTUserFollowReadScope NS_SWIFT_NAME(userFollowRead) = (1 << 4),
|
|
41
|
+
/// Write/delete access to the list of artists and other users that the user follows.
|
|
42
|
+
SPTUserFollowModifyScope NS_SWIFT_NAME(userFollowModify) = (1 << 5),
|
|
43
|
+
/// Read access to a user's "Your Music" library.
|
|
44
|
+
SPTUserLibraryReadScope NS_SWIFT_NAME(userLibraryRead) = (1 << 6),
|
|
45
|
+
/// Write/delete access to a user's "Your Music" library.
|
|
46
|
+
SPTUserLibraryModifyScope NS_SWIFT_NAME(userLibraryModify) = (1 << 7),
|
|
47
|
+
/// Read access to the user's birthdate.
|
|
48
|
+
SPTUserReadBirthDateScope NS_SWIFT_NAME(userReadBirthDate) = (1 << 8),
|
|
49
|
+
/// Read access to user’s email address.
|
|
50
|
+
SPTUserReadEmailScope NS_SWIFT_NAME(userReadEmail) = (1 << 9),
|
|
51
|
+
/// Read access to user’s subscription details (type of user account).
|
|
52
|
+
SPTUserReadPrivateScope NS_SWIFT_NAME(userReadPrivate) = (1 << 10),
|
|
53
|
+
/// Read access to a user's top artists and tracks.
|
|
54
|
+
SPTUserTopReadScope NS_SWIFT_NAME(userTopRead) = (1 << 11),
|
|
55
|
+
/// Upload user generated content images
|
|
56
|
+
SPTUGCImageUploadScope NS_SWIFT_NAME(ugcImageUpload) = (1 << 12),
|
|
57
|
+
/// Control playback of a Spotify track.
|
|
58
|
+
SPTStreamingScope NS_SWIFT_NAME(streaming) = (1 << 13),
|
|
59
|
+
/// Use App Remote to control playback in the Spotify app
|
|
60
|
+
SPTAppRemoteControlScope NS_SWIFT_NAME(appRemoteControl) = (1 << 14),
|
|
61
|
+
/// Read access to a user’s player state.
|
|
62
|
+
SPTUserReadPlaybackStateScope NS_SWIFT_NAME(userReadPlaybackState) = (1 << 15),
|
|
63
|
+
/// Write access to a user’s playback state
|
|
64
|
+
SPTUserModifyPlaybackStateScope NS_SWIFT_NAME(userModifyPlaybackState) = (1 << 16),
|
|
65
|
+
/// Read access to a user’s currently playing
|
|
66
|
+
/// track
|
|
67
|
+
SPTUserReadCurrentlyPlayingScope NS_SWIFT_NAME(userReadCurrentlyPlaying) = (1 << 17),
|
|
68
|
+
/// Read access to a user’s currently
|
|
69
|
+
/// playing track
|
|
70
|
+
SPTUserReadRecentlyPlayedScope NS_SWIFT_NAME(userReadRecentlyPlayed) = (1 << 18),
|
|
71
|
+
/// Indicate that the application
|
|
72
|
+
/// intends to use OIDC to verify the
|
|
73
|
+
/// user's identity
|
|
74
|
+
SPTOpenIdScope NS_SWIFT_NAME(openid) = (1 << 19),
|
|
75
|
+
};
|
|
@@ -8,11 +8,15 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
8
8
|
|
|
9
9
|
/// Options for determining the most suitable method for authorization
|
|
10
10
|
typedef NS_OPTIONS(NSUInteger, SPTAuthorizationOptions) {
|
|
11
|
-
/// Authorize using a suitable method. If Spotify is installed the app will be used instead of
|
|
11
|
+
/// Authorize using a suitable method. If Spotify is installed the app will be used instead of ASWebAuthentication.
|
|
12
12
|
SPTDefaultAuthorizationOption NS_SWIFT_NAME(default) = (0),
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
/// Authorize using only the Spotify client. If Spotify is not installed authorization will fail.
|
|
14
|
+
SPTClientAuthorizationOption NS_SWIFT_NAME(clientOnly) = (1 << 0),
|
|
15
|
+
/// Use this option if you have reached the limit of `LSApplicationQueriesSchemes` in your Info.plist
|
|
16
|
+
/// Attempt to open Spotify app directly without using `canOpenURL`. Falls back to ASWebAuthentication if
|
|
17
|
+
/// opening fails.
|
|
18
|
+
SPTSpotifySchemeNotRegisteredAuthorizationOption NS_SWIFT_NAME(spotifySchemeNotRegistered) = (1 << 1),
|
|
19
|
+
} NS_SWIFT_NAME(AuthorizationOptions);
|
|
16
20
|
|
|
17
21
|
typedef NSString *const SPTAuthorizationCode;
|
|
18
22
|
|
|
Binary file
|
|
Binary file
|
package/ios/SpotifyAuth.podspec
CHANGED
package/ios/SpotifyAuthHeaders.h
CHANGED
package/package.json
CHANGED
package/plugin/build/index.js
CHANGED
package/plugin/build/types.js
CHANGED
package/plugin/src/index.ts
CHANGED
package/plugin/src/types.ts
CHANGED
package/src/SpotifyAuth.types.ts
CHANGED
package/src/SpotifyAuthModule.ts
CHANGED
package/src/SpotifyAuthView.tsx
CHANGED
package/src/index.tsx
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|