简体   繁体   中英

how to deal with Adsense API - Android

I want to make an App to read my earning on Adsense. I made an app on Google and I generated a URL to login into the App.

https://accounts.google.com/o/oauth2/auth?from_login=0&response_type=code&scope=https://www.googleapis.com/auth/adsense&redirect_uri=xxxxxxxx&access_type=offline&as=-415b671ff3966dc2&pli=1&client_id=xxxxxxxxxxx&authuser=0&hl=en

but when the user login into the App and click on "Allow" the output has no access token just has "code". also I want to know if there is an example of using google OAuth api on android because I tried to use it but I failed.

There's an AdSense Management API sample for Android in: https://github.com/googleads/googleads-adsense-examples/tree/master/android

It uses Google Play Services to get the list of accounts on the device and the Google Client Library for Java to make the requests.

Yes, before calling any Google's API you need to be OAuth authenticated first, and thus to have a valid token.

Check this out to know how:

http://developer.android.com/training/id-auth/authenticate.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM