Can I use the token from iOS SDK in Web API requests? - ios

I wanted to use Spotify SDK in an iOS app for login and then use the token from SDK to perform Web API requests. Is that the correct token for my use case?
Spotify iOS SDK:
iOS SDK | Spotify for Developers
Spotify Web API:
Web API | Spotify for Developers

It is the correct token to use but be sure to request all the scopes you will need for the Web API. Here is the iOS SDK documentation for using scopes with iOS: https://spotify.github.io/ios-sdk/html/Constants/SPTScope.html
An example using SPTScope:
let requestedScopes: SPTScope = [
.appRemoteControl,
.userReadEmail,
.userReadPrivate,
.streaming
]
sessionManager.initiateSession(with: requestedScopes, options: .default)

Related

Is it possible to integrate the Facebook login without using the iOS SDK?

Currently i am using the Facebook SDK to implement the Facebook login to our native iOS application. For this i am using the native iOS SDK for Facebook. This application is both for mobile and web, so is it possible to integrate Facebook login without using the SDK from application side. I mean authentication done fully through API and server side.
Please have a suggestion.
I referred to a SO link:
Design for Facebook authentication in an iOS app that also accesses a secured web service
Sure! You can always use their API directly, which essentially is the same as they do with the SDK.
Check out the documentation on the following link.
https://developers.facebook.com/docs/facebook-login/manually-build-a-login-flow

What is a good implementation of Facebook API on a mobile device?

I'm making an app with xamarin.iOS using Facebook API to login but I would like to know if my app should make the connection to the Facebook api or should I make a call to my asp net mvc webapi and let my backend make the connection to the Facebook API.
so here are the 2 concept :
mobile communicate directly with facebook api and after send the data to my asp webapi
or mobile request asp webapi then webapi make a request to facebook api
wich concept should I take ?
From mobile user prospective, it is better to use Facebook SDK for iOS in the mobile app so that the experience stays native all the way.
Remember, iOS supports Facebook even without Facebook app installed.
Facebook SDK for iOS takes care of all this.
After you login, you can send your token to the Web API and then use it.
Here are some articles and videos that will help you getting started:
Facebook iOS SDK for Xamarin - Getting started
Video: Login with Facebook in Xamarin Forms

How to use same Facebook app id in many ios applications

How to use same Facebook app for different ios application. I'm using facebook graph api 2.0 and i refered Nextpeer document. How to redirect the ios application from the facebook application using a customized URLscheme like fb39877767662comcompanynamegame

Gmail API 0Auth 2.0 using OAuth Phonegap SDK

Has anyone had success in using the Gmail API's authorization in a Phonegap application? I found this (http://phonegap-tips.com/articles/google-api-oauth-with-phonegaps-inappbrowser.html) that describes using the generic Google API OAuth with Phonegap's inappbrowser plugin, but the newly released Gmail API does OAuth authorization differently, and I'm not sure how to get it to work with Phonegap.
Note: It does work when I try a web version of my app, but the button that brings up the authorization screen doesn't do anything in Phonegap..not sure why. I do have the appropriate Android credentials for the app in the Google Developer's Console.
UPDATE: Using OAuth's Phonegap SDK (found after registering your app here: https://oauth.io/), I am able to authenticate a Google Account. However, I am unsure how to then call Gmail API methods or correctly pass whatever authentication tokens from the OAuth SDK to any Gmail API code. Has anyone done this and can share their knowledge?
I found a solution using the OAuthio Phonegap SDK. Then I can call the appropriate HTTPS requests from the Gmail API.
If you want to login your users via Google on iOS and Android, then use this new plugin I just created: https://github.com/EddyVerbruggen/cordova-plugin-googleplus
You will also receive the name and gender etc from the plugin. The plugin will also try SSO with any other Google apps installed on your device by using the Google+ SDK on both platforms.

Is Google Cross-client Auth possible with iOS, and if so, how?

I'm using oAuth2, and I have a project in my google API console with an iOS client and a Web client registered.
I'd like to auth in from my iOS app, and have my web backend retrieve an access token so it can do the heavy processing work with the Google api.
I've tried following these instructions which are for android: https://developers.google.com/accounts/docs/CrossClientAuth
But I keep getting an invalid scope when I assign the scope as:
oauth2:server:client_id:MY.WEB.CLIENT.ID:api_scope:http://www.google.com/m8/feeds/ https://mail.google.com/ https://www.googleapis.com/auth/plus.login
Anyone successfully implement a similar set up for iOS? If so please explain or share documentation? What libraries or SDKs did you use to get the code from google on the iOS app that the web backend could use to generate a proper access token of it's own?
As of June 18th, the google iOS SDK 1.7.0 supports one-time authorization code which is consistent with the Android feature: https://developers.google.com/+/release-notes/

Resources