Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nkalupahana/capacitor-spotify
Native Spotify authentication for Capacitor.
https://github.com/nkalupahana/capacitor-spotify
Last synced: 5 days ago
JSON representation
Native Spotify authentication for Capacitor.
- Host: GitHub
- URL: https://github.com/nkalupahana/capacitor-spotify
- Owner: nkalupahana
- Created: 2024-06-04T17:50:51.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-06-06T06:10:40.000Z (5 months ago)
- Last Synced: 2024-06-07T16:55:03.740Z (5 months ago)
- Language: Swift
- Homepage:
- Size: 125 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
Awesome Lists containing this project
README
# @getbaseline/capacitor-spotify
Native Spotify authentication for Capacitor.
## Install
```bash
npm install @getbaseline/capacitor-spotify
npx cap sync
```## iOS Setup
1. Add a redirect URI to your app as a URL scheme. We recommend using reverse domain notation (e.g `app.getbaseline.baseline.spotify`).
2. Add the following to the beginning of `func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey: Any] = [:]) -> Bool` in `AppDelegate`:
```swift
if (url.scheme == "YOUR URL SCHEME FROM STEP 2 HERE ") {
NotificationCenter.default.post(name: NSNotification.Name("spotifyLogin"), object: url);
}
```
3. Add the following to your app's `Info.plist` (allows your app to open the Spotify app for auth):
```xml
LSApplicationQueriesSchemesspotify
```
## API
* [`signIn(...)`](#signin)
* [Interfaces](#interfaces)### signIn(...)
```typescript
signIn(options: SignInOptions) => Promise
```| Param | Type |
| ------------- | ------------------------------------------------------- |
| **`options`** |SignInOptions
|**Returns:**
Promise<SignInResult>
--------------------
### Interfaces
#### SignInResult
| Prop | Type |
| --------------- | ------------------- |
| **`resultUri`** |string
|#### SignInOptions
| Prop | Type |
| ----------------- | ------------------- |
| **`clientId`** |string
|
| **`redirectUri`** |string
|