Develop application with libspotify - api

Now I want to develop an application on ARM with libspotify to play music.So I buy a premium account on spotify to get the API key.My original idea is that anyone who has my equipment could enjoy the music served by spotify,but the spotify does not allow to play the same song by the same account on different equipment at the same time.And even the user has their own account,they can not login from the application developed by my API key.How can I resolve the contradiction

As per Spotify's Docs, users must have premium accounts to use that functionality.
Login
To access Spotify functionality the user will need log in using Spotify or Facebook credentials. The logged in account needs to be a PREMIUM one. Note that in the Spotify login flow can be shown when the user e.g. tries to play music, it doesn’t need to come when launching the app. When logging in the user will need to accept our terms of service: spotify.com/legal.

Related

API access &OAuth

I am new to Google API usage, so please excuse the seemingly basic question.
I am writing a mobile app for members of a Club. The app needs to access a Google calendar and photo storage both maintained by the Club admin. I am having difficulty getting my head around the type of app I should be creating (Web Client, IOS, Android or all). When the OAuth consent screen opens, I am not sure which credentials the user should be entering (theirs or the Club admin).
What is required to allow the user to gain access to the shared calendar and photos?

Sonos - How to play a Spotify/AppleMusic track on a Sonos device from my iOS app?

I'm integrating the Sonos Control API into an iOS app. In our app:
the user is signed in either to Apple Music or Spotify via an Apple Music subscription or a Spotify premium account.
the user can play Apple Music and Spotify content within our app (we have the track / album IDs and use this to play music via the Spotiy / Apple Music APIs).
the user also has the Sonos app installed, and is logged in to their music service of choice (Spotify or Apple Music).
Now when the user is listening to a track in our app, we'd like the user to be able to listen to it via their Sonos device. Our app is for children and has parental control, so the user needs to stay within in our app.
Is there currently any way to achieve this?
Options we've looked into:
Streaming: As I understand it, there is no way to stream audio to a Sonos device. The AirPlay-Sonos compatibility is not an option as we're targeting all Sonos devices.
Sonos Control API: We then looked into starting the track using the Spotify or Apple Music track ID via the Sonos Control API, but this answer seems to imply that this is not possible. Is this true even if the user is logged in to the Spotify / Apple Music service both in our app and in the Sonos app? For example I could imagine using createSession with a Spotify / Apple Music accountID so that I would have access to these services, and then using loadCloudQueue to load the trackIDs. But I could be misunderstanding the API.
sonos-objc: This looked promising, but is very outdated and we haven't managed to set it up.
Any leads on this would be greatly appreciated.
Thanks!
You are correct, streaming tracks directly to Sonos is not currently supported in our platform. Using music object ids, with their constituent content and account ids, is a vehicle for actual content partners to build direct control integrations with Sonos. iHeart, Pandora, and Tidal have done this for instance.
The reason non-content owners can't utilize this functionality is due to the way authentication is handled. To ensure rights-holders property remains intact, we require partners to execute an account matching flow. This account matching requires direct access to a content partners' auth back end, pretty much limiting these types on integrations to the content partners themselves.
We understand that non-content partners want to put content directly on Sonos, and we're actively looking for the best ways to do that, while still allowing content parters to maintain control of how their content is consumed.

How to tie an account from a backend server to a google assistant user

I have a web application setup to handle webhook requests from an Actions-on-Google/Dialogflow application using the Google Assistant. Users don't need to sign-in to a google account in order to use my web application and I'd prefer to keep it that way, so that users can sign in with any email address.
I also want my users to be able to interact with my application using the Google Assistant, and be able to access personal/contextual data via the assistant (i.e. when a speaker says, "what's on my shopping list", the web app needs to be able to know what my means).
Currently, I have this working by using my web app to issue a unique short code to my user (in the web app UI) and then with an intent on the Assistant where the speaker says "My code is 1-2-3-4" and then my web app can identify the user from then on (by saving the userId from the webhook request to whatever user got the short code 1234 and then using that userId to lookup the user on each subsequent request.)
My question is, is there a better way to do this? Ideally, in my web app, I'd like to have something like an "Authorize Google Assistant" button, which would then link the user's google account to their web-app account, so that the conversation on the Assistant is seamless.
Has anyone done this before?
Thanks
This is the perfect use case for Account Linking with the Google Assistant.
From your users' perspective, they will start to use your Action. If they're doing so through a speaker and they haven't linked the account yet, they'll be directed to a mobile device to do so. On a mobile device, they'll be redirected to a page on your website where they will been to authenticate themselves and authorize your server to let them in through the Assistant. Once they have done so, they won't need to log in again, the accounts will be linked, and they'll be able to use the voice Action without further obstruction.
From your perspective as a developer, you'll need to setup an OAuth2 server (I suggest the code flow). That login process I mentioned is the first step in the OAuth dance, and will end up with you issuing a code to Google. They will then exchange this code for an Auth Token (with a limited lifetime) and a Refresh Token (which does not expire). They will periodically use the Refresh Token to get new, valid, Auth Tokens for this user. When the user issues a voice command, the Auth Token will be passed as a field in the JSON to your fulfillment server, and you can use this to verify who the user is and that they are authorized to use your service.

Twitter API: allow authenticated user to post tweets on another user's behalf

Twitter API allows to update "the authenticating user’s current status", as explained in the documentation page.
What I'd like to achieve instead is to update another user's current status. Consider a magazine's twitter account. I'd like different people to be able to update the magazine's status. Tweetdeck allows this, but it also allows a whole lot of other things like access to Direct Messages. I only want to provide certain authenticated users an interface (similar to Twitter's post-a-tweet interface) to post status and images to the shared account.
I could not find a simple explanation of how to use Twitter API to achieve the above functionality. Could someone please help?
If you have an app that implements the status update API and it is delivered to different people and they authorize the app with the magazine's twitter account, then the app will update that status. I can show an example also with code if this is what you're asking. However the main point is that, once a user has authorized the app, she/he doesn't need to be connected with the shared login any longer because the app will do that on the magazine's behalf.
BTW, similar question here: Twitter API: post on behalf of whom?
Edit
Just to summarize the comments:
The standard OAuth authentication requires the following main steps
1) to develop an app (registered with OAuth consumer key and secret) that implements the API update status 2) to install and authorize the app: during this step the onwer will be requested to enter the credentials of the passive account in a Twitter link opened with the browser, 3) then - after a fallback - the app will store the access token and any user of the app will be able to update the status without login
Once you have developed an app that can post tweets on behalf of a passive twitter account using the standard OAuth, you could make that functionality available to the authenticated users of a website.

in youtube API 3 user authentication required or registering the app by the developer is enough?

i want to develop an android app using youtube API 3.
It is necessary that the user who will be using the app has to login with his/her gmail credentials to actually view a video?
Or just registering the app here https://developers.google.com/youtube/registering_an_application is fine and the user watching the video or using the app need not login to his/her gmail account.
It is necessary that the user who will be using the app has to login with his/her gmail credentials to actually view a video?
No. Authentication via OAuth is only necessary if your application requires access to "private user data". Simply viewing a video does not meet those requirements.
More details here: https://developers.google.com/youtube/v3/guides/authentication